Fix #1490, #1495, #1430, #1425, #1472, plus spacelube (#1537)

Fixes #1490
Fixes #1495
Fixes runtimes from meteors.
Fixes #1430
Fixes #1425
Fxies #1472
Fixes spacelube not drying.
This commit is contained in:
skull132
2017-01-12 23:07:46 +02:00
committed by GitHub
parent 494a9f4523
commit 9d3556283e
8 changed files with 60 additions and 22 deletions
@@ -255,21 +255,21 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
. += "<b>Hair</b><br>"
if(has_flag(mob_species, HAS_HAIR_COLOR))
. += "<a href='?src=\ref[src];hair_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_hair, 2)][num2hex(pref.g_hair, 2)][num2hex(pref.b_hair, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_hair, 2)][num2hex(pref.g_hair, 2)][num2hex(pref.b_hair)]'><tr><td>__</td></tr></table></font> "
. += "<a href='?src=\ref[src];hair_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_hair, 2)][num2hex(pref.g_hair, 2)][num2hex(pref.b_hair, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_hair, 2)][num2hex(pref.g_hair, 2)][num2hex(pref.b_hair, 2)]'><tr><td>__</td></tr></table></font> "
. += " Style: <a href='?src=\ref[src];hair_style=1'>[pref.h_style]</a><br>"
. += "<br><b>Facial</b><br>"
if(has_flag(mob_species, HAS_HAIR_COLOR))
. += "<a href='?src=\ref[src];facial_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_facial, 2)][num2hex(pref.g_facial, 2)][num2hex(pref.b_facial, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_facial, 2)][num2hex(pref.g_facial, 2)][num2hex(pref.b_facial)]'><tr><td>__</td></tr></table></font> "
. += "<a href='?src=\ref[src];facial_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_facial, 2)][num2hex(pref.g_facial, 2)][num2hex(pref.b_facial, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_facial, 2)][num2hex(pref.g_facial, 2)][num2hex(pref.b_facial, 2)]'><tr><td>__</td></tr></table></font> "
. += " Style: <a href='?src=\ref[src];facial_style=1'>[pref.f_style]</a><br>"
if(has_flag(mob_species, HAS_EYE_COLOR))
. += "<br><b>Eyes</b><br>"
. += "<a href='?src=\ref[src];eye_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_eyes, 2)][num2hex(pref.g_eyes, 2)][num2hex(pref.b_eyes, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_eyes, 2)][num2hex(pref.g_eyes, 2)][num2hex(pref.b_eyes)]'><tr><td>__</td></tr></table></font><br>"
. += "<a href='?src=\ref[src];eye_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_eyes, 2)][num2hex(pref.g_eyes, 2)][num2hex(pref.b_eyes, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_eyes, 2)][num2hex(pref.g_eyes, 2)][num2hex(pref.b_eyes, 2)]'><tr><td>__</td></tr></table></font><br>"
if(has_flag(mob_species, HAS_SKIN_COLOR))
. += "<br><b>Body Color</b><br>"
. += "<a href='?src=\ref[src];skin_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin)]'><tr><td>__</td></tr></table></font><br>"
. += "<a href='?src=\ref[src];skin_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><tr><td>__</td></tr></table></font><br>"
/datum/category_item/player_setup_item/general/body/proc/has_flag(var/datum/species/mob_species, var/flag)
return mob_species && (mob_species.appearance_flags & flag)
@@ -41,11 +41,11 @@
var/undies = get_undies()
var/gender_socks = get_gender_socks()
if(!get_key_by_value(undies, pref.underwear))
pref.underwear = undies[1]
pref.underwear = undies[undies[1]]
if(!get_key_by_value(undershirt_t, pref.undershirt))
pref.undershirt = undershirt_t[1]
pref.undershirt = undershirt_t[undershirt_t[1]]
if(!get_key_by_value(gender_socks, pref.socks))
pref.socks = gender_socks[1]
pref.socks = gender_socks[gender_socks[1]]
var/total_cost = 0
for(var/gear_name in pref.gear)
+28 -2
View File
@@ -213,12 +213,12 @@ datum/preferences
if(!user || !user.client) return
var/dat = "<html><body><center>"
// #MARKER-SQLSAVE: Options and buttons.
if(path)
dat += "Slot - "
dat += "<a href='?src=\ref[src];load=1'>Load slot</a> - "
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>"
else
dat += "Please create an account to save your preferences."
@@ -271,6 +271,11 @@ datum/preferences
close_load_dialog(usr)
else if(href_list["close_load_dialog"])
close_load_dialog(usr)
else if(href_list["delete"])
if (!config.sql_saves)
return 0
if (alert(usr, "This will permanently delete the character you have loaded. Are you sure?", "Delete Character", "No", "Yes") == "Yes")
delete_character_sql()
else
return 0
@@ -541,3 +546,24 @@ datum/preferences
nanotrasen_relation = "Neutral"
update_preview_icon()
// Deletes a character from the database
/datum/preferences/proc/delete_character_sql(var/client/C)
if (!C)
return
if (!current_character)
C << "<span class='notice'>You do not have a character loaded.</span>"
return
if (!establish_db_connection(dbcon))
C << "<span class='notice'>Unable to establish database connection.</span>"
return
var/DBQuery/query = dbcon.NewQuery("UPDATE ss13_characters SET deleted_at = NOW() WHERE id = :char_id")
query.Execute(list(":char_id" = current_character))
// Create a new character.
new_setup(1)
C << "<span class='warning'>Character successfully deleted! Please make a new one or load an existing setup.</span>"