diff options
author | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-05-20 18:46:15 -0400 |
---|---|---|
committer | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-05-20 18:46:15 -0400 |
commit | fb8104900abcc7b38e912a051ab046bc257167b9 (patch) | |
tree | 2214c45e6a0533ca9f70cc4379dceca87916c44b /src/renderer | |
parent | 181e277b6cc4a085864d44f4e9b5a5322cf6ec4e (diff) | |
download | electron-fb8104900abcc7b38e912a051ab046bc257167b9.tar.gz electron-fb8104900abcc7b38e912a051ab046bc257167b9.tar.bz2 electron-fb8104900abcc7b38e912a051ab046bc257167b9.tar.xz electron-fb8104900abcc7b38e912a051ab046bc257167b9.zip |
Added some ui
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/gameserver/data.ts | 4 | ||||
-rw-r--r-- | src/renderer/gameserver/server.ts | 30 | ||||
-rw-r--r-- | src/renderer/serverView.ts | 10 |
3 files changed, 40 insertions, 4 deletions
diff --git a/src/renderer/gameserver/data.ts b/src/renderer/gameserver/data.ts index 429e2bf..7c43d9f 100644 --- a/src/renderer/gameserver/data.ts +++ b/src/renderer/gameserver/data.ts @@ -34,7 +34,7 @@ const Evol = new GameServer( "Evol Online", "[EvolDescription]", undefined,// Insert feed.xml here if found - [], + [{isVideo:false,file:"evol/background1.png"}], "evol/icon.png", [ new socialLink("fas fa-home","Website","https://evolonline.org/"), @@ -51,7 +51,7 @@ const TMW = new GameServer( "The Mana World", "The clasic TMW experience. Join adventures with people from all over the world.", undefined,// Insert feed.xml here if found - [], + [{isVideo:false,file:"tmw/background1.png"}], "tmw/icon.png", [ new socialLink("fas fa-home","Website","https://www.themanaworld.org/"), diff --git a/src/renderer/gameserver/server.ts b/src/renderer/gameserver/server.ts index cc7a90f..e18b43a 100644 --- a/src/renderer/gameserver/server.ts +++ b/src/renderer/gameserver/server.ts @@ -92,6 +92,36 @@ export default class GameServer { sidebarItem.appendChild(events); return sidebarItem; } + + getPage(type:string):HTMLElement{ + const page = document.createElement('div'); + if (typeof(type) === undefined || type == null){ + page.appendChild(this.getInfoPage()); + } else { + const content = document.createElement('div'); + content.classList.add("unknownServerPage"); + content.innerText = `Unknown page for${this.name}`; + page.appendChild(content); + } + return page; + } + + private getInfoPage():HTMLElement{ + const content = document.createElement('div'); + content.classList.add("infoServerPage"); + + const title = document.createElement('div'); + title.classList.add("title"); + title.innerText = this.name; + content.appendChild(title); + + const shrtDsrption = document.createElement('div'); + shrtDsrption.classList.add("shortDescription"); + shrtDsrption.innerText = this.shortDescription; + content.appendChild(shrtDsrption); + + return content; + } } export class socialLink { diff --git a/src/renderer/serverView.ts b/src/renderer/serverView.ts index 32fc308..8176c42 100644 --- a/src/renderer/serverView.ts +++ b/src/renderer/serverView.ts @@ -7,7 +7,6 @@ let SelectedGameserver:GameServer = null; const playBtn = document.getElementById('play'); playBtn.addEventListener('click', () => { - console.log("play"); ipcRenderer.send('play', SelectedGameserver.profile); }); @@ -46,6 +45,7 @@ function updateView(){ } } +const serverPage = document.getElementById('serverPage'); const switchPageEvent = document.createElement('span'); switchPageEvent.classList.add("switch-page-event"); switchPageEvent.addEventListener("site-changed", (event:CustomEvent)=>{ @@ -53,7 +53,13 @@ switchPageEvent.addEventListener("site-changed", (event:CustomEvent)=>{ SelectedGameserver = GameServerList.filter((server)=>server.name==event.detail.page)[0]; localStorage.setItem("selected_server", SelectedGameserver.name); - + while (serverPage.firstChild) { + serverPage.removeChild(serverPage.firstChild); + } + let page = SelectedGameserver.getPage(event.detail.subPage); + serverPage.appendChild(page); + // page.classList.add('animated'); + // page.classList.add('fadeIn'); }else{ SelectedGameserver == null; |