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',
|
title: response.title || 'Dynmap',
|
||||||
loginEnabled: response['login-enabled'] || false,
|
loginEnabled: response['login-enabled'] || false,
|
||||||
maxPlayers: response.maxcount || 0,
|
maxPlayers: response.maxcount || 0,
|
||||||
|
expandUI: response.sidebaropened && response.sidebaropened !== 'false',
|
||||||
hash: response.confighash || 0,
|
hash: response.confighash || 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
1
src/dynmap.d.ts
vendored
1
src/dynmap.d.ts
vendored
@ -54,6 +54,7 @@ interface DynmapServerConfig {
|
|||||||
loginEnabled: boolean;
|
loginEnabled: boolean;
|
||||||
maxPlayers: number;
|
maxPlayers: number;
|
||||||
grayHiddenPlayers: boolean;
|
grayHiddenPlayers: boolean;
|
||||||
|
expandUI: boolean;
|
||||||
hash: number;
|
hash: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +79,11 @@ export const mutations: MutationTree<State> & Mutations = {
|
|||||||
// Sets configuration options from the initial config fetch
|
// Sets configuration options from the initial config fetch
|
||||||
[MutationTypes.SET_CONFIGURATION](state: State, config: DynmapServerConfig) {
|
[MutationTypes.SET_CONFIGURATION](state: State, config: DynmapServerConfig) {
|
||||||
state.configuration = Object.assign(state.configuration, config);
|
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
|
//Set messsages from the initial config fetch
|
||||||
|
@ -82,6 +82,7 @@ export const state: State = {
|
|||||||
loginEnabled: false,
|
loginEnabled: false,
|
||||||
maxPlayers: 0,
|
maxPlayers: 0,
|
||||||
grayHiddenPlayers: false,
|
grayHiddenPlayers: false,
|
||||||
|
expandUI: false,
|
||||||
hash: 0,
|
hash: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user