Skip to content

Commit

Permalink
Add manual option for full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Peterclark1996 committed Feb 17, 2024
1 parent 9d24eb5 commit 9009828
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 29 deletions.
60 changes: 31 additions & 29 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,36 +122,38 @@ const App = () => {

return (
<div className="app bg-secondary">
<aside className={`d-flex flex-column gap-2 ${classes.sidePanel}`}>
{getWorldListDropdown()}
{hasWorldDates && (
<>
{getDatePicker()}
<CityScaleSlider />
<TabbedOptions
title="Islands"
options={ISLAND_RENDER_OPTIONS}
selectedOption={options.islands}
setSelectedOption={option => options.setOption({ key: "islands", value: option })}
{!options.fullscreen && (
<aside className={`d-flex flex-column gap-2 ${classes.sidePanel}`}>
{getWorldListDropdown()}
{hasWorldDates && (
<>
{getDatePicker()}
<CityScaleSlider />
<TabbedOptions
title="Islands"
options={ISLAND_RENDER_OPTIONS}
selectedOption={options.islands}
setSelectedOption={option => options.setOption({ key: "islands", value: option })}
/>
<TabbedOptions
title="Grey Players"
options={["on", "off"]}
selectedOption={options.greyPlayers ? "on" : "off"}
setSelectedOption={option => options.setOption({ key: "greyPlayers", value: option === "on" })}
/>
</>
)}
{hasWorldData && (
<AllianceList
alliances={topAlliances}
allianceColours={allianceColours}
allianceLayers={allianceLayers}
showLayer={showLayer}
hideLayer={hideLayer}
/>
<TabbedOptions
title="Grey Players"
options={["on", "off"]}
selectedOption={options.greyPlayers ? "on" : "off"}
setSelectedOption={option => options.setOption({ key: "greyPlayers", value: option === "on" })}
/>
</>
)}
{hasWorldData && (
<AllianceList
alliances={topAlliances}
allianceColours={allianceColours}
allianceLayers={allianceLayers}
showLayer={showLayer}
hideLayer={hideLayer}
/>
)}
</aside>
)}
</aside>
)}
{getMapContent()}
</div>
)
Expand Down
4 changes: 4 additions & 0 deletions client/src/hooks/useOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type Options = {
greyPlayers: boolean
cityScale: number
hiddenAllianceIds: number[]
fullscreen: boolean
setOption: (action: OptionSetActions) => void
}

Expand Down Expand Up @@ -37,6 +38,8 @@ const useOptions = () => {

const cityScale = parseFloat(searchParams.get("cityScale") ?? "100")

const fullscreen = searchParams.get("fullscreen") === "true"

const hiddenAllianceIds =
searchParams
.get("hiddenAllianceIds")
Expand Down Expand Up @@ -66,6 +69,7 @@ const useOptions = () => {
greyPlayers,
cityScale,
hiddenAllianceIds,
fullscreen,
setOption
}

Expand Down

0 comments on commit 9009828

Please sign in to comment.