Respect sidebaropened dynmap config on larger screens
This commit is contained in:
parent
ed2472dc55
commit
095c0e1bf3
@ -51,6 +51,7 @@ function buildServerConfig(response: any): DynmapServerConfig {
|
||||
title: response.title || 'Dynmap',
|
||||
loginEnabled: response['login-enabled'] || false,
|
||||
maxPlayers: response.maxcount || 0,
|
||||
expandUI: response.sidebaropened && response.sidebaropened !== 'false',
|
||||
hash: response.confighash || 0,
|
||||
};
|
||||
}
|
||||
|
1
src/dynmap.d.ts
vendored
1
src/dynmap.d.ts
vendored
@ -54,6 +54,7 @@ interface DynmapServerConfig {
|
||||
loginEnabled: boolean;
|
||||
maxPlayers: number;
|
||||
grayHiddenPlayers: boolean;
|
||||
expandUI: boolean;
|
||||
hash: number;
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,11 @@ export const mutations: MutationTree<State> & Mutations = {
|
||||
// Sets configuration options from the initial config fetch
|
||||
[MutationTypes.SET_CONFIGURATION](state: State, config: DynmapServerConfig) {
|
||||
state.configuration = Object.assign(state.configuration, config);
|
||||
|
||||
if(state.configuration.expandUI && !state.ui.smallScreen) {
|
||||
state.ui.visibleElements.add('players');
|
||||
state.ui.visibleElements.add('maps');
|
||||
}
|
||||
},
|
||||
|
||||
//Set messsages from the initial config fetch
|
||||
|
@ -82,6 +82,7 @@ export const state: State = {
|
||||
loginEnabled: false,
|
||||
maxPlayers: 0,
|
||||
grayHiddenPlayers: false,
|
||||
expandUI: false,
|
||||
hash: 0,
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user