Merge branch 'master' into deadmin-prefs

This commit is contained in:
SandPoot
2022-03-22 15:35:46 -03:00
committed by GitHub
1559 changed files with 287712 additions and 68795 deletions
+13 -14
View File
@@ -4,6 +4,16 @@
//BLACK MAGIC THINGS//
//////////////////////
parent_type = /datum
///////////////
// Rendering //
///////////////
/// Click catcher
var/atom/movable/screen/click_catcher/click_catcher
/// Parallax holder
var/datum/parallax_holder/parallax_holder
////////////////
//ADMIN THINGS//
////////////////
@@ -34,6 +44,9 @@
var/last_move = 0
var/area = null
/// Timers are now handled by clients, not by doing a mess on the item and multiple people overwriting a single timer on the object, have fun.
var/tip_timer = null
/// Last time we Click()ed. No clicking twice in one tick!
var/last_click = 0
@@ -150,20 +163,6 @@
///When was the last time we warned them about not cryoing without an ahelp, set to -5 minutes so that rounstart cryo still warns
var/cryo_warned = -5 MINUTES
var/list/parallax_layers
var/list/parallax_layers_cached
var/atom/movable/movingmob
var/turf/previous_turf
///world.time of when we can state animate()ing parallax again
var/dont_animate_parallax
///world.time of last parallax update
var/last_parallax_shift
///ds between parallax updates
var/parallax_throttle = 0
var/parallax_movedir = 0
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.
+64 -42
View File
@@ -79,15 +79,16 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
// Tgui Topic middleware
if(tgui_Topic(href_list))
if(CONFIG_GET(flag/emergency_tgui_logging))
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
return
if(href_list["reload_tguipanel"])
nuke_chat()
if(href_list["reload_statbrowser"])
src << browse(file('html/statbrowser.html'), "window=statbrowser")
// Log all hrefs
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
last_activity = world.time
//Logs all hrefs
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
//byond bug ID:2256651
if (asset_cache_job && (asset_cache_job in completed_asset_jobs))
to_chat(src, "<span class='danger'>An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)</span>")
@@ -153,7 +154,15 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/atom/target = locate(href_list["statpanel_item_target"])
if(!target)
return
Click(target, target.loc, null, "[href_list["statpanel_item_shiftclick"]?"shift=1;":null][href_list["statpanel_item_ctrlclick"]?"ctrl=1;":null]&alt=[href_list["statpanel_item_altclick"]?"alt=1;":null]", FALSE, "statpanel")
var/button = "left=1"
switch(href_list["statpanel_item_click"])
if("middle")
button = "middle=1"
if("right")
button = "right=1"
else
button = "left=1"
Click(target, target.loc, null, "[button];[href_list["statpanel_item_shiftclick"]?"shift=1;":null][href_list["statpanel_item_ctrlclick"]?"ctrl=1;":null]&alt=[href_list["statpanel_item_altclick"]?"alt=1;":null]", FALSE, "statpanel")
/client/proc/is_content_unlocked()
if(!prefs.unlock_content)
@@ -353,13 +362,19 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
return
// Initialize tgui panel
tgui_panel.initialize()
src << browse(file('html/statbrowser.html'), "window=statbrowser")
addtimer(CALLBACK(src, .proc/check_panel_loaded), 30 SECONDS)
tgui_panel.initialize()
if(alert_mob_dupe_login)
spawn()
alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
if(alert_mob_dupe_login && !holder)
var/dupe_login_message = "Your ComputerID has already logged in with another key this round, please log out of this one NOW or risk being banned!"
// if (alert_admin_multikey)
// dupe_login_message += "\nAdmins have been informed."
// message_admins(span_danger("<B>MULTIKEYING: </B></span><span class='notice'>[key_name_admin(src)] has a matching CID+IP with another player and is clearly multikeying. They have been warned to leave the server or risk getting banned."))
// log_admin_private("MULTIKEYING: [key_name(src)] has a matching CID+IP with another player and is clearly multikeying. They have been warned to leave the server or risk getting banned.")
spawn(0.5 SECONDS) //needs to run during world init, do not convert to add timer
alert(mob, dupe_login_message) //players get banned if they don't see this message, do not convert to tgui_alert (or even tg_alert) please.
to_chat(mob, span_danger(dupe_login_message))
connection_time = world.time
connection_realtime = world.realtime
@@ -437,8 +452,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
send_resources()
generate_clickcatcher()
apply_clickcatcher()
update_clickcatcher()
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")
@@ -528,9 +542,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
send2adminchat("Server", "[cheesy_message] (No admins online)")
QDEL_LIST_ASSOC_VAL(char_render_holders)
if(movingmob != null)
movingmob.client_mobs_in_contents -= mob
UNSETEMPTY(movingmob.client_mobs_in_contents)
// seen_messages = null
Master.UpdateTickRate()
. = ..() //Even though we're going to be hard deleted there are still some things that want to know the destroy is happening
@@ -1007,7 +1018,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/list/old_view = getviewsize(view)
view = new_size
var/list/actualview = getviewsize(view)
apply_clickcatcher(actualview)
update_clickcatcher()
parallax_holder.Reset()
mob.hud_used.screentip_text.update_view()
mob.reload_fullscreen()
if (isliving(mob))
var/mob/living/M = mob
@@ -1016,33 +1029,31 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
addtimer(CALLBACK(src,.verb/fit_viewport,10)) //Delayed to avoid wingets from Login calls.
SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_CHANGE_VIEW, src, old_view, actualview)
/client/proc/generate_clickcatcher()
if(!void)
void = new()
screen += void
/client/proc/apply_clickcatcher(list/actualview)
generate_clickcatcher()
if(!actualview)
actualview = getviewsize(view)
void.UpdateGreed(actualview[1],actualview[2])
/client/proc/AnnouncePR(announcement)
if(prefs && prefs.chat_toggles & CHAT_PULLR)
to_chat(src, announcement)
/client/proc/show_character_previews(mutable_appearance/MA)
/client/proc/show_character_previews(mutable_appearance/source)
LAZYINITLIST(char_render_holders)
if(!LAZYLEN(char_render_holders))
for(var/plane_master_path as anything in subtypesof(/atom/movable/screen/plane_master))
var/atom/movable/screen/plane_master/plane_master = new plane_master_path()
char_render_holders["plane_master-[plane_master.plane]"] = plane_master
plane_master.backdrop(mob)
screen |= plane_master
plane_master.screen_loc = "character_preview_map:0,CENTER"
var/pos = 0
for(var/D in GLOB.cardinals)
for(var/dir in GLOB.cardinals)
pos++
var/atom/movable/screen/O = LAZYACCESS(char_render_holders, "[D]")
if(!O)
O = new
LAZYSET(char_render_holders, "[D]", O)
screen |= O
O.appearance = MA
O.dir = D
O.screen_loc = "character_preview_map:0,[pos]"
var/atom/movable/screen/preview = char_render_holders["preview-[dir]"]
if(!preview)
preview = new
char_render_holders["preview-[dir]"] = preview
screen |= preview
preview.appearance = source
preview.dir = dir
preview.screen_loc = "character_preview_map:0,[pos]"
/client/proc/clear_character_previews()
for(var/index in char_render_holders)
@@ -1078,8 +1089,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(IsAdminAdvancedProcCall())
return
var/list/verblist = list()
verb_tabs.Cut()
for(var/thing in (verbs + mob?.verbs))
var/list/verbstoprocess = verbs.Copy()
if(mob)
verbstoprocess += mob.verbs
for(var/AM in mob.contents)
var/atom/movable/thing = AM
verbstoprocess += thing.verbs
panel_tabs.Cut() // panel_tabs get reset in init_verbs on JS side anyway
for(var/thing in verbstoprocess)
var/procpath/verb_to_init = thing
if(!verb_to_init)
continue
@@ -1087,9 +1104,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
continue
if(!istext(verb_to_init.category))
continue
verb_tabs |= verb_to_init.category
panel_tabs |= verb_to_init.category
verblist[++verblist.len] = list(verb_to_init.category, verb_to_init.name)
src << output("[url_encode(json_encode(verb_tabs))];[url_encode(json_encode(verblist))]", "statbrowser:init_verbs")
src << output("[url_encode(json_encode(panel_tabs))];[url_encode(json_encode(verblist))]", "statbrowser:init_verbs")
/client/proc/check_panel_loaded()
if(statbrowser_ready)
return
to_chat(src, span_userdanger("Statpanel failed to load, click <a href='?src=[REF(src)];reload_statbrowser=1'>here</a> to reload the panel "))
//increment progress for an unlockable loadout item
/client/proc/increment_progress(key, amount)
+29 -13
View File
@@ -61,7 +61,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/UI_style = null
var/outline_enabled = TRUE
var/outline_color = COLOR_BLUE_GRAY
var/outline_color = COLOR_THEME_MIDNIGHT
var/screentip_pref = TRUE
var/screentip_color = "#ffd391"
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -166,13 +168,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/clientfps = 0
var/parallax
var/parallax = PARALLAX_INSANE
var/ambientocclusion = 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
///Strip menu style
var/long_strip_menu = FALSE
///What size should pixels be displayed as? 0 is strech to fit
var/pixel_size = 0
///What scaling method should we use?
@@ -787,7 +791,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<h2>General Settings</h2>"
dat += "<b>UI Style:</b> <a href='?_src_=prefs;task=input;preference=ui'>[UI_style]</a><br>"
dat += "<b>Outline:</b> <a href='?_src_=prefs;preference=outline_enabled'>[outline_enabled ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Outline Color:</b> <span style='border:1px solid #161616; background-color: [outline_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=outline_color'>Change</a><BR>"
dat += "<b>Outline Color:</b> [outline_color ? "<span style='border:1px solid #161616; background-color: [outline_color];'>" : "Theme-based (null)"]&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=outline_color'>Change</a><BR>"
dat += "<b>Screentip:</b> <a href='?_src_=prefs;preference=screentip_pref'>[screentip_pref ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Screentip Color:</b> <span style='border:1px solid #161616; background-color: [screentip_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=screentip_color'>Change</a><BR>"
dat += "<b>tgui Monitors:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(tgui_lock) ? "Primary" : "All"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(tgui_fancy) ? "Fancy" : "No Frills"]</a><br>"
dat += "<b>Show Runechat Chat Bubbles:</b> <a href='?_src_=prefs;preference=chat_on_map'>[chat_on_map ? "Enabled" : "Disabled"]</a><br>"
@@ -860,6 +866,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat +="<td width='300px' height='300px' valign='top'>"
dat += "<h2>Citadel Preferences</h2>" //Because fuck me if preferences can't be fucking modularized and expected to update in a reasonable timeframe.
dat += "<b>Widescreen:</b> <a href='?_src_=prefs;preference=widescreenpref'>[widescreenpref ? "Enabled ([CONFIG_GET(string/default_view)])" : "Disabled (15x15)"]</a><br>"
dat += "<b>Long strip menu:</b> <a href='?_src_=prefs;preference=long_strip_menu'>[long_strip_menu ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Auto stand:</b> <a href='?_src_=prefs;preference=autostand'>[autostand ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Auto OOC:</b> <a href='?_src_=prefs;preference=auto_ooc'>[auto_ooc ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Force Slot Storage HUD:</b> <a href='?_src_=prefs;preference=no_tetris_storage'>[no_tetris_storage ? "Enabled" : "Disabled"]</a><br>"
@@ -2164,6 +2171,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if(S.ignore)
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_taur_list[S.name] = path
var/new_taur
@@ -2622,6 +2631,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("widescreenpref")
widescreenpref = !widescreenpref
user.client.view_size.setDefault(getScreenSize(widescreenpref))
if("long_strip_menu")
long_strip_menu = !long_strip_menu
if("pixel_size")
switch(pixel_size)
@@ -2770,8 +2781,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
outline_enabled = !outline_enabled
if("outline_color")
var/pickedOutlineColor = input(user, "Choose your outline color.", "General Preference", outline_color) as color|null
if(pickedOutlineColor)
outline_color = pickedOutlineColor
if(pickedOutlineColor != pickedOutlineColor)
outline_color = pickedOutlineColor // nullable
if("screentip_pref")
screentip_pref = !screentip_pref
if("screentip_color")
var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null
if(pickedScreentipColor)
screentip_color = pickedScreentipColor
if("tgui_lock")
tgui_lock = !tgui_lock
if("winflash")
@@ -2855,14 +2872,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
toggles ^= MIDROUND_ANTAG
if("parallaxup")
parallax = WRAP(parallax + 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1)
if (parent && parent.mob && parent.mob.hud_used)
parent.mob.hud_used.update_parallax_pref(parent.mob)
parallax = WRAP(parallax + 1, PARALLAX_DISABLE, PARALLAX_INSANE + 1)
parent?.parallax_holder?.Reset()
if("parallaxdown")
parallax = WRAP(parallax - 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1)
if (parent && parent.mob && parent.mob.hud_used)
parent.mob.hud_used.update_parallax_pref(parent.mob)
parallax = WRAP(parallax - 1, PARALLAX_DISABLE, PARALLAX_INSANE + 1)
parent?.parallax_holder?.Reset()
// Citadel edit - Prefs don't work outside of this. :c
@@ -3107,6 +3122,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
save_character()
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))
@@ -3265,10 +3281,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/occupied_slots = L[initial(G.category)] ? L[initial(G.category)] + 1 : 1
LAZYSET(L, initial(G.category), occupied_slots)
switch(slot)
if(SLOT_IN_BACKPACK)
if(ITEM_SLOT_BACKPACK)
if(L[LOADOUT_CATEGORY_BACKPACK] < BACKPACK_SLOT_AMT)
return TRUE
if(SLOT_HANDS)
if(ITEM_SLOT_HANDS)
if(L[LOADOUT_CATEGORY_HANDS] < HANDS_SLOT_AMT)
return TRUE
else
+13 -3
View File
@@ -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 52
#define SAVEFILE_VERSION_MAX 53
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -47,7 +47,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
addtimer(CALLBACK(src, .proc/force_reset_keybindings), 30) //No mob available when this is run, timer allows user choice.
if(current_version < 30)
outline_enabled = TRUE
outline_color = COLOR_BLUE_GRAY
outline_color = COLOR_THEME_MIDNIGHT
/datum/preferences/proc/update_character(current_version, savefile/S)
if(current_version < 19)
@@ -343,6 +343,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
marking_list += list(list(part, old_marking_value, copied_color_list))
features["mam_body_markings"] = marking_list
if(current_version < 53)
parallax = PARALLAX_INSANE
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
if(!ckey)
return
@@ -382,6 +385,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["UI_style"] >> UI_style
S["outline_color"] >> outline_color
S["outline_enabled"] >> outline_enabled
S["screentip_pref"] >> screentip_pref
S["screentip_color"] >> screentip_color
S["hotkeys"] >> hotkeys
S["chat_on_map"] >> chat_on_map
S["max_chat_length"] >> max_chat_length
@@ -411,6 +416,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["ambientocclusion"] >> ambientocclusion
S["auto_fit_viewport"] >> auto_fit_viewport
S["widescreenpref"] >> widescreenpref
S["long_strip_menu"] >> long_strip_menu
S["pixel_size"] >> pixel_size
S["scaling_method"] >> scaling_method
S["hud_toggle_flash"] >> hud_toggle_flash
@@ -470,10 +476,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
toggles = sanitize_integer(toggles, 0, 16777215, initial(toggles))
deadmin = sanitize_integer(deadmin, 0, 16777215, initial(deadmin))
clientfps = sanitize_integer(clientfps, 0, 1000, 0)
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
parallax = sanitize_integer(parallax, PARALLAX_DISABLE, PARALLAX_INSANE, 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))
long_strip_menu = sanitize_integer(long_strip_menu, 0, 1, initial(long_strip_menu))
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))
@@ -564,6 +571,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["UI_style"], UI_style)
WRITE_FILE(S["outline_enabled"], outline_enabled)
WRITE_FILE(S["outline_color"], outline_color)
WRITE_FILE(S["screentip_pref"], screentip_pref)
WRITE_FILE(S["screentip_color"], screentip_color)
WRITE_FILE(S["hotkeys"], hotkeys)
WRITE_FILE(S["chat_on_map"], chat_on_map)
WRITE_FILE(S["max_chat_length"], max_chat_length)
@@ -607,6 +616,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["damagescreenshake"], damagescreenshake)
WRITE_FILE(S["arousable"], arousable)
WRITE_FILE(S["widescreenpref"], widescreenpref)
WRITE_FILE(S["long_strip_menu"], long_strip_menu)
WRITE_FILE(S["autostand"], autostand)
WRITE_FILE(S["cit_toggles"], cit_toggles)
WRITE_FILE(S["preferred_chaos"], preferred_chaos)
+9
View File
@@ -18,3 +18,12 @@
prefs.tip_delay = max(indelay, 0.01)
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Tooltip delay set to [indelay] milliseconds.</span>")
/client/verb/toggle_hover_outline()
set name = "Toggle hover outline"
set desc = "Toggles hover-over item outline"
set category = "Preferences"
prefs.outline_enabled = !prefs.outline_enabled
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Item outline [prefs.outline_enabled ? "en" : "dis"]abled.</span>")