diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b7569a3342a..7476dbd6acf 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -250,6 +250,7 @@ GLOBAL_LIST_EMPTY(gamemode_cache) var/wikiurl var/forumurl var/forum_passphrase + var/rulesurl var/githuburl //Alert level description @@ -646,6 +647,9 @@ GENERAL_PROTECT_DATUM(/datum/configuration) if ("forumurl") GLOB.config.forumurl = value + if ("rulesurl") + GLOB.config.rulesurl = value + if ("forum_passphrase") GLOB.config.forum_passphrase = value diff --git a/config/example/config.txt b/config/example/config.txt index aa1fd2ea590..aaae2eea89f 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -229,6 +229,9 @@ GUEST_BAN ## GitHub address # GITHUBURL https://github.com/example-user/example-repository +## Rules address +# RULESURL https://aurorastation.org/rules.html + ## Ban appeals URL - usually for a forum or wherever people should go to contact your admins. # BANAPPEALS http://example.com diff --git a/html/changelogs/mattatlas-rulesupdate.yml b/html/changelogs/mattatlas-rulesupdate.yml new file mode 100644 index 00000000000..63710c1e243 --- /dev/null +++ b/html/changelogs/mattatlas-rulesupdate.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - qol: "The rules button now directly links to the rules page." + - qol: "TGUIfied the interface button alerts." diff --git a/interface/interface.dm b/interface/interface.dm index ed98086f1e3..37ddc5c72a3 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -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)