Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CO tracker #1295

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
11 changes: 11 additions & 0 deletions src/modlunky2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ class PacinoGolfTrackerConfig(CommonTrackerConfig):
show_pacifist_strokes: bool = field(default=False, skip_if_default=True)


@serialize(rename_all="kebabcase")
@deserialize(rename_all="kebabcase")
@dataclass
class COTrackerConfig(CommonTrackerConfig):
theme_name_style: str = field(default="Full area names")
show_run_stats: bool = field(default=True)
show_session_stats: bool = field(default=True)
show_header: bool = field(default=True)


@serialize(rename_all="kebabcase")
@deserialize(rename_all="kebabcase")
@dataclass
Expand All @@ -188,6 +198,7 @@ class TrackersConfig:
pacino_golf: PacinoGolfTrackerConfig = field(
default_factory=PacinoGolfTrackerConfig
)
co_tracker: COTrackerConfig = field(default_factory=COTrackerConfig)


@serialize # Note: these fields aren't renamed for historical reasons
Expand Down
9 changes: 9 additions & 0 deletions src/modlunky2/mem/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
dc_struct,
sc_int32,
sc_uint32,
sc_uint64,
sc_int8,
sc_uint8,
)
Expand Down Expand Up @@ -147,6 +148,11 @@ class Items:
)


@dataclass(frozen=True)
class ThemeInfo:
sub_theme_address: int = struct_field(0x10, sc_uint64, default=0)


@dataclass(frozen=True)
class State:
screen_last: Screen = struct_field(0x08, sc_int32, default=Screen.LEVEL_TRANSITION)
Expand All @@ -167,6 +173,9 @@ class State:
world_next: int = struct_field(0x69, sc_uint8, default=1)
level: int = struct_field(0x6A, sc_uint8, default=1)
level_next: int = struct_field(0x6B, sc_uint8, default=2)
theme_info: Optional[ThemeInfo] = struct_field(
0x6C, pointer(dc_struct), default_factory=ThemeInfo
)
theme: Theme = struct_field(0x74, sc_uint8, default=Theme.DWELLING)
theme_next: Theme = struct_field(0x75, sc_uint8, default=Theme.DWELLING)
win_state: WinState = struct_field(0x76, sc_int8, default=WinState.NO_WIN)
Expand Down
Binary file added src/modlunky2/static/images/orb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/modlunky2/ui/trackers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .timer import TimerButtons
from .gem import GemButtons
from .pacino_golf_tracker import PacinoGolfButtons
from .co_tracker import COTrackerButtons

logger = logging.getLogger(__name__)

Expand All @@ -27,6 +28,7 @@ def __init__(self, parent, ml_config: Config, *args, **kwargs):
self.add_button(TimerButtons(self, self.ml_config))
self.add_button(GemButtons(self, self.ml_config))
self.add_button(PacinoGolfButtons(self, self.ml_config))
self.add_button(COTrackerButtons(self, self.ml_config))

self.rowconfigure(self.button_index, weight=1)

Expand Down
Loading