summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawnCable <lawncable.tmw2@simonlaux.de>2018-05-24 18:01:34 -0400
committerLawnCable <lawncable.tmw2@simonlaux.de>2018-05-24 18:01:34 -0400
commita6ee995cf6fb350aa7660f11d62d4859a9a1f295 (patch)
tree09746026805de69ca16b63b89623ff4a1f7fc703
parentd81bc993b8e4acc63af8cf0030d391c4befd77fb (diff)
downloadelectron-a6ee995cf6fb350aa7660f11d62d4859a9a1f295.tar.gz
electron-a6ee995cf6fb350aa7660f11d62d4859a9a1f295.tar.bz2
electron-a6ee995cf6fb350aa7660f11d62d4859a9a1f295.tar.xz
electron-a6ee995cf6fb350aa7660f11d62d4859a9a1f295.zip
Added some more sociallinks for tmw2
and News on info page for TMW Legacy
-rw-r--r--assets/index.css3
-rw-r--r--src/renderer/gameserver/data.ts7
-rw-r--r--src/renderer/gameserver/news.ts17
3 files changed, 21 insertions, 6 deletions
diff --git a/assets/index.css b/assets/index.css
index 446b1b5..d2b489e 100644
--- a/assets/index.css
+++ b/assets/index.css
@@ -269,6 +269,9 @@ z-index: 2;
padding: 5pt 5pt;
font-family: SourceSansProLight;
}
+.infoServerPage > .news > h2 {
+ margin-top: 0;
+}
.infoServerPage > .news > a,
.infoServerPage > .news > p > a {
diff --git a/src/renderer/gameserver/data.ts b/src/renderer/gameserver/data.ts
index 8140581..570fdb2 100644
--- a/src/renderer/gameserver/data.ts
+++ b/src/renderer/gameserver/data.ts
@@ -23,6 +23,11 @@ const TMW2 = new GameServer(
new socialLink("fas fa-home","Website","https://tmw2.org"),
new socialLink("fab fa-discord","Discord","https://discord.gg/J4gcaqM"),
new socialLink("fas fa-users","Forum","https://tmw2.org/forums/"),
+ new socialLink("fas fa-comments","IRC Chat","http://webchat.freenode.net/?channels=#tmw2"),
+ new socialLink("fab fa-youtube","Youtube","https://www.youtube.com/channel/UCiwW5dTmi2xMV_vJfj5Mq5Q"),
+ new socialLink("fab fa-steam","Steam Group","http://steamcommunity.com/groups/TheManaWorld2"),
+ new socialLink("fab fa-twitter","Twitter","https://twitter.com/TheManaWorld2"),
+ new socialLink("fab fa-gitlab","Gitlab","https://gitlab.com/TMW2"),
]
);
@@ -54,7 +59,7 @@ const TMW = new GameServer(
"The Mana World",
"The clasic TMW experience. Join adventures with people from all over the world.",
"https://www.themanaworld.org/news-feed.php",
- undefined,
+ {url:"http://themanaworld.github.io/tmwa-server-data/news.txt",type:NewsType.ManaPlus},
[{isVideo:false,file:"tmw/background1.png"}],
"tmw/icon.png",
[
diff --git a/src/renderer/gameserver/news.ts b/src/renderer/gameserver/news.ts
index b8c7b14..b748777 100644
--- a/src/renderer/gameserver/news.ts
+++ b/src/renderer/gameserver/news.ts
@@ -44,11 +44,18 @@ function killHTML(raw:string):string{
}
function manaTextParser(input:string){
- return input
- .replace(/\[@@(.+?)\|(.+?)@@\]/g,'<a href="$1">$2</a>')
+ const tmwLegacy = "##7Legacy Server##0";
+ let result = input;
+ if(result.indexOf(tmwLegacy) !== -1){
+ const i = result.indexOf(tmwLegacy) + tmwLegacy.length;
+ result = result.slice(0, result.indexOf(tmwLegacy, i));
+ result = result.replace(/\n \n /, "");
+ }
+ result = result.replace(/\[@@(.+?)\|(.+?)@@\]/g,'<a href="$1">$2</a>')
.replace(/##B(.+?)##b/g,'<b>$1</b>')
.replace(/##0 Actual Release: ##1 *(.+)/,'<h2>$1</h2>')
- .replace(/\n/g,"<br>")
- .replace(/br>([^]+?)<br></g,'br><p>$1</p><br><').replace(/<br>/g,"")
- .replace(/##\d/g,"");
+ .replace(/\n/g,"<br>");
+ if(result.indexOf(tmwLegacy) === -1)
+ result = result.replace(/br>([^]+?)<br></g,'br><p>$1</p><br><').replace(/<br>/g,"");
+ return result.replace(/##\d/g,"");
}