summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/renderer/gameserver/server.ts38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/renderer/gameserver/server.ts b/src/renderer/gameserver/server.ts
index 235b8be..ed462c4 100644
--- a/src/renderer/gameserver/server.ts
+++ b/src/renderer/gameserver/server.ts
@@ -25,7 +25,7 @@ export default class GameServer {
//Online counter
const OnlineCounterContainer = document.createElement('div');
- OnlineCounterContainer.appendChild(makeOnlineCounterList(this));
+ //OnlineCounterContainer.appendChild(makeOnlineCounterList(this));
sidebarItem.appendChild(OnlineCounterContainer);
//Title
const title = document.createElement('div');
@@ -38,7 +38,6 @@ export default class GameServer {
titleText.innerText = this.menuName;
-
title.appendChild(titleIMG);
title.appendChild(titleText);
@@ -47,6 +46,41 @@ export default class GameServer {
switchPage("SERVER",this.name);
});
+ let onlineBoxActive:boolean = false;
+ let onlineBoxSchouldBeActive:boolean = false;
+ let updateOnlineContainer = () => {
+ if(onlineBoxSchouldBeActive == onlineBoxActive)return;
+ while (OnlineCounterContainer.firstChild) {
+ OnlineCounterContainer.removeChild(OnlineCounterContainer.firstChild);
+ }
+ if(onlineBoxSchouldBeActive){
+ OnlineCounterContainer.appendChild(makeOnlineCounterList(this));
+ }
+ onlineBoxActive = onlineBoxSchouldBeActive;
+ console.log(onlineBoxSchouldBeActive);
+ }
+
+ let SetUpdate = (state:boolean)=>{
+ onlineBoxSchouldBeActive = state;
+ setTimeout(()=>{updateOnlineContainer();},160);
+ };
+
+ title.addEventListener("mouseover", ()=>{
+ SetUpdate(true);
+ });
+
+ title.addEventListener("mouseout", ()=>{
+ SetUpdate(false);
+ });
+
+ OnlineCounterContainer.addEventListener("mouseover", ()=>{
+ SetUpdate(true);
+ });
+
+ OnlineCounterContainer.addEventListener("mouseout", ()=>{
+ SetUpdate(false);
+ });
+
sidebarItem.appendChild(title);
//Collapsable