Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/simonsays_drgreengiant/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __post_init__(self):
actions.update(randomaction)

self.config.update(randomconfig)

self.actions = actions

def find_tag_by_command(self, command: str) -> str | None:
Expand Down
9 changes: 9 additions & 0 deletions src/simonsays_drgreengiant/gameactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ def run(self, *, force: bool = False) -> errorcodes.ErrorSet:

#####################################################################

@dataclasses.dataclass(slots=True, frozen=True)
class ActionConfigPair:
"""A pair of an action and config"""
action: Action
config: ActionConfig


ActionConfigFp = tuple[GenericAction, ActionConfig]


@dataclasses.dataclass(slots=True)
class ActionAndConfig:
Expand Down
2 changes: 1 addition & 1 deletion src/simonsays_drgreengiant/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def make_selection_frame(where, cfg: config.Config) -> tuple[tk.Frame, tk.String
selection.set(next(iter(cfg.config)))

tk.Label(frame, text="Select action:").pack(side=tk.LEFT, anchor=tk.W, padx=10)
tk.OptionMenu(frame, selection, *list(cfg.config.keys())).pack(side=tk.RIGHT, anchor=tk.E, padx=10)
tk.OptionMenu(frame, selection, *sorted(list(cfg.config.keys()))).pack(side=tk.RIGHT, anchor=tk.E, padx=10)

return frame, selection

Expand Down
Loading