Skip to content

Commit

Permalink
Highlight elections in orange and wars in red in activity window.
Browse files Browse the repository at this point in the history
  • Loading branch information
aussig committed Dec 23, 2024
1 parent f77bf7f commit 7387d00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## vx.x.x - xxxx-xx-xx

### New Features:

* Highlight conflict states in the on-screen activity window: Elections in orange and wars in red.


## v4.2.0 - 2024-12-22
Expand Down
9 changes: 7 additions & 2 deletions bgstally/windows/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ttkHyperlinkLabel import HyperlinkLabel

from bgstally.activity import STATES_WAR, Activity
from bgstally.activity import STATES_WAR, STATES_ELECTION, Activity
from bgstally.constants import (COLOUR_HEADING_1, FOLDER_ASSETS, FONT_HEADING_1, FONT_HEADING_2, FONT_TEXT, CheckStates, CZs, DiscordActivity, DiscordChannel,
DiscordPostStyle)
from bgstally.debug import Debug
Expand Down Expand Up @@ -275,8 +275,13 @@ def show(self, activity: Activity):
settlement_row_index += 1

col = 2

ttk.Label(frm_table, text="{0:.2f}".format(faction['Influence'] * 100)).grid(row=x + header_rows, column=col, sticky=tk.N); col += 1
ttk.Label(frm_table, text=faction['FactionState']).grid(row=x + header_rows, column=col, sticky=tk.N); col += 1

if (faction['FactionState'] in STATES_WAR): ttk.Label(frm_table, foreground="red", text=faction['FactionState']).grid(row=x + header_rows, column=col, sticky=tk.N); col += 1
elif (faction['FactionState'] in STATES_ELECTION): ttk.Label(frm_table, foreground="orange", text=faction['FactionState']).grid(row=x + header_rows, column=col, sticky=tk.N); col += 1
else: ttk.Label(frm_table, text=faction['FactionState']).grid(row=x + header_rows, column=col, sticky=tk.N); col += 1

MissionPointsVar = tk.IntVar(value=faction['MissionPoints']['m'])
ttk.Spinbox(frm_table, from_=-999, to=999, width=3, textvariable=MissionPointsVar).grid(row=x + header_rows, column=col, sticky=tk.N, padx=2, pady=2); col += 1
MissionPointsVar.trace('w', partial(self._mission_points_change, nb_tab, tab_index, MissionPointsVar, True, chk_enable_all, activity, system, faction, x))
Expand Down

0 comments on commit 7387d00

Please sign in to comment.