Add discord button to UI + config

This commit is contained in:
Cerebulon
2021-08-26 17:29:08 +01:00
parent 50e880ce5e
commit c51a4cf033
5 changed files with 39 additions and 8 deletions

View File

@@ -124,6 +124,7 @@ var/list/gamemode_cache = list()
var/wikisearchurl
var/forumurl
var/githuburl
var/discordurl
var/rulesurl
var/mapurl
@@ -541,6 +542,9 @@ var/list/gamemode_cache = list()
if ("guest_jobban")
config.guest_jobban = 1
if ("discordurl")
config.discordurl = value
if ("guest_ban")
config.guests_allowed = 0
@@ -1002,10 +1006,10 @@ var/list/gamemode_cache = list()
if("use_loyalty_implants")
config.use_loyalty_implants = 1
if("loadout_whitelist")
config.loadout_whitelist = text2num(value)
else
log_misc("Unknown setting in configuration: '[name]'")

View File

@@ -924,7 +924,7 @@ function get_cookie(key, deffo) {
// Button Controls that need background-color and text-color set.
var SKIN_BUTTONS = [
/* Rpane */ "rpane.textb", "rpane.infob", "rpane.wikib", "rpane.forumb", "rpane.rulesb", "rpane.github", "rpane.mapb", "rpane.changelog",
/* Rpane */ "rpane.textb", "rpane.infob", "rpane.wikib", "rpane.forumb", "rpane.rulesb", "rpane.github", "rpane.discord", "rpane.mapb", "rpane.changelog",
/* Mainwindow */ "mainwindow.saybutton", "mainwindow.mebutton", "mainwindow.hotkey_toggle"
];

View File

@@ -247,9 +247,13 @@ GUEST_BAN
## GitHub address
# GITHUBURL https://github.com/example-user/example-repository
## Ban appeals URL - usually for a forum or wherever people should go to contact your admins.
# BANAPPEALS http://example.com
## Discord address
#DISCORDURL https://discord.gg/someinvite
## In-game features
## spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
# FEATURE_OBJECT_SPELL_SYSTEM

View File

@@ -67,6 +67,19 @@
to_chat(src, "<span class='danger'>The GitHub URL is not set in the server configuration.</span>")
return
/client/verb/discord()
set name = "Discord"
set desc = "Visit the discord"
set hidden = 1
if(config.discordurl)
if(alert(usr, "This will open the Discord in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No")
return
src << link(config.discordurl)
else
to_chat(src, "<span class='danger'>The Discord URL is not set in the server configuration.</span>")
return
/client/verb/hotkeys_help()
set name = "hotkeys-help"
set category = "OOC"

View File

@@ -1324,9 +1324,19 @@ window "rpane"
saved-params = "splitter"
right = "outputwindow"
is-vert = false
elem "discord"
type = BUTTON
pos = 428,0
size = 60x16
anchor1 = none
anchor2 = none
saved-params = "is-checked"
text = "Discord"
command = "discord"
group = "rpanemode"
elem "github"
type = BUTTON
pos = 392,0
pos = 368,0
size = 60x16
anchor1 = none
anchor2 = none
@@ -1336,7 +1346,7 @@ window "rpane"
group = "rpanemode"
elem "mapb"
type = BUTTON
pos = 332,0
pos = 308,0
size = 60x16
anchor1 = none
anchor2 = none
@@ -1346,7 +1356,7 @@ window "rpane"
group = "rpanemode"
elem "rulesb"
type = BUTTON
pos = 272,0
pos = 248,0
size = 60x16
anchor1 = none
anchor2 = none
@@ -1366,7 +1376,7 @@ window "rpane"
group = "rpanemode"
elem "forumb"
type = BUTTON
pos = 212,0
pos = 188,0
size = 60x16
anchor1 = none
anchor2 = none
@@ -1376,7 +1386,7 @@ window "rpane"
group = "rpanemode"
elem "wikib"
type = BUTTON
pos = 152,0
pos = 128,0
size = 60x16
anchor1 = none
anchor2 = none