mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
minor fixes
This commit is contained in:
parent
64bd3e6a52
commit
d6b1b8665d
@ -103,10 +103,8 @@ class ArmorConflictGenerator:
|
|||||||
attacker_groups = list(db.unitdict_split(attackers, single_fight_attackers_count))
|
attacker_groups = list(db.unitdict_split(attackers, single_fight_attackers_count))
|
||||||
|
|
||||||
for attacker_group_dict, target_group_dict in zip_longest(attacker_groups, defender_groups):
|
for attacker_group_dict, target_group_dict in zip_longest(attacker_groups, defender_groups):
|
||||||
padding = FRONTLINE_CAS_PADDING if FRONTLINE_CAS_PADDING < self.conflict.distance else 0
|
|
||||||
|
|
||||||
position = self.conflict.position.point_from_heading(self.conflict.heading,
|
position = self.conflict.position.point_from_heading(self.conflict.heading,
|
||||||
random.randint(padding, int(self.conflict.distance - padding)))
|
random.randint(0, self.conflict.distance))
|
||||||
self._generate_fight_at(attacker_group_dict, target_group_dict, position)
|
self._generate_fight_at(attacker_group_dict, target_group_dict, position)
|
||||||
|
|
||||||
def generate_passengers(self, count: int):
|
def generate_passengers(self, count: int):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -127,9 +127,11 @@ class Base:
|
|||||||
elif unit_type in self.aa:
|
elif unit_type in self.aa:
|
||||||
target_array = self.aa
|
target_array = self.aa
|
||||||
else:
|
else:
|
||||||
|
print("Base didn't find event type {}".format(unit_type))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if unit_type not in target_array:
|
if unit_type not in target_array:
|
||||||
|
print("Base didn't find event type {}".format(unit_type))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
target_array[unit_type] = max(target_array[unit_type] - count, 0)
|
target_array[unit_type] = max(target_array[unit_type] - count, 0)
|
||||||
|
|||||||
@ -44,7 +44,6 @@ class BaseMenu(Menu):
|
|||||||
for i, tasks_column in [(i, tasks[idx:idx+tasks_per_column]) for i, idx in enumerate(range(0, len(tasks), tasks_per_column))]:
|
for i, tasks_column in [(i, tasks[idx:idx+tasks_per_column]) for i, idx in enumerate(range(0, len(tasks), tasks_per_column))]:
|
||||||
row = 2
|
row = 2
|
||||||
|
|
||||||
|
|
||||||
def purchase_row(unit_type, unit_price):
|
def purchase_row(unit_type, unit_price):
|
||||||
nonlocal row
|
nonlocal row
|
||||||
nonlocal column
|
nonlocal column
|
||||||
@ -54,7 +53,7 @@ class BaseMenu(Menu):
|
|||||||
|
|
||||||
Label(self.frame, text="{}".format(db.unit_type_name(unit_type)), **STYLES["widget"]).grid(row=row, column=column, sticky=W)
|
Label(self.frame, text="{}".format(db.unit_type_name(unit_type)), **STYLES["widget"]).grid(row=row, column=column, sticky=W)
|
||||||
|
|
||||||
label = Label(self.frame, text="({})".format(existing_units), **STYLES["widget"])
|
label = Label(self.frame, text="({}) ".format(existing_units), **STYLES["widget"])
|
||||||
label.grid(column=column + 1, row=row)
|
label.grid(column=column + 1, row=row)
|
||||||
self.bought_amount_labels[unit_type] = label
|
self.bought_amount_labels[unit_type] = label
|
||||||
|
|
||||||
|
|||||||
@ -69,15 +69,11 @@ class EventMenu(Menu):
|
|||||||
|
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
threat_descr = self.event.threat_description
|
|
||||||
if threat_descr:
|
|
||||||
threat_descr = "Approx. {}".format(threat_descr)
|
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
header("Mission Menu", "title")
|
header("Mission Menu", "title")
|
||||||
|
|
||||||
# Mission Description
|
# Mission Description
|
||||||
Label(self.frame, text="{}. {}".format(self.event, threat_descr), **STYLES["mission-preview"]).grid(row=row, column=0, columnspan=5, sticky=S+EW, padx=5, pady=5)
|
Label(self.frame, text="{}".format(self.event), **STYLES["mission-preview"]).grid(row=row, column=0, columnspan=5, sticky=S+EW, padx=5, pady=5)
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
Label(self.frame, text="Amount", **STYLES["widget"]).grid(row=row, column=1, columnspan=2)
|
Label(self.frame, text="Amount", **STYLES["widget"]).grid(row=row, column=1, columnspan=2)
|
||||||
|
|||||||
@ -74,16 +74,16 @@ class MainMenu(Menu):
|
|||||||
departure = None
|
departure = None
|
||||||
deliveries = False
|
deliveries = False
|
||||||
for event in events:
|
for event in events:
|
||||||
|
if event.from_cp.name != departure:
|
||||||
|
body = LabelFrame(self.frame, **STYLES["body"])
|
||||||
|
body.grid(column=column, row=1, sticky=NSEW)
|
||||||
|
row = 0
|
||||||
|
column += 1
|
||||||
|
|
||||||
|
departure = event.from_cp.name
|
||||||
|
departure_header(event.from_cp.name)
|
||||||
|
|
||||||
if not event.informational:
|
if not event.informational:
|
||||||
if event.from_cp.name != departure:
|
|
||||||
body = LabelFrame(self.frame, **STYLES["body"])
|
|
||||||
body.grid(column=column, row=1, sticky=NSEW)
|
|
||||||
row = 0
|
|
||||||
column += 1
|
|
||||||
|
|
||||||
departure = event.from_cp.name
|
|
||||||
departure_header(event.from_cp.name)
|
|
||||||
|
|
||||||
if self.game.is_player_attack(event):
|
if self.game.is_player_attack(event):
|
||||||
new_destination = "At {}".format(event.to_cp.name)
|
new_destination = "At {}".format(event.to_cp.name)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class Window:
|
|||||||
self.tk = Tk()
|
self.tk = Tk()
|
||||||
self.tk.title("DCS Liberation")
|
self.tk.title("DCS Liberation")
|
||||||
self.tk.iconbitmap("icon.ico")
|
self.tk.iconbitmap("icon.ico")
|
||||||
self.tk.resizable(True, True)
|
self.tk.resizable(False, False)
|
||||||
self.tk.grid_columnconfigure(0, weight=1)
|
self.tk.grid_columnconfigure(0, weight=1)
|
||||||
self.tk.grid_rowconfigure(0, weight=1)
|
self.tk.grid_rowconfigure(0, weight=1)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user