From 3123d7ed3ccf7f1e7cbdc20abefb8fbc143cc535 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 9 Sep 2019 11:27:09 -0700 Subject: [PATCH] vv crap --- code/__HELPERS/_lists.dm | 26 - code/__HELPERS/type2type.dm | 36 ++ code/__defines/_lists.dm | 3 +- code/__defines/flags.dm | 2 + code/__defines/items_clothing.dm | 1 + code/datums/browser.dm | 505 ++++++++++++++++++ code/datums/helper_datums/events.dm | 4 +- code/datums/helper_datums/topic_input.dm | 2 +- code/game/atom_vv.dm | 2 + code/game/mecha/mecha.dm | 2 +- code/game/turfs/change_turf.dm | 4 + code/modules/admin/topic.dm | 2 +- .../{client defines.dm => client_defines.dm} | 0 .../{client procs.dm => client_procs.dm} | 21 + code/modules/mob/mob.dm | 2 +- vorestation.dme | 5 +- 16 files changed, 582 insertions(+), 35 deletions(-) create mode 100644 code/game/turfs/change_turf.dm rename code/modules/client/{client defines.dm => client_defines.dm} (100%) rename code/modules/client/{client procs.dm => client_procs.dm} (96%) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index ea27f1aa298..999577ae129 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -213,32 +213,6 @@ proc/listclearnulls(list/list) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) -//Converts a bitfield to a list of numbers (or words if a wordlist is provided) -/proc/bitfield2list(bitfield = 0, list/wordlist) - var/list/r = list() - if(istype(wordlist,/list)) - var/max = min(wordlist.len,16) - var/bit = 1 - for(var/i=1, i<=max, i++) - if(bitfield & bit) - r += wordlist[i] - bit = bit << 1 - else - for(var/bit=1, bit<=65535, bit = bit << 1) - if(bitfield & bit) - r += bit - - return r - -// Returns the key based on the index -/proc/get_key_by_index(var/list/L, var/index) - var/i = 1 - for(var/key in L) - if(index == i) - return key - i++ - return null - // Returns the key based on the index /proc/get_key_by_value(var/list/L, var/value) for(var/key in L) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 22d8ffbfc04..179bc2c8237 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -278,3 +278,39 @@ return "turf" else //regex everything else (works for /proc too) return lowertext(replacetext("[the_type]", "[type2parent(the_type)]/", "")) + +//This is a weird one: +//It returns a list of all var names found in the string +//These vars must be in the [var_name] format +//It's only a proc because it's used in more than one place + +//Takes a string and a datum +//The string is well, obviously the string being checked +//The datum is used as a source for var names, to check validity +//Otherwise every single word could technically be a variable! +/proc/string2listofvars(var/t_string, var/datum/var_source) + if(!t_string || !var_source) + return list() + + . = list() + + var/var_found = findtext(t_string,"\[") //Not the actual variables, just a generic "should we even bother" check + if(var_found) + //Find var names + + // "A dog said hi [name]!" + // splittext() --> list("A dog said hi ","name]!" + // jointext() --> "A dog said hi name]!" + // splittext() --> list("A","dog","said","hi","name]!") + + t_string = replacetext(t_string,"\[","\[ ")//Necessary to resolve "word[var_name]" scenarios + var/list/list_value = splittext(t_string,"\[") + var/intermediate_stage = jointext(list_value, null) + + list_value = splittext(intermediate_stage," ") + for(var/value in list_value) + if(findtext(value,"]")) + value = splittext(value,"]") //"name]!" --> list("name","!") + for(var/A in value) + if(var_source.vars.Find(A)) + . += A diff --git a/code/__defines/_lists.dm b/code/__defines/_lists.dm index 78a6ada4229..d41183ca889 100644 --- a/code/__defines/_lists.dm +++ b/code/__defines/_lists.dm @@ -27,7 +27,8 @@ #define reverseList(L) reverseRange(L.Copy()) #define SAFEPICK(L) (length(L)? pick(L) : null) -#define SAFEACCESS(L, I) ((isnum(I) && ISINRANGE(I, 1, length(L))? L[I] : null) +#define SAFEACCESS(L, I) (isnum(I)? (SAFEINDEXACCESS(L, I)) : ((I in L)? L[I] : null)) +#define SAFEINDEXACCESS(L, I) (IsInRange(I, 1, length(L))? L[I] : null) // Returns the key based on the index #define KEYBYINDEX(L, index) (((index <= length(L)) && (index > 0)) ? L[index] : null) diff --git a/code/__defines/flags.dm b/code/__defines/flags.dm index 267ff28c82e..54cb8661e02 100644 --- a/code/__defines/flags.dm +++ b/code/__defines/flags.dm @@ -17,3 +17,5 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define DF_VAR_EDITED (1<<0) #define DF_ISPROCESSING (1<<1) #define DF_USE_TAG (1<<2) + +// /atom flags var diff --git a/code/__defines/items_clothing.dm b/code/__defines/items_clothing.dm index 902f27d5542..581270cd587 100644 --- a/code/__defines/items_clothing.dm +++ b/code/__defines/items_clothing.dm @@ -51,6 +51,7 @@ #define PROXMOVE 0x80 // Does this object require proximity checking in Enter()? #define OVERLAY_QUEUED 0x100 // Atom queued to SSoverlay for COMPILE_OVERLAYS #define INITIALIZED 0x200 +#define ADMIN_SPAWNED 0x400 //Flags for items (equipment) - Used in /obj/item/var/item_flags #define THICKMATERIAL 0x1 // Prevents syringes, parapens and hyposprays if equipped to slot_suit or slot_head. diff --git a/code/datums/browser.dm b/code/datums/browser.dm index b094cd57d5c..45f7c8c3a00 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -189,3 +189,508 @@ //world << "[src] was [src.mob.machine], setting to null" src.mob.unset_machine() return + + +/datum/browser/modal + var/opentime = 0 + var/timeout + var/selectedbutton = 0 + var/stealfocus + +/datum/browser/modal/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, StealFocus = 1, Timeout = 6000) + ..() + stealfocus = StealFocus + if (!StealFocus) + window_options += "focus=false;" + timeout = Timeout + + +/datum/browser/modal/close() + .=..() + opentime = 0 + +/datum/browser/modal/open(use_onclose) + set waitfor = 0 + opentime = world.time + + if (stealfocus) + . = ..(use_onclose = 1) + else + var/focusedwindow = winget(user, null, "focus") + . = ..(use_onclose = 1) + + //waits for the window to show up client side before attempting to un-focus it + //winexists sleeps until it gets a reply from the client, so we don't need to bother sleeping + for (var/i in 1 to 10) + if (user && winexists(user, window_id)) + if (focusedwindow) + winset(user, focusedwindow, "focus=true") + else + winset(user, "mapwindow", "focus=true") + break + if (timeout) + addtimer(CALLBACK(src, .proc/close), timeout) + +/datum/browser/modal/proc/wait() + while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time)) + stoplag(1) + +/datum/browser/modal/listpicker + var/valueslist = list() + +/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,inputtype="checkbox", width, height, slidecolor) + if (!User) + return + + var/output = {"
+ "} + + if (Button2) + output += {""} + + if (Button3) + output += {""} + + output += {"
"} + ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, width, height, src, StealFocus, Timeout) + set_content(output) + +/datum/browser/modal/listpicker/Topic(href,href_list) + if (href_list["close"] || !user || !user.client) + opentime = 0 + return + if (href_list["button"]) + var/button = text2num(href_list["button"]) + if (button <= 3 && button >= 1) + selectedbutton = button + for (var/item in href_list) + switch(item) + if ("close", "button", "src") + continue + else + valueslist[item] = href_list[item] + opentime = 0 + close() + +/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values, inputtype = "checkbox", width, height, slidecolor) + if (!istype(User)) + if (istype(User, /client/)) + var/client/C = User + User = C.mob + else + return + var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values, inputtype, width, height, slidecolor) + A.open() + A.wait() + if (A.selectedbutton) + return list("button" = A.selectedbutton, "values" = A.valueslist) + +/proc/input_bitfield(var/mob/User, title, bitfield, current_value, nwidth = 350, nheight = 350, nslidecolor, allowed_edit_list = null) + if (!User || !(bitfield in GLOB.bitfields)) + return + var/list/pickerlist = list() + for (var/i in GLOB.bitfields[bitfield]) + var/can_edit = 1 + if(!isnull(allowed_edit_list) && !(allowed_edit_list & GLOB.bitfields[bitfield][i])) + can_edit = 0 + if (current_value & GLOB.bitfields[bitfield][i]) + pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit)) + else + pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit)) + var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist, width = nwidth, height = nheight, slidecolor = nslidecolor) + if (islist(result)) + if (result["button"] == 2) // If the user pressed the cancel button + return + . = 0 + for (var/flag in result["values"]) + . |= GLOB.bitfields[bitfield][flag] + else + return + + + + + + + + + + + + + + + + + +/* + + + + + + + + + + + + +/datum/browser + var/mob/user + var/title + var/window_id // window_id is used as the window name for browse and onclose + var/width = 0 + var/height = 0 + var/atom/ref = null + var/window_options = "can_close=1;can_minimize=1;can_maximize=0;can_resize=1;titlebar=1;" // window option is set using window_id + var/stylesheets[0] + var/scripts[0] + var/title_image + var/head_elements + var/body_elements + var/head_content = "" + var/content = "" + +/datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null) + + user = nuser + window_id = nwindow_id + if (ntitle) + title = format_text(ntitle) + if (nwidth) + width = nwidth + if (nheight) + height = nheight + if (nref) + ref = nref + add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs + +/datum/browser/proc/add_head_content(nhead_content) + head_content = nhead_content + +/datum/browser/proc/set_window_options(nwindow_options) + window_options = nwindow_options + +/datum/browser/proc/set_title_image(ntitle_image) + //title_image = ntitle_image + +/datum/browser/proc/add_stylesheet(name, file) + if (istype(name, /datum/asset/spritesheet)) + var/datum/asset/spritesheet/sheet = name + stylesheets["spritesheet_[sheet.name].css"] = "data/spritesheets/[sheet.name]" + else + var/asset_name = "[name].css" + + stylesheets[asset_name] = file + + if (!SSassets.cache[asset_name]) + register_asset(asset_name, file) + +/datum/browser/proc/add_script(name, file) + scripts["[ckey(name)].js"] = file + register_asset("[ckey(name)].js", file) + +/datum/browser/proc/set_content(ncontent) + content = ncontent + +/datum/browser/proc/add_content(ncontent) + content += ncontent + +/datum/browser/proc/get_header() + var/file + for (file in stylesheets) + head_content += "" + + for (file in scripts) + head_content += "" + + var/title_attributes = "class='uiTitle'" + if (title_image) + title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'" + + return {" + + + + + [head_content] + + +
+ [title ? "
[title]
" : ""] +
+ "} +//" This is here because else the rest of the file looks like a string in notepad++. +/datum/browser/proc/get_footer() + return {" +
+
+ +"} + +/datum/browser/proc/get_content() + return {" + [get_header()] + [content] + [get_footer()] + "} + +/datum/browser/proc/open(use_onclose = TRUE) + if(isnull(window_id)) //null check because this can potentially nuke goonchat + WARNING("Browser [title] tried to open with a null ID") + to_chat(user, "The [title] browser you tried to open failed a sanity check! Please report this on github!") + return + var/window_size = "" + if (width && height) + window_size = "size=[width]x[height];" + if (stylesheets.len) + send_asset_list(user, stylesheets, verify=FALSE) + if (scripts.len) + send_asset_list(user, scripts, verify=FALSE) + user << browse(get_content(), "window=[window_id];[window_size][window_options]") + if (use_onclose) + setup_onclose() + +/datum/browser/proc/setup_onclose() + set waitfor = 0 //winexists sleeps, so we don't need to. + for (var/i in 1 to 10) + if (user && winexists(user, window_id)) + onclose(user, window_id, ref) + break + +/datum/browser/proc/close() + if(!isnull(window_id))//null check because this can potentially nuke goonchat + user << browse(null, "window=[window_id]") + else + WARNING("Browser [title] tried to close with a null ID") + +/datum/browser/modal/alert/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1,Timeout=6000) + if (!User) + return + + var/output = {"
[Message]

+
+ [Button1]"} + + if (Button2) + output += {"[Button2]"} + + if (Button3) + output += {"[Button3]"} + + output += {"
"} + + ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 150, src, StealFocus, Timeout) + set_content(output) + +/datum/browser/modal/alert/Topic(href,href_list) + if (href_list["close"] || !user || !user.client) + opentime = 0 + return + if (href_list["button"]) + var/button = text2num(href_list["button"]) + if (button <= 3 && button >= 1) + selectedbutton = button + opentime = 0 + close() + +//designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) +/proc/tgalert(var/mob/User, Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000) + if (!User) + User = usr + switch(askuser(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout)) + if (1) + return Button1 + if (2) + return Button2 + if (3) + return Button3 + +//Same shit, but it returns the button number, could at some point support unlimited button amounts. +/proc/askuser(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1, Timeout = 6000) + if (!istype(User)) + if (istype(User, /client/)) + var/client/C = User + User = C.mob + else + return + var/datum/browser/modal/alert/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout) + A.open() + A.wait() + if (A.selectedbutton) + return A.selectedbutton + +/datum/browser/modal/preflikepicker + var/settings = list() + var/icon/preview_icon = null + var/datum/callback/preview_update + +/datum/browser/modal/preflikepicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/settings,inputtype="checkbox", width = 600, height, slidecolor) + if (!User) + return + src.settings = settings + + ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, width, height, src, StealFocus, Timeout) + set_content(ShowChoices(User)) + +/datum/browser/modal/preflikepicker/proc/ShowChoices(mob/user) + if (settings["preview_callback"]) + var/datum/callback/callback = settings["preview_callback"] + preview_icon = callback.Invoke(settings) + if (preview_icon) + user << browse_rsc(preview_icon, "previewicon.png") + var/dat = "" + + for (var/name in settings["mainsettings"]) + var/setting = settings["mainsettings"][name] + if (setting["type"] == "datum") + if (setting["subtypesonly"]) + dat += "[setting["desc"]]: [setting["value"]]
" + else + dat += "[setting["desc"]]: [setting["value"]]
" + else + dat += "[setting["desc"]]: [setting["value"]]
" + + if (preview_icon) + dat += "" + + dat += "
" + + dat += "" + + dat += "" + + dat += "
Ok " + + dat += "
" + + return dat + +/datum/browser/modal/preflikepicker/Topic(href,href_list) + if (href_list["close"] || !user || !user.client) + opentime = 0 + return + if (href_list["task"] == "input") + var/setting = href_list["setting"] + switch (href_list["type"]) + if ("datum") + var/oldval = settings["mainsettings"][setting]["value"] + if (href_list["subtypesonly"]) + settings["mainsettings"][setting]["value"] = pick_closest_path(null, make_types_fancy(subtypesof(text2path(href_list["path"])))) + else + settings["mainsettings"][setting]["value"] = pick_closest_path(null, make_types_fancy(typesof(text2path(href_list["path"])))) + if (isnull(settings["mainsettings"][setting]["value"])) + settings["mainsettings"][setting]["value"] = oldval + if ("string") + settings["mainsettings"][setting]["value"] = stripped_input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"]) + if ("number") + settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]") as num + if ("color") + settings["mainsettings"][setting]["value"] = input(user, "Enter new value for [settings["mainsettings"][setting]["desc"]]", "Enter new value for [settings["mainsettings"][setting]["desc"]]", settings["mainsettings"][setting]["value"]) as color + if ("boolean") + settings["mainsettings"][setting]["value"] = input(user, "[settings["mainsettings"][setting]["desc"]]?") in list("Yes","No") + if ("ckey") + settings["mainsettings"][setting]["value"] = input(user, "[settings["mainsettings"][setting]["desc"]]?") in list("none") + GLOB.directory + if (settings["mainsettings"][setting]["callback"]) + var/datum/callback/callback = settings["mainsettings"][setting]["callback"] + settings = callback.Invoke(settings) + if (href_list["button"]) + var/button = text2num(href_list["button"]) + if (button <= 3 && button >= 1) + selectedbutton = button + if (selectedbutton != 1) + set_content(ShowChoices(user)) + open() + return + for (var/item in href_list) + switch(item) + if ("close", "button", "src") + continue + opentime = 0 + close() + +/proc/presentpreflikepicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/settings, width, height, slidecolor) + if (!istype(User)) + if (istype(User, /client/)) + var/client/C = User + User = C.mob + else + return + var/datum/browser/modal/preflikepicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, settings, width, height, slidecolor) + A.open() + A.wait() + if (A.selectedbutton) + return list("button" = A.selectedbutton, "settings" = A.settings) + +// This will allow you to show an icon in the browse window +// This is added to mob so that it can be used without a reference to the browser object +// There is probably a better place for this... +/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1) + + +// Registers the on-close verb for a browse window (client/verb/.windowclose) +// this will be called when the close-button of a window is pressed. +// +// This is usually only needed for devices that regularly update the browse window, +// e.g. canisters, timers, etc. +// +// windowid should be the specified window name +// e.g. code is : user << browse(text, "window=fred") +// then use : onclose(user, "fred") +// +// Optionally, specify the "ref" parameter as the controlled atom (usually src) +// to pass a "close=1" parameter to the atom's Topic() proc for special handling. +// Otherwise, the user mob's machine var will be reset directly. +// +/proc/onclose(mob/user, windowid, atom/ref=null) + if(!user.client) + return + var/param = "null" + if(ref) + param = "[REF(ref)]" + + winset(user, windowid, "on-close=\".windowclose [param]\"") + + + +// the on-close client verb +// called when a browser popup window is closed after registering with proc/onclose() +// if a valid atom reference is supplied, call the atom's Topic() with "close=1" +// otherwise, just reset the client mob's machine var. +// +/client/verb/windowclose(atomref as text) + set hidden = 1 // hide this verb from the user's panel + set name = ".windowclose" // no autocomplete on cmd line + + if(atomref!="null") // if passed a real atomref + var/hsrc = locate(atomref) // find the reffed atom + var/href = "close=1" + if(hsrc) + usr = src.mob + src.Topic(href, params2list(href), hsrc) // this will direct to the atom's + return // Topic() proc via client.Topic() + + // no atomref specified (or not found) + // so just reset the user mob's machine var + if(src && src.mob) + src.mob.unset_machine() +*/ + diff --git a/code/datums/helper_datums/events.dm b/code/datums/helper_datums/events.dm index 0a4d2365245..5d18b50e82c 100644 --- a/code/datums/helper_datums/events.dm +++ b/code/datums/helper_datums/events.dm @@ -32,7 +32,7 @@ // Returns: null proc/fireEvent() //world << "Events in [args[1]] called" - var/list/event = listgetindex(events,args[1]) + var/list/event = SAFEACCESS(events,args[1]) if(istype(event)) spawn(-1) for(var/datum/event/E in event) @@ -45,7 +45,7 @@ proc/clearEvent(event_type as text, datum/event/E) if(!event_type || !E) return - var/list/event = listgetindex(events,event_type) + var/list/event = SAFEACCESS(events, event_type) event -= E return 1 diff --git a/code/datums/helper_datums/topic_input.dm b/code/datums/helper_datums/topic_input.dm index c08ca754be4..492f3abb63f 100644 --- a/code/datums/helper_datums/topic_input.dm +++ b/code/datums/helper_datums/topic_input.dm @@ -8,7 +8,7 @@ return proc/get(i) - return listgetindex(href_list,i) + return SAFEACCESS(href_list,i) proc/getAndLocate(i) var/t = get(i) diff --git a/code/game/atom_vv.dm b/code/game/atom_vv.dm index e15a81df82f..fd9b8a60988 100644 --- a/code/game/atom_vv.dm +++ b/code/game/atom_vv.dm @@ -13,9 +13,11 @@ if(!Debug2) flags |= ADMIN_SPAWNED . = ..() + /* switch(var_name) if("color") add_atom_colour(color, ADMIN_COLOUR_PRIORITY) + */ /** * Return the markup to for the dropdown list for the VV panel for this atom diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index bcd03208b8a..03c11bbe8a4 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -532,7 +532,7 @@ return call((proc_res["dynabsorbdamage"]||src), "dynabsorbdamage")(damage,damage_type) /obj/mecha/proc/dynabsorbdamage(damage,damage_type) - return damage*(listgetindex(damage_absorption,damage_type) || 1) + return damage*(SAFEACCESS(damage_absorption,damage_type) || 1) /obj/mecha/airlock_crush(var/crush_damage) ..() diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm new file mode 100644 index 00000000000..40d5261a6bb --- /dev/null +++ b/code/game/turfs/change_turf.dm @@ -0,0 +1,4 @@ +//pending tg change turf stuff + +/turf/proc/ScrapeAway() + return ChangeTurf(get_base_turf_by_area(loc)) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index c4f66f74516..5383b0757cd 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1221,7 +1221,7 @@ if(!can_ghost) return - var/mob/dead/observer/A = C.mob + var/mob/observer/dead/A = C.mob A.ManualFollow(AM) else if(href_list["admingetmovable"]) diff --git a/code/modules/client/client defines.dm b/code/modules/client/client_defines.dm similarity index 100% rename from code/modules/client/client defines.dm rename to code/modules/client/client_defines.dm diff --git a/code/modules/client/client procs.dm b/code/modules/client/client_procs.dm similarity index 96% rename from code/modules/client/client procs.dm rename to code/modules/client/client_procs.dm index ae110347903..71bb09eb668 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client_procs.dm @@ -396,6 +396,27 @@ return TRUE . = ..() +/client/proc/change_view(new_size) + if (isnull(new_size)) + CRASH("change_view called without argument.") + + /* + if(prefs && !prefs.widescreenpref && new_size == CONFIG_GET(string/default_view)) + new_size = CONFIG_GET(string/default_view_square) + */ + + view = new_size + + /* + apply_clickcatcher() + mob.reload_fullscreen() + if (isliving(mob)) + var/mob/living/M = mob + M.update_damage_hud() + if (prefs.auto_fit_viewport) + addtimer(CALLBACK(src,.verb/fit_viewport,10)) //Delayed to avoid wingets from Login calls. + */ + mob/proc/MayRespawn() return 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2ead6dee215..1b612a8064c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1174,7 +1174,7 @@ mob/proc/yank_out_object() if(!check_has_body_select()) return var/obj/screen/zone_sel/selector = mob.zone_sel - selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones)) + selector.set_selected_zone(next_list_item(mob.zone_sel.selecting,zones)) // This handles setting the client's color variable, which makes everything look a specific color. // This proc is here so it can be called without needing to check if the client exists, or if the client relogs. diff --git a/vorestation.dme b/vorestation.dme index 98173c2fa10..51a2eee3b83 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1304,6 +1304,7 @@ #include "code\game\objects\structures\stool_bed_chair_nest\chairs.dm" #include "code\game\objects\structures\stool_bed_chair_nest\stools.dm" #include "code\game\objects\structures\stool_bed_chair_nest\wheelchair.dm" +#include "code\game\turfs\change_turf.dm" #include "code\game\turfs\simulated.dm" #include "code\game\turfs\turf.dm" #include "code\game\turfs\turf_changing.dm" @@ -1512,8 +1513,8 @@ #include "code\modules\busy_space\loremaster.dm" #include "code\modules\busy_space\organizations.dm" #include "code\modules\client\asset_cache.dm" -#include "code\modules\client\client defines.dm" -#include "code\modules\client\client procs.dm" +#include "code\modules\client\client_defines.dm" +#include "code\modules\client\client_procs.dm" #include "code\modules\client\movement.dm" #include "code\modules\client\preferences.dm" #include "code\modules\client\preferences_factions.dm"