mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs. Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines. Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing. Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc. (Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
This commit is contained in:
@@ -169,7 +169,7 @@
|
||||
if(check_rights(R_DBRANKS, FALSE))
|
||||
if(!skip)
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Unable to connect to database, changes are temporary only.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Unable to connect to database, changes are temporary only."), confidential = TRUE)
|
||||
use_db = FALSE
|
||||
else
|
||||
use_db = tgui_alert(usr,"Permanent changes are saved to the database for future rounds, temporary changes will affect only the current round", "Permanent or Temporary?", list("Permanent", "Temporary", "Cancel"))
|
||||
@@ -227,7 +227,7 @@
|
||||
if(!.)
|
||||
return FALSE
|
||||
if(!admin_ckey && (. in GLOB.admin_datums+GLOB.deadmins))
|
||||
to_chat(usr, "<span class='danger'>[admin_key] is already an admin.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("[admin_key] is already an admin."), confidential = TRUE)
|
||||
return FALSE
|
||||
if(use_db)
|
||||
//if an admin exists without a datum they won't be caught by the above
|
||||
@@ -240,7 +240,7 @@
|
||||
return FALSE
|
||||
if(query_admin_in_db.NextRow())
|
||||
qdel(query_admin_in_db)
|
||||
to_chat(usr, "<span class='danger'>[admin_key] already listed in admin database. Check the Management tab if they don't appear in the list of admins.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("[admin_key] already listed in admin database. Check the Management tab if they don't appear in the list of admins."), confidential = TRUE)
|
||||
return FALSE
|
||||
qdel(query_admin_in_db)
|
||||
var/datum/db_query/query_add_admin = SSdbcore.NewQuery(
|
||||
@@ -304,7 +304,7 @@
|
||||
D.deactivate() //after logs so the deadmined admin can see the message.
|
||||
|
||||
/datum/admins/proc/auto_deadmin()
|
||||
to_chat(owner, "<span class='interface'>You are now a normal player.</span>", confidential = TRUE)
|
||||
to_chat(owner, span_interface("You are now a normal player."), confidential = TRUE)
|
||||
var/old_owner = owner
|
||||
deactivate()
|
||||
message_admins("[old_owner] deadmined via auto-deadmin config.")
|
||||
@@ -506,7 +506,7 @@
|
||||
return
|
||||
if(query_admins_with_rank.NextRow())
|
||||
qdel(query_admins_with_rank)
|
||||
to_chat(usr, "<span class='danger'>Error: Rank deletion attempted while rank still used; Tell a coder, this shouldn't happen.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Error: Rank deletion attempted while rank still used; Tell a coder, this shouldn't happen."), confidential = TRUE)
|
||||
return
|
||||
qdel(query_admins_with_rank)
|
||||
if(tgui_alert(usr,"Are you sure you want to remove [admin_rank]?","Confirm Removal",list("Do it","Cancel")) == "Do it")
|
||||
@@ -543,4 +543,4 @@
|
||||
qdel(query_sync_lastadminrank)
|
||||
return
|
||||
qdel(query_sync_lastadminrank)
|
||||
to_chat(usr, "<span class='admin'>Sync of [admin_key] successful.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_admin("Sync of [admin_key] successful."), confidential = TRUE)
|
||||
|
||||
Reference in New Issue
Block a user