minor fixes

This commit is contained in:
Vasyl Horbachenko 2018-10-12 03:37:32 +03:00
parent 64bd3e6a52
commit d6b1b8665d
8 changed files with 15 additions and 20 deletions

View File

@ -103,10 +103,8 @@ class ArmorConflictGenerator:
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):
padding = FRONTLINE_CAS_PADDING if FRONTLINE_CAS_PADDING < self.conflict.distance else 0
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)
def generate_passengers(self, count: int):

Binary file not shown.

Binary file not shown.

View File

@ -127,9 +127,11 @@ class Base:
elif unit_type in self.aa:
target_array = self.aa
else:
print("Base didn't find event type {}".format(unit_type))
continue
if unit_type not in target_array:
print("Base didn't find event type {}".format(unit_type))
continue
target_array[unit_type] = max(target_array[unit_type] - count, 0)

View File

@ -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))]:
row = 2
def purchase_row(unit_type, unit_price):
nonlocal row
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 = 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)
self.bought_amount_labels[unit_type] = label

View File

@ -69,15 +69,11 @@ class EventMenu(Menu):
row += 1
threat_descr = self.event.threat_description
if threat_descr:
threat_descr = "Approx. {}".format(threat_descr)
# Header
header("Mission Menu", "title")
# 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
Label(self.frame, text="Amount", **STYLES["widget"]).grid(row=row, column=1, columnspan=2)

View File

@ -74,16 +74,16 @@ class MainMenu(Menu):
departure = None
deliveries = False
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 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):
new_destination = "At {}".format(event.to_cp.name)
else:

View File

@ -11,7 +11,7 @@ class Window:
self.tk = Tk()
self.tk.title("DCS Liberation")
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_rowconfigure(0, weight=1)