mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
gui update
This commit is contained in:
@@ -14,7 +14,7 @@ class MainMenu(Menu):
|
||||
|
||||
self.image = PhotoImage(file="resources/caumap.gif")
|
||||
map = Label(window.left_pane, image=self.image)
|
||||
map.grid(column=0, row=0)
|
||||
map.grid()
|
||||
|
||||
self.frame = self.window.right_pane
|
||||
self.frame.grid_columnconfigure(0, weight=1)
|
||||
@@ -26,12 +26,12 @@ class MainMenu(Menu):
|
||||
|
||||
def label(text):
|
||||
nonlocal row
|
||||
Label(self.frame, text=text).grid(column=0, row=row, sticky=NW)
|
||||
Label(self.frame, text=text).grid(row=row, sticky=NW)
|
||||
row += 1
|
||||
|
||||
def event_button(event, text):
|
||||
nonlocal row
|
||||
Button(self.frame, text=text, command=self.start_event(event)).grid(column=0, row=row, sticky=N)
|
||||
Button(self.frame, text=text, command=self.start_event(event)).grid(row=row, sticky=N)
|
||||
row += 1
|
||||
|
||||
def cp_button(cp):
|
||||
@@ -41,11 +41,14 @@ class MainMenu(Menu):
|
||||
"^" * cp.base.total_planes,
|
||||
"." * cp.base.total_armor,
|
||||
"*" * cp.base.total_aa)
|
||||
Button(self.frame, text=title, command=self.go_cp(cp)).grid(column=0, row=row, sticky=NW)
|
||||
Button(self.frame, text=title, command=self.go_cp(cp)).grid(row=row, sticky=NW)
|
||||
row += 1
|
||||
|
||||
Button(self.frame, text="Pass turn", command=self.pass_turn).grid(column=0, row=row, sticky=N); row += 1
|
||||
label("Budget: {}m".format(self.game.budget))
|
||||
statusbar = Frame(self.frame).grid(column=0, row=row, sticky=NSEW)
|
||||
row += 1
|
||||
|
||||
Label(statusbar, text="Budget: {}m".format(self.game.budget)).grid(column=0, row=0, sticky=NW)
|
||||
Button(statusbar, text="Pass turn", command=self.pass_turn).grid(column=1, row=0, sticky=NE)
|
||||
|
||||
for event in self.game.events:
|
||||
if not event.informational:
|
||||
@@ -58,11 +61,11 @@ class MainMenu(Menu):
|
||||
|
||||
event_button(event, "{} {}".format(event.attacker.name != self.game.player and "!" or " ", event))
|
||||
|
||||
Separator(self.frame, orient='horizontal').grid(column=0, row=row, sticky=EW); row += 1
|
||||
Separator(self.frame, orient='horizontal').grid(row=row, sticky=EW); row += 1
|
||||
for cp in self.game.theater.player_points():
|
||||
cp_button(cp)
|
||||
|
||||
Separator(self.frame, orient='horizontal').grid(column=0, row=row, sticky=EW); row += 1
|
||||
Separator(self.frame, orient='horizontal').grid(row=row, sticky=EW); row += 1
|
||||
for cp in self.game.theater.enemy_bases():
|
||||
title = "[{}] {}{}{}{}".format(
|
||||
int(cp.base.strength * 10),
|
||||
@@ -70,7 +73,7 @@ class MainMenu(Menu):
|
||||
"^" * cp.base.total_planes,
|
||||
"." * cp.base.total_armor,
|
||||
"*" * cp.base.total_aa)
|
||||
Label(self.frame, text=title).grid(column=0, row=row, sticky=NE)
|
||||
Label(self.frame, text=title).grid(row=row, sticky=NE)
|
||||
row += 1
|
||||
|
||||
def pass_turn(self):
|
||||
|
||||
Reference in New Issue
Block a user