This commit is contained in:
SandPoot
2024-01-16 18:00:55 -03:00
588 changed files with 3455 additions and 2654 deletions
+6 -6
View File
@@ -134,16 +134,16 @@
var/obj/item/active_mousedown_item = null
///Used in MouseDrag to preserve the original mouse click parameters
var/mouseParams = ""
///Used in MouseDrag to preserve the last mouse-entered location.
var/mouseLocation = null
///Used in MouseDrag to preserve the last mouse-entered object.
var/mouseObject = null
var/mouseControlObject = null
///Used in MouseDrag to preserve the last mouse-entered location. Weakref
var/datum/weakref/mouse_location_ref = null
///Used in MouseDrag to preserve the last mouse-entered object. Weakref
var/datum/weakref/mouse_object_ref
var/mouse_control_object
/// Messages currently seen by this client
var/list/seen_messages
/// viewsize datum for holding our view size
var/datum/viewData/view_size
var/datum/view_data/view_size
/// our current tab
var/stat_tab
+17 -12
View File
@@ -169,8 +169,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
/client/proc/is_content_unlocked()
if(!prefs.unlock_content)
to_chat(src, "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Only 10 bucks for 3 months! <a href=\"https://secure.byond.com/membership\">Click Here to find out more</a>.")
return 0
return 1
return FALSE
return TRUE
/*
* Call back proc that should be checked in all paths where a client can send messages
*
@@ -201,11 +201,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
total_message_count = 0
total_count_reset = 0
cmd_admin_mute(src, mute_type, 1)
return 1
return TRUE
//Otherwise just supress the message
else if(cache >= SPAM_TRIGGER_AUTOMUTE)
return 1
return TRUE
if(CONFIG_GET(flag/automute_on) && !holder && last_message == message)
@@ -213,14 +213,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
to_chat(src, "<span class='danger'>You have exceeded the spam filter limit for identical messages. An auto-mute was applied.</span>")
cmd_admin_mute(src, mute_type, 1)
return 1
return TRUE
if(src.last_message_count >= SPAM_TRIGGER_WARNING)
to_chat(src, "<span class='danger'>You are nearing the spam filter limit for identical messages.</span>")
return 0
return FALSE
else
last_message = message
src.last_message_count = 0
return 0
return FALSE
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
/client/AllowUpload(filename, filelength)
@@ -398,7 +398,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
to_chat(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade")
else
qdel(src)
return 0
return FALSE
else if (byond_version < cwv) //We have words for this client.
if(CONFIG_GET(flag/client_warn_popup))
var/msg = "<b>Your version of byond may be getting out of date:</b><br>"
@@ -418,11 +418,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (!CONFIG_GET(flag/allow_webclient))
to_chat(src, "Web client is disabled")
qdel(src)
return 0
return FALSE
if (CONFIG_GET(flag/webclient_only_byond_members) && !IsByondMember())
to_chat(src, "Sorry, but the web client is restricted to byond members only.")
qdel(src)
return 0
return FALSE
if( (world.address == address || !address) && !GLOB.host )
GLOB.host = key
@@ -886,9 +886,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
click_intercept_time = 0 //Reset and return. Next click should work, but not this one.
return
click_intercept_time = 0 //Just reset. Let's not keep re-checking forever.
var/list/L = params2list(params)
var/list/modifiers = params2list(params)
if(L["drag"])
if(modifiers[DRAG])
return
var/mcl = CONFIG_GET(number/minute_click_limit)
@@ -934,6 +934,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
// so that the visual focus indicator matches reality.
winset(src, null, "input.background-color=[COLOR_INPUT_DISABLED]")
else
winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED]")
SEND_SIGNAL(src, COMSIG_CLIENT_CLICK, object, location, control, params, usr)
..()
/client/proc/add_verbs_from_config()
+14 -14
View File
@@ -41,10 +41,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/last_custom_holoform = 0
//Cooldowns for saving/loading. These are four are all separate due to loading code calling these one after another
var/saveprefcooldown
var/loadprefcooldown
var/savecharcooldown
var/loadcharcooldown
COOLDOWN_DECLARE(saveprefcooldown)
COOLDOWN_DECLARE(loadprefcooldown)
COOLDOWN_DECLARE(savecharcooldown)
COOLDOWN_DECLARE(loadcharcooldown)
//game-preferences
var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
@@ -65,7 +65,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED
var/screentip_color = "#ffd391"
var/screentip_images = TRUE
var/buttons_locked = FALSE
var/hotkeys = FALSE
///Runechat preference. If true, certain messages will be displayed on the map, not ust on the chat area. Boolean.
@@ -282,6 +281,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/loadout_errors = 0
var/pref_queue
var/char_queue
var/silicon_lawset
/datum/preferences/New(client/C)
@@ -1142,8 +1144,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>See Runechat for emotes:</b> <a href='?_src_=prefs;preference=see_chat_emotes'>[see_chat_emotes ? "Enabled" : "Disabled"]</a><br>"
//SANDSTORM CHANGES END
dat += "<br>"
dat += "<b>Action Buttons:</b> <a href='?_src_=prefs;preference=action_buttons'>[(buttons_locked) ? "Locked In Place" : "Unlocked"]</a><br>"
dat += "<br>"
dat += "<b>PDA Color:</b> <span style='border:1px solid #161616; background-color: [pda_color];'><font color='[color_hex2num(pda_color) < 200 ? "FFFFFF" : "000000"]'>[pda_color]</font></span> <a href='?_src_=prefs;preference=pda_color;task=input'>Change</a><BR>"
dat += "<b>PDA Style:</b> <a href='?_src_=prefs;task=input;preference=pda_style'>[pda_style]</a><br>"
dat += "<b>PDA Reskin:</b> <a href='?_src_=prefs;task=input;preference=pda_skin'>[pda_skin]</a><br>"
@@ -1668,7 +1668,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
SetJobPreferenceLevel(job, jpval)
SetChoices(user)
return 1
return TRUE
/datum/preferences/proc/ResetJobs()
@@ -1831,7 +1831,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//END OF SKYRAT CHANGES
else
SetChoices(user)
return 1
return TRUE
else if(href_list["preference"] == "trait")
switch(href_list["task"])
@@ -3207,14 +3207,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
chat_on_map = !chat_on_map
if("see_chat_non_mob")
see_chat_non_mob = !see_chat_non_mob
//Skyrat changes begin
//Sandstorm changes begin
if("see_chat_emotes")
see_chat_emotes = !see_chat_emotes
if("enable_personal_chat_color")
enable_personal_chat_color = !enable_personal_chat_color
//End of skyrat changes
if("action_buttons")
buttons_locked = !buttons_locked
//End of sandstorm changes
if("tgui_fancy")
tgui_fancy = !tgui_fancy
if("outline_enabled")
@@ -3435,6 +3433,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
load_character()
if("changeslot")
if(char_queue)
deltimer(char_queue) // Do not dare.
if(!load_character(text2num(href_list["num"])))
random_character()
real_name = random_unique_name(gender)
@@ -3576,7 +3576,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
user_gear[LOADOUT_CUSTOM_DESCRIPTION] = new_description
ShowChoices(user)
return 1
return TRUE
/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE, initial_spawn = FALSE)
if(be_random_name)
+39 -19
View File
@@ -401,7 +401,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(istype(parent))
to_chat(parent, "<span class='warning'>You're attempting to load your preferences a little too fast. Wait half a second, then try again.</span>")
return FALSE
loadprefcooldown = world.time + PREF_SAVELOAD_COOLDOWN
COOLDOWN_START(src, loadprefcooldown, PREF_LOAD_COOLDOWN)
if(!fexists(path))
return FALSE
@@ -435,7 +435,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["see_chat_non_mob"] >> see_chat_non_mob
S["tgui_fancy"] >> tgui_fancy
S["tgui_lock"] >> tgui_lock
S["buttons_locked"] >> buttons_locked
S["windowflash"] >> windowflashing
S["be_special"] >> be_special
@@ -516,7 +515,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
see_chat_non_mob = sanitize_integer(see_chat_non_mob, 0, 1, initial(see_chat_non_mob))
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
tgui_lock = sanitize_integer(tgui_lock, 0, 1, initial(tgui_lock))
buttons_locked = sanitize_integer(buttons_locked, 0, 1, initial(buttons_locked))
windowflashing = sanitize_integer(windowflashing, 0, 1, initial(windowflashing))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 16777215, initial(toggles))
@@ -602,18 +600,20 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(!GLOB.keybindings_by_name[bindname])
modless_key_bindings -= key
/datum/preferences/proc/save_preferences(bypass_cooldown = FALSE)
/datum/preferences/proc/save_preferences(bypass_cooldown = FALSE, silent = FALSE)
if(!path)
return 0
return FALSE
if(!bypass_cooldown)
if(world.time < saveprefcooldown)
if(istype(parent))
to_chat(parent, "<span class='warning'>You're attempting to save your preferences a little too fast. Wait half a second, then try again.</span>")
return 0
saveprefcooldown = world.time + PREF_SAVELOAD_COOLDOWN
queue_save_pref(PREF_SAVE_COOLDOWN, silent)
return FALSE
COOLDOWN_START(src, saveprefcooldown, PREF_SAVE_COOLDOWN)
if(pref_queue)
deltimer(pref_queue)
var/savefile/S = new /savefile(path)
if(!S)
return 0
return FALSE
S.cd = "/"
WRITE_FILE(S["version"] , SAVEFILE_VERSION_MAX) //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date
@@ -633,7 +633,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["see_chat_non_mob"], see_chat_non_mob)
WRITE_FILE(S["tgui_fancy"], tgui_fancy)
WRITE_FILE(S["tgui_lock"], tgui_lock)
WRITE_FILE(S["buttons_locked"], buttons_locked)
WRITE_FILE(S["windowflash"], windowflashing)
WRITE_FILE(S["be_special"], be_special)
WRITE_FILE(S["default_slot"], default_slot)
@@ -687,7 +686,17 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
else
WRITE_FILE(S["unlockable_loadout"], safe_json_encode(list()))
return 1
if(parent && !silent)
to_chat(parent, span_notice("Saved preferences!"))
return TRUE
/datum/preferences/proc/queue_save_pref(save_in, silent)
if(parent && !silent)
to_chat(parent, span_notice("Saving preferences in [save_in * 0.1] second\s."))
if(pref_queue)
deltimer(pref_queue)
pref_queue = addtimer(CALLBACK(src, PROC_REF(save_preferences), TRUE, silent), save_in, TIMER_STOPPABLE)
/datum/preferences/proc/load_character(slot, bypass_cooldown = FALSE, savefile/provided)
if(!provided)
@@ -698,7 +707,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(istype(parent))
to_chat(parent, "<span class='warning'>You're attempting to load your character a little too fast. Wait half a second, then try again.</span>")
return "SLOW THE FUCK DOWN" //the reason this isn't null is to make sure that people don't have their character slots overridden by random chars if they accidentally double-click a slot
loadcharcooldown = world.time + PREF_SAVELOAD_COOLDOWN
COOLDOWN_START(src, loadcharcooldown, PREF_LOAD_COOLDOWN)
if(!fexists(path))
return FALSE
var/savefile/S
@@ -1137,20 +1146,22 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
cit_character_pref_load(S)
return 1
return TRUE
/datum/preferences/proc/save_character(bypass_cooldown = FALSE, export = FALSE)
/datum/preferences/proc/save_character(bypass_cooldown = FALSE, silent = FALSE, export = FALSE)
if(!path)
return 0
return FALSE
if(!bypass_cooldown)
if(world.time < savecharcooldown)
if(istype(parent))
to_chat(parent, "<span class='warning'>You're attempting to save your character a little too fast. Wait half a second, then try again.</span>")
return 0
savecharcooldown = world.time + PREF_SAVELOAD_COOLDOWN
queue_save_char(PREF_SAVE_COOLDOWN, silent)
return FALSE
COOLDOWN_START(src, savecharcooldown, PREF_SAVE_COOLDOWN)
if(char_queue)
deltimer(char_queue)
var/savefile/S = new /savefile(export ? null : path)
if(!S)
return 0
return FALSE
if(!export)
S.cd = "/character[default_slot]"
@@ -1344,8 +1355,17 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
cit_character_pref_save(S)
if(parent && !silent)
to_chat(parent, span_notice("Saved character slot!"))
return S
/datum/preferences/proc/queue_save_char(save_in, silent)
if(parent && !silent)
to_chat(parent, span_notice("Saving character in [save_in * 0.1] second\s."))
if(char_queue)
deltimer(char_queue)
char_queue = addtimer(CALLBACK(src, PROC_REF(save_character), TRUE, silent), save_in, TIMER_STOPPABLE)
#undef SAVEFILE_VERSION_MAX
#undef SAVEFILE_VERSION_MIN