mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
savefile corruption screen and escort RTB waypoints
This commit is contained in:
parent
8b0ef52721
commit
b2458ac244
10
__init__.py
10
__init__.py
@ -9,6 +9,7 @@ import theater.nevada
|
|||||||
import ui.window
|
import ui.window
|
||||||
import ui.mainmenu
|
import ui.mainmenu
|
||||||
import ui.newgamemenu
|
import ui.newgamemenu
|
||||||
|
import ui.corruptedsavemenu
|
||||||
|
|
||||||
from game.game import Game
|
from game.game import Game
|
||||||
from theater import start_generator
|
from theater import start_generator
|
||||||
@ -23,8 +24,9 @@ def proceed_to_main_menu(game: Game):
|
|||||||
|
|
||||||
|
|
||||||
w = ui.window.Window()
|
w = ui.window.Window()
|
||||||
game = persistency.restore_game()
|
try:
|
||||||
if not game:
|
game = persistency.restore_game()
|
||||||
|
if not game:
|
||||||
new_game_menu = None # type: NewGameMenu
|
new_game_menu = None # type: NewGameMenu
|
||||||
|
|
||||||
def start_new_game(player_name: str, enemy_name: str, terrain: str, sams: bool, midgame: bool, multiplier: float):
|
def start_new_game(player_name: str, enemy_name: str, terrain: str, sams: bool, midgame: bool, multiplier: float):
|
||||||
@ -54,8 +56,10 @@ if not game:
|
|||||||
|
|
||||||
new_game_menu = ui.newgamemenu.NewGameMenu(w, start_new_game)
|
new_game_menu = ui.newgamemenu.NewGameMenu(w, start_new_game)
|
||||||
new_game_menu.display()
|
new_game_menu.display()
|
||||||
else:
|
else:
|
||||||
proceed_to_main_menu(game)
|
proceed_to_main_menu(game)
|
||||||
|
except Exception as e:
|
||||||
|
ui.corruptedsavemenu.CorruptedSaveMenu(w).display()
|
||||||
|
|
||||||
w.run()
|
w.run()
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,8 @@ For example, player accessible Hornet is called `FA_18C_hornet`, and MANPAD Igla
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Prices for the aircraft.
|
Prices for the aircraft.
|
||||||
This defines both price for the player and prioritization for the enemy (i.e. less important bases will receive units with lower price)
|
This defines both price for the player (although only aircraft listed in CAP/CAS/Transport/Armor/AirDefense roles will be purchasable)
|
||||||
|
and prioritization for the enemy (i.e. less important bases will receive units with lower price)
|
||||||
"""
|
"""
|
||||||
PRICES = {
|
PRICES = {
|
||||||
# fighter
|
# fighter
|
||||||
@ -164,15 +165,13 @@ UNIT_BY_TASK = {
|
|||||||
|
|
||||||
PinpointStrike: [Armor.MBT_T_90, Armor.MBT_T_80U, Armor.MBT_T_55, Armor.MBT_M1A2_Abrams, Armor.MBT_M60A3_Patton, Armor.ATGM_M1134_Stryker, Armor.APC_BTR_80, ],
|
PinpointStrike: [Armor.MBT_T_90, Armor.MBT_T_80U, Armor.MBT_T_55, Armor.MBT_M1A2_Abrams, Armor.MBT_M60A3_Patton, Armor.ATGM_M1134_Stryker, Armor.APC_BTR_80, ],
|
||||||
AirDefence: [
|
AirDefence: [
|
||||||
AirDefence.AAA_Vulcan_M163,
|
# those are listed multiple times here to balance prioritization more into lower tier AAs
|
||||||
AirDefence.AAA_Vulcan_M163,
|
AirDefence.AAA_Vulcan_M163,
|
||||||
AirDefence.AAA_Vulcan_M163,
|
AirDefence.AAA_Vulcan_M163,
|
||||||
AirDefence.SAM_Avenger_M1097,
|
AirDefence.SAM_Avenger_M1097,
|
||||||
AirDefence.SAM_Avenger_M1097,
|
AirDefence.SAM_Avenger_M1097,
|
||||||
AirDefence.SAM_Patriot_ICC,
|
AirDefence.SAM_Patriot_ICC,
|
||||||
|
|
||||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
|
||||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
|
||||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||||
AirDefence.SAM_SA_18_Igla_MANPADS,
|
AirDefence.SAM_SA_18_Igla_MANPADS,
|
||||||
|
|||||||
@ -190,6 +190,9 @@ class AircraftConflictGenerator:
|
|||||||
for group in self.escort_targets:
|
for group in self.escort_targets:
|
||||||
wayp.tasks.append(EscortTaskAction(group.id, engagement_max_dist=ESCORT_ENGAGEMENT_MAX_DIST))
|
wayp.tasks.append(EscortTaskAction(group.id, engagement_max_dist=ESCORT_ENGAGEMENT_MAX_DIST))
|
||||||
|
|
||||||
|
group.add_waypoint(self.conflict.from_cp.position, RTB_ALTITUDE)
|
||||||
|
group.land_at(self.conflict.from_cp.at)
|
||||||
|
|
||||||
groups.append(group)
|
groups.append(group)
|
||||||
return groups
|
return groups
|
||||||
|
|
||||||
|
|||||||
17
ui/corruptedsavemenu.py
Normal file
17
ui/corruptedsavemenu.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from tkinter import *
|
||||||
|
from tkinter.ttk import *
|
||||||
|
|
||||||
|
from ui.window import *
|
||||||
|
|
||||||
|
|
||||||
|
class CorruptedSaveMenu(Menu):
|
||||||
|
def __init__(self, window: Window):
|
||||||
|
super(CorruptedSaveMenu, self).__init__(window, None, None)
|
||||||
|
self.frame = window.right_pane
|
||||||
|
|
||||||
|
def display(self):
|
||||||
|
self.window.clear_right_pane()
|
||||||
|
|
||||||
|
Label(text="Your save game was corrupted!").grid(row=0, column=0)
|
||||||
|
Label(text="Please restore it by replacing \"liberation_save\" file with \"liberation_save_tmp\" to restore last saved copy.").grid(row=1, column=0)
|
||||||
|
Label(text="You can find those files under user DCS directory.").grid(row=2, column=0)
|
||||||
@ -28,8 +28,7 @@ def restore_game():
|
|||||||
with open(_save_file(), "rb") as f:
|
with open(_save_file(), "rb") as f:
|
||||||
return pickle.load(f)
|
return pickle.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
raise e
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def save_game(game) -> bool:
|
def save_game(game) -> bool:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user