Revert "Revert "Merge branch 'master' into robotic-limbs-PT2""
This reverts commit 27a099c6bf.
This commit is contained in:
@@ -126,9 +126,8 @@
|
||||
|
||||
/// Messages currently seen by this client
|
||||
var/list/seen_messages
|
||||
|
||||
/// datum wrapper for client view
|
||||
var/datum/view_data/view_size
|
||||
/// viewsize datum for holding our view size
|
||||
var/datum/viewData/view_size
|
||||
|
||||
/// our current tab
|
||||
var/stat_tab
|
||||
@@ -162,6 +161,14 @@
|
||||
var/parallax_layers_max = 3
|
||||
var/parallax_animate_timer
|
||||
|
||||
/**
|
||||
* Assoc list with all the active maps - when a screen obj is added to
|
||||
* a map, it's put in here as well.
|
||||
*
|
||||
* Format: list(<mapname> = list(/obj/screen))
|
||||
*/
|
||||
var/list/screen_maps = list()
|
||||
|
||||
// List of all asset filenames sent to this client by the asset cache, along with their assoicated md5s
|
||||
var/list/sent_assets = list()
|
||||
/// List of all completed blocking send jobs awaiting acknowledgement by send_asset
|
||||
|
||||
@@ -268,7 +268,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
else
|
||||
prefs = new /datum/preferences(src)
|
||||
GLOB.preferences_datums[ckey] = prefs
|
||||
addtimer(CALLBACK(src, .proc/ensure_keys_set), 0) //prevents possible race conditions
|
||||
|
||||
addtimer(CALLBACK(src, .proc/ensure_keys_set), 10) //prevents possible race conditions
|
||||
|
||||
prefs.last_ip = address //these are gonna be used for banning
|
||||
prefs.last_id = computer_id //these are gonna be used for banning
|
||||
@@ -336,10 +337,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// if(SSinput.initialized) placed here on tg.
|
||||
// set_macros()
|
||||
// update_movement_keys()
|
||||
|
||||
// Initialize tgui panel
|
||||
tgui_panel.initialize()
|
||||
src << browse(file('html/statbrowser.html'), "window=statbrowser")
|
||||
@@ -472,16 +469,16 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
if (menuitem)
|
||||
menuitem.Load_checked(src)
|
||||
|
||||
// view_size = new(src, getScreenSize(prefs.widescreenpref))
|
||||
// view_size.resetFormat()
|
||||
// view_size.setZoomMode()
|
||||
// fit_viewport()
|
||||
view_size = new(src, getScreenSize(prefs.widescreenpref))
|
||||
view_size.resetFormat()
|
||||
view_size.setZoomMode()
|
||||
fit_viewport()
|
||||
Master.UpdateTickRate()
|
||||
|
||||
/client/proc/ensure_keys_set()
|
||||
if(SSinput.initialized)
|
||||
set_macros()
|
||||
update_movement_keys(prefs)
|
||||
update_movement_keys(prefs)
|
||||
|
||||
//////////////
|
||||
//DISCONNECT//
|
||||
@@ -914,8 +911,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
return FALSE
|
||||
if (NAMEOF(src, key))
|
||||
return FALSE
|
||||
if(NAMEOF(src, view))
|
||||
change_view(var_value)
|
||||
if (NAMEOF(src, view))
|
||||
view_size.setDefault(var_value)
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
@@ -925,7 +922,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
var/y = viewscale[2]
|
||||
x = clamp(x+change, min, max)
|
||||
y = clamp(y+change, min,max)
|
||||
change_view("[x]x[y]")
|
||||
view_size.setDefault("[x]x[y]")
|
||||
|
||||
/client/proc/update_movement_keys(datum/preferences/direct_prefs)
|
||||
var/datum/preferences/D = prefs || direct_prefs
|
||||
@@ -948,12 +945,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
if (isnull(new_size))
|
||||
CRASH("change_view called without argument.")
|
||||
|
||||
//CIT CHANGES START HERE - makes change_view change DEFAULT_VIEW to 15x15 depending on preferences
|
||||
if(prefs && CONFIG_GET(string/default_view))
|
||||
if(!prefs.widescreenpref && new_size == CONFIG_GET(string/default_view))
|
||||
new_size = "15x15"
|
||||
//END OF CIT CHANGES
|
||||
|
||||
var/list/old_view = getviewsize(view)
|
||||
view = new_size
|
||||
var/list/actualview = getviewsize(view)
|
||||
|
||||
@@ -98,6 +98,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/use_custom_skin_tone = FALSE
|
||||
var/left_eye_color = "000000" //Eye color
|
||||
var/right_eye_color = "000000"
|
||||
var/eye_type = DEFAULT_EYES_TYPE //Eye type
|
||||
var/split_eye_colors = FALSE
|
||||
var/datum/species/pref_species = new /datum/species/human() //Mutant race
|
||||
var/list/features = list("mcolor" = "FFFFFF",
|
||||
@@ -200,7 +201,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/parallax
|
||||
|
||||
var/ambientocclusion = TRUE
|
||||
var/auto_fit_viewport = TRUE
|
||||
///Should we automatically fit the viewport?
|
||||
var/auto_fit_viewport = FALSE
|
||||
///Should we be in the widescreen mode set by the config?
|
||||
var/widescreenpref = TRUE
|
||||
|
||||
///What size should pixels be displayed as? 0 is strech to fit
|
||||
var/pixel_size = 0
|
||||
///What scaling method should we use?
|
||||
var/scaling_method = "normal"
|
||||
|
||||
var/uplink_spawn_loc = UPLINK_PDA
|
||||
|
||||
@@ -240,7 +249,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/screenshake = 100
|
||||
var/damagescreenshake = 2
|
||||
var/arousable = TRUE
|
||||
var/widescreenpref = TRUE
|
||||
var/autostand = TRUE
|
||||
var/auto_ooc = FALSE
|
||||
|
||||
@@ -287,7 +295,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
if(!user || !user.client)
|
||||
return
|
||||
update_preview_icon(current_tab != 2)
|
||||
update_preview_icon(current_tab)
|
||||
var/list/dat = list("<center>")
|
||||
|
||||
dat += "<a href='?_src_=prefs;preference=tab;tab=0' [current_tab == 0 ? "class='linkOn'" : ""]>Character Settings</a>"
|
||||
@@ -474,25 +482,28 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if (CONFIG_GET(number/body_size_min) != CONFIG_GET(number/body_size_max))
|
||||
dat += "<b>Sprite Size:</b> <a href='?_src_=prefs;preference=body_size;task=input'>[features["body_size"]*100]%</a><br>"
|
||||
|
||||
if((EYECOLOR in pref_species.species_traits) && !(NOEYES in pref_species.species_traits))
|
||||
if(!use_skintones && !mutant_colors)
|
||||
dat += APPEARANCE_CATEGORY_COLUMN
|
||||
if(left_eye_color != right_eye_color)
|
||||
split_eye_colors = TRUE
|
||||
dat += "<h3>Heterochromia</h3>"
|
||||
dat += "</b><a style='display:block;width:100px' href='?_src_=prefs;preference=toggle_split_eyes;task=input'>[split_eye_colors ? "Enabled" : "Disabled"]</a>"
|
||||
if(!split_eye_colors)
|
||||
dat += "<h3>Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[left_eye_color];'> </span> <a href='?_src_=prefs;preference=eyes;task=input'>Change</a>"
|
||||
if(!(NOEYES in pref_species.species_traits))
|
||||
dat += "<h3>Eye Type</h3>"
|
||||
dat += "</b><a style='display:block;width:100px' href='?_src_=prefs;preference=eye_type;task=input'>[eye_type]</a><BR>"
|
||||
if((EYECOLOR in pref_species.species_traits))
|
||||
if(!use_skintones && !mutant_colors)
|
||||
dat += APPEARANCE_CATEGORY_COLUMN
|
||||
if(left_eye_color != right_eye_color)
|
||||
split_eye_colors = TRUE
|
||||
dat += "<h3>Heterochromia</h3>"
|
||||
dat += "</b><a style='display:block;width:100px' href='?_src_=prefs;preference=toggle_split_eyes;task=input'>[split_eye_colors ? "Enabled" : "Disabled"]</a>"
|
||||
if(!split_eye_colors)
|
||||
dat += "<h3>Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[left_eye_color];'> </span> <a href='?_src_=prefs;preference=eyes;task=input'>Change</a>"
|
||||
dat += "</td>"
|
||||
else
|
||||
dat += "<h3>Left Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[left_eye_color];'> </span> <a href='?_src_=prefs;preference=eye_left;task=input'>Change</a>"
|
||||
dat += "<h3>Right Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[right_eye_color];'> </span> <a href='?_src_=prefs;preference=eye_right;task=input'>Change</a><BR>"
|
||||
dat += "</td>"
|
||||
else if(use_skintones || mutant_colors)
|
||||
dat += "</td>"
|
||||
else
|
||||
dat += "<h3>Left Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[left_eye_color];'> </span> <a href='?_src_=prefs;preference=eye_left;task=input'>Change</a>"
|
||||
dat += "<h3>Right Eye Color</h3>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[right_eye_color];'> </span> <a href='?_src_=prefs;preference=eye_right;task=input'>Change</a><BR>"
|
||||
dat += "</td>"
|
||||
else if(use_skintones || mutant_colors)
|
||||
dat += "</td>"
|
||||
|
||||
dat += APPEARANCE_CATEGORY_COLUMN
|
||||
dat += "<h2>Speech preferences</h2>"
|
||||
@@ -750,6 +761,20 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<b>HUD Button Flashes:</b> <a href='?_src_=prefs;preference=hud_toggle_flash'>[hud_toggle_flash ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>HUD Button Flash Color:</b> <span style='border: 1px solid #161616; background-color: [hud_toggle_color];'> </span> <a href='?_src_=prefs;preference=hud_toggle_color;task=input'>Change</a><br>"
|
||||
|
||||
/* CITADEL EDIT - We're using top menu instead
|
||||
button_name = pixel_size
|
||||
dat += "<b>Pixel Scaling:</b> <a href='?_src_=prefs;preference=pixel_size'>[(button_name) ? "Pixel Perfect [button_name]x" : "Stretch to fit"]</a><br>"
|
||||
|
||||
switch(scaling_method)
|
||||
if(SCALING_METHOD_NORMAL)
|
||||
button_name = "Nearest Neighbor"
|
||||
if(SCALING_METHOD_DISTORT)
|
||||
button_name = "Point Sampling"
|
||||
if(SCALING_METHOD_BLUR)
|
||||
button_name = "Bilinear"
|
||||
dat += "<b>Scaling Method:</b> <a href='?_src_=prefs;preference=scaling_method'>[button_name]</a><br>"
|
||||
*/
|
||||
|
||||
if (CONFIG_GET(flag/maprotation) && CONFIG_GET(flag/tgstyle_maprotation))
|
||||
var/p_map = preferred_map
|
||||
if (!p_map)
|
||||
@@ -1584,6 +1609,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if(new_eyes)
|
||||
right_eye_color = sanitize_hexcolor(new_eyes, 6)
|
||||
|
||||
if("eye_type")
|
||||
var/new_eye_type = input(user, "Choose your character's eye type.", "Character Preference") as null|anything in GLOB.eye_types
|
||||
if(new_eye_type)
|
||||
eye_type = new_eye_type
|
||||
|
||||
if("toggle_split_eyes")
|
||||
split_eye_colors = !split_eye_colors
|
||||
right_eye_color = left_eye_color
|
||||
@@ -1617,6 +1647,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if(features["mcolor3"] == "#000000" || (!(MUTCOLORS_PARTSONLY in pref_species.species_traits) && ReadHSV(temp_hsv)[3] < ReadHSV("#202020")[3]))
|
||||
features["mcolor3"] = pref_species.default_color
|
||||
|
||||
//switch to the type of eyes the species uses
|
||||
eye_type = pref_species.eye_type
|
||||
|
||||
if("custom_species")
|
||||
var/new_species = reject_bad_name(input(user, "Choose your species subtype, if unique. This will show up on examinations and health scans. Do not abuse this:", "Character Preference", custom_species) as null|text)
|
||||
if(new_species)
|
||||
@@ -2227,7 +2260,32 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
features["has_womb"] = !features["has_womb"]
|
||||
if("widescreenpref")
|
||||
widescreenpref = !widescreenpref
|
||||
user.client.change_view(CONFIG_GET(string/default_view))
|
||||
user.client.view_size.setDefault(getScreenSize(widescreenpref))
|
||||
|
||||
if("pixel_size")
|
||||
switch(pixel_size)
|
||||
if(PIXEL_SCALING_AUTO)
|
||||
pixel_size = PIXEL_SCALING_1X
|
||||
if(PIXEL_SCALING_1X)
|
||||
pixel_size = PIXEL_SCALING_1_2X
|
||||
if(PIXEL_SCALING_1_2X)
|
||||
pixel_size = PIXEL_SCALING_2X
|
||||
if(PIXEL_SCALING_2X)
|
||||
pixel_size = PIXEL_SCALING_3X
|
||||
if(PIXEL_SCALING_3X)
|
||||
pixel_size = PIXEL_SCALING_AUTO
|
||||
user.client.view_size.apply() //Let's winset() it so it actually works
|
||||
|
||||
if("scaling_method")
|
||||
switch(scaling_method)
|
||||
if(SCALING_METHOD_NORMAL)
|
||||
scaling_method = SCALING_METHOD_DISTORT
|
||||
if(SCALING_METHOD_DISTORT)
|
||||
scaling_method = SCALING_METHOD_BLUR
|
||||
if(SCALING_METHOD_BLUR)
|
||||
scaling_method = SCALING_METHOD_NORMAL
|
||||
user.client.view_size.setZoomMode()
|
||||
|
||||
if("autostand")
|
||||
autostand = !autostand
|
||||
if("auto_ooc")
|
||||
@@ -2601,6 +2659,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
character.dna.features = features.Copy()
|
||||
character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE)
|
||||
character.dna.species.eye_type = eye_type
|
||||
if(chosen_limb_id && (chosen_limb_id in character.dna.species.allowed_limb_ids))
|
||||
character.dna.species.mutant_bodyparts["limbs_id"] = chosen_limb_id
|
||||
character.dna.real_name = character.real_name
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// You do not need to raise this if you are adding new values that have sane defaults.
|
||||
// Only raise this value when changing the meaning/format/name/layout of an existing value
|
||||
// where you would want the updater procs below to run
|
||||
#define SAVEFILE_VERSION_MAX 36
|
||||
#define SAVEFILE_VERSION_MAX 37
|
||||
|
||||
/*
|
||||
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
|
||||
@@ -204,10 +204,19 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if(S["species"] == "lizard")
|
||||
features["mam_snouts"] = features["snout"]
|
||||
|
||||
if(current_version < 36)
|
||||
if(current_version < 36) //introduction of heterochromia
|
||||
left_eye_color = S["eye_color"]
|
||||
right_eye_color = S["eye_color"]
|
||||
|
||||
if(current_version < 37) //introduction of chooseable eye types/sprites
|
||||
if(S["species"] == "insect")
|
||||
left_eye_color = "#000000"
|
||||
right_eye_color = "#000000"
|
||||
if(chosen_limb_id == "moth" || chosen_limb_id == "moth_not_greyscale") //these actually have slightly different eyes!
|
||||
eye_type = "moth"
|
||||
else
|
||||
eye_type = "insect"
|
||||
|
||||
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
|
||||
if(!ckey)
|
||||
return
|
||||
@@ -271,6 +280,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["parallax"] >> parallax
|
||||
S["ambientocclusion"] >> ambientocclusion
|
||||
S["auto_fit_viewport"] >> auto_fit_viewport
|
||||
S["widescreenpref"] >> widescreenpref
|
||||
S["pixel_size"] >> pixel_size
|
||||
S["scaling_method"] >> scaling_method
|
||||
S["hud_toggle_flash"] >> hud_toggle_flash
|
||||
S["hud_toggle_color"] >> hud_toggle_color
|
||||
S["menuoptions"] >> menuoptions
|
||||
@@ -288,7 +300,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["arousable"] >> arousable
|
||||
S["screenshake"] >> screenshake
|
||||
S["damagescreenshake"] >> damagescreenshake
|
||||
S["widescreenpref"] >> widescreenpref
|
||||
S["autostand"] >> autostand
|
||||
S["cit_toggles"] >> cit_toggles
|
||||
S["preferred_chaos"] >> preferred_chaos
|
||||
@@ -324,6 +335,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
|
||||
ambientocclusion = sanitize_integer(ambientocclusion, 0, 1, initial(ambientocclusion))
|
||||
auto_fit_viewport = sanitize_integer(auto_fit_viewport, 0, 1, initial(auto_fit_viewport))
|
||||
widescreenpref = sanitize_integer(widescreenpref, 0, 1, initial(widescreenpref))
|
||||
pixel_size = sanitize_integer(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, initial(pixel_size))
|
||||
scaling_method = sanitize_text(scaling_method, initial(scaling_method))
|
||||
hud_toggle_flash = sanitize_integer(hud_toggle_flash, 0, 1, initial(hud_toggle_flash))
|
||||
hud_toggle_color = sanitize_hexcolor(hud_toggle_color, 6, 1, initial(hud_toggle_color))
|
||||
ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form))
|
||||
@@ -337,7 +351,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
pda_skin = sanitize_inlist(pda_skin, GLOB.pda_reskins, PDA_SKIN_ALT)
|
||||
screenshake = sanitize_integer(screenshake, 0, 800, initial(screenshake))
|
||||
damagescreenshake = sanitize_integer(damagescreenshake, 0, 2, initial(damagescreenshake))
|
||||
widescreenpref = sanitize_integer(widescreenpref, 0, 1, initial(widescreenpref))
|
||||
autostand = sanitize_integer(autostand, 0, 1, initial(autostand))
|
||||
cit_toggles = sanitize_integer(cit_toggles, 0, 16777215, initial(cit_toggles))
|
||||
auto_ooc = sanitize_integer(auto_ooc, 0, 1, initial(auto_ooc))
|
||||
@@ -509,6 +522,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["age"] >> age
|
||||
S["hair_color"] >> hair_color
|
||||
S["facial_hair_color"] >> facial_hair_color
|
||||
S["eye_type"] >> eye_type
|
||||
S["left_eye_color"] >> left_eye_color
|
||||
S["right_eye_color"] >> right_eye_color
|
||||
S["use_custom_skin_tone"] >> use_custom_skin_tone
|
||||
@@ -692,6 +706,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
hair_color = sanitize_hexcolor(hair_color, 6, FALSE)
|
||||
facial_hair_color = sanitize_hexcolor(facial_hair_color, 6, FALSE)
|
||||
eye_type = sanitize_inlist(eye_type, GLOB.eye_types, DEFAULT_EYES_TYPE)
|
||||
left_eye_color = sanitize_hexcolor(left_eye_color, 6, FALSE)
|
||||
right_eye_color = sanitize_hexcolor(right_eye_color, 6, FALSE)
|
||||
|
||||
@@ -822,6 +837,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["age"] , age)
|
||||
WRITE_FILE(S["hair_color"] , hair_color)
|
||||
WRITE_FILE(S["facial_hair_color"] , facial_hair_color)
|
||||
WRITE_FILE(S["eye_type"] , eye_type)
|
||||
WRITE_FILE(S["left_eye_color"] , left_eye_color)
|
||||
WRITE_FILE(S["right_eye_color"] , right_eye_color)
|
||||
WRITE_FILE(S["use_custom_skin_tone"] , use_custom_skin_tone)
|
||||
|
||||
Reference in New Issue
Block a user