Skip to content

Commit

Permalink
Player View dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cynicaloptimist committed Mar 2, 2024
1 parent d132f8f commit 3492fdf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/PlayerView/ReactPlayerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export class ReactPlayerView {

private renderPlayerView(newState: PlayerViewState) {
this.playerViewState = newState;
document.body.classList.toggle("dark-mode", newState.settings.DarkMode);

renderReact(
<PlayerView
encounterState={this.playerViewState.encounterState}
Expand Down
1 change: 1 addition & 0 deletions client/Settings/components/OptionsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export function OptionsSettings(props: {
</Dropdown>

<h3>Player View</h3>
<Toggle fieldName="PlayerView.DarkMode">Dark Mode</Toggle>
<Dropdown
fieldName="PlayerView.MonsterHPVerbosity"
options={HpVerbosityOption}
Expand Down
1 change: 1 addition & 0 deletions common/PlayerViewSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface PlayerViewSettings {
MonsterHPVerbosity: HpVerbosityOption;
PlayerHPVerbosity: HpVerbosityOption;
HideMonstersOutsideEncounter: boolean;
DarkMode: boolean;
DisplayRoundCounter: boolean;
DisplayTurnTimer: boolean;
DisplayPortraits: boolean;
Expand Down
1 change: 1 addition & 0 deletions common/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function getDefaultSettings(): Settings {
MonsterHPVerbosity: HpVerbosityOption.ColoredLabel,
PlayerHPVerbosity: HpVerbosityOption.ActualHP,
HideMonstersOutsideEncounter: false,
DarkMode: false,
DisplayRoundCounter: false,
DisplayTurnTimer: false,
DisplayPortraits: false,
Expand Down

0 comments on commit 3492fdf

Please sign in to comment.