Updates the rules button and other interface buttons. (#18917)

the rules button now redirects to the rules page instead of using broken
html

---------

Signed-off-by: Matt Atlas <mattiathebest2000@hotmail.it>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2024-04-13 22:11:56 +00:00
committed by GitHub
co-authored by Matt Atlas
parent c1d241594b
commit 3ee09f963d
4 changed files with 64 additions and 10 deletions
+15 -10
View File
@@ -5,7 +5,7 @@
set hidden = 1
if(GLOB.config.wikiurl)
if(alert("This will open the wiki in your browser. Are you sure?",,"Yes","No")=="No")
if(tgui_alert(usr, "This will open the wiki in your browser. Are you sure?", "Wiki", list("Yes", "No")) == "No")
return
var/to_open = GLOB.config.wikiurl
@@ -20,8 +20,8 @@
set name = "forum"
set desc = "Visit the forum."
set hidden = 1
if( GLOB.config.forumurl )
if(alert("This will open the forum in your browser. Are you sure?",,"Yes","No")=="No")
if(GLOB.config.forumurl)
if(tgui_alert(usr, "This will open the forum in your browser. Are you sure?", "Forum", list("Yes", "No")) == "No")
return
send_link(src, GLOB.config.forumurl)
else
@@ -32,22 +32,27 @@
set name = "reportbug"
set desc = "Report a bug."
set hidden = 1
if( GLOB.config.githuburl )
if(alert("This will open the issue tracker in your browser. Are you sure?",,"Yes","No")=="No")
if(GLOB.config.githuburl)
if(tgui_alert(usr, "This will open the issue tracker in your browser. Are you sure?", "Issue Tracker", list("Yes", "No")) == "No")
return
send_link(src, GLOB.config.githuburl + "/issues")
else
to_chat(src, SPAN_WARNING("The issue tracker URL is not set in the server configuration."))
return
#define RULES_FILE "config/rules.html"
/client/verb/rules()
set name = "Rules"
set desc = "Show Server Rules."
set hidden = 1
src << browse(file2text(RULES_FILE), "window=rules;size=640x500")
#undef RULES_FILE
if(GLOB.config.rulesurl)
if(tgui_alert(usr, "This will open the rules in your browser. Are you sure?", "Rules", list("Yes", "No")) == "No")
return
send_link(src, GLOB.config.rulesurl)
else
to_chat(src, SPAN_WARNING("The rules URL is not set in the server configuration."))
return
/client/verb/hotkeys_help()
set name = "hotkeys-help"
@@ -179,7 +184,7 @@ Any-Mode: (hotkey doesn't need to be on)
set hidden = 1
if (GLOB.config.webint_url)
if(alert("This will open the web interface in your browser. Are you sure?", ,"Yes","No") == "No")
if(tgui_alert(usr, "This will open the Web Interface in your browser. Are you sure?", "Web Interface", list("Yes", "No")) == "No")
return
send_link(src, GLOB.config.webint_url)
else
@@ -192,7 +197,7 @@ Any-Mode: (hotkey doesn't need to be on)
set hidden = 1
if (SSdiscord && SSdiscord.active)
if(alert("This will open Discord in your browser or directly. Are you sure?",, "Yes", "No") == "Yes")
if(tgui_alert(usr, "This will open Discord in your browser. Are you sure?", "Discord", list("Yes", "No")) == "No")
var/url_link = SSdiscord.retreive_invite()
if (url_link)
send_link(src, url_link)