Adds a warning that character deletions are permanent (#17887)

* Adds a warning that character deletions are permanent

* Add confirmation prompt

* Update code/modules/client/preferences.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

---------

Co-authored-by: Werner <Arrow768@users.noreply.github.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
This commit is contained in:
Werner
2023-12-09 14:03:42 +01:00
committed by GitHub
parent 79039df4c3
commit fc0f42c7e5
2 changed files with 45 additions and 3 deletions
+4 -3
View File
@@ -247,7 +247,7 @@ var/list/preferences_datums = list()
dat += "<a href='?src=\ref[src];save=1'>Save slot</a> - "
dat += "<a href='?src=\ref[src];reload=1'>Reload slot</a>"
if (config.sql_saves)
dat += " - <a href='?src=\ref[src];delete=1'>Delete slot</a>"
dat += " - <a href='?src=\ref[src];delete=1'>Permanently delete slot</a>"
else
dat += "Please create an account to save your preferences."
@@ -369,8 +369,9 @@ var/list/preferences_datums = list()
else if(href_list["delete"])
if (!config.sql_saves)
return 0
if (alert(usr, "You will be unable to re-create a character with the same name! Are you sure you want to delete the loaded character?", "Delete Character", "No", "Yes") == "Yes")
delete_character_sql(usr.client)
if (alert(usr, "You will be unable to re-create a character with the same name! Are you sure you want to permanently [real_name]? The slot can not be restored.", "Permanently Delete Character", "No", "Yes") == "Yes")
if(alert(usr, "Are you sure you want to PERMANENTLY delete your character?","Confirm Permanent Deletion","Yes","No") == "Yes")
delete_character_sql(usr.client)
else
return 0