mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Code cleanup time!
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
// for /datum/var/datum_flags
|
||||
#define DF_USE_TAG (1<<0)
|
||||
#define DF_VAR_EDITED (1<<1)
|
||||
#define DF_ISPROCESSING (1<<2)
|
||||
|
||||
//FLAGS BITMASK
|
||||
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||
|
||||
@@ -18,20 +18,24 @@ var/global/next_unique_datum_id = 1
|
||||
|
||||
// /client/var/tmp/unique_datum_id = null
|
||||
|
||||
/datum/proc/UID()
|
||||
if(!unique_datum_id)
|
||||
/datum/proc/UID(input)
|
||||
if (input)
|
||||
if(istype(input, /datum))
|
||||
var/datum/thing = input
|
||||
if(thing.datum_flags & DF_USE_TAG)
|
||||
if(!thing.tag)
|
||||
stack_trace("A ref was requested of an object with DF_USE_TAG set but no tag: [thing]")
|
||||
thing.datum_flags &= ~DF_USE_TAG
|
||||
else
|
||||
return "\[[url_encode(thing.tag)]\]"
|
||||
return "\ref[input]"
|
||||
else if(!unique_datum_id)
|
||||
var/tag_backup = tag
|
||||
tag = null // Grab the raw ref, not the tag
|
||||
unique_datum_id = "\ref[src]_[next_unique_datum_id++]"
|
||||
tag = tag_backup
|
||||
return unique_datum_id
|
||||
|
||||
/client/UID()
|
||||
if(!unique_datum_id)
|
||||
unique_datum_id = "\ref[src]_[next_unique_datum_id++]"
|
||||
return unique_datum_id
|
||||
|
||||
|
||||
/proc/locateUID(uid)
|
||||
if(!istext(uid))
|
||||
return null
|
||||
|
||||
@@ -2028,18 +2028,4 @@ var/mob/dview/dview_mob = new
|
||||
CRASH(msg)
|
||||
|
||||
/proc/pass()
|
||||
return
|
||||
|
||||
// \ref behaviour got changed in 512 so this is necesary to replicate old behaviour.
|
||||
// If it ever becomes necesary to get a more performant REF(), this lies here in wait
|
||||
// #define REF(thing) (thing && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")
|
||||
/proc/REF(input)
|
||||
if(istype(input, /datum))
|
||||
var/datum/thing = input
|
||||
if(thing.datum_flags & DF_USE_TAG)
|
||||
if(!thing.tag)
|
||||
stack_trace("A ref was requested of an object with DF_USE_TAG set but no tag: [thing]")
|
||||
thing.datum_flags &= ~DF_USE_TAG
|
||||
else
|
||||
return "\[[url_encode(thing.tag)]\]"
|
||||
return "\ref[input]"
|
||||
return
|
||||
@@ -43,12 +43,6 @@
|
||||
qdel(C, FALSE, TRUE)
|
||||
dc.Cut()
|
||||
|
||||
var/list/focusers = src.focusers
|
||||
if(focusers)
|
||||
for(var/i in 1 to focusers.len)
|
||||
var/mob/M = focusers[i]
|
||||
M.set_focus(M)
|
||||
|
||||
var/list/lookup = comp_lookup
|
||||
if(lookup)
|
||||
for(var/sig in lookup)
|
||||
|
||||
@@ -8,14 +8,5 @@
|
||||
/mob/proc/set_focus(datum/new_focus)
|
||||
if(focus == new_focus)
|
||||
return
|
||||
|
||||
if(new_focus)
|
||||
if(!new_focus.focusers) //Set up the new focus
|
||||
new_focus.focusers = list()
|
||||
new_focus.focusers += src
|
||||
|
||||
if(focus)
|
||||
focus.focusers -= src //Tell the old focus we're done with it
|
||||
|
||||
focus = new_focus
|
||||
reset_perspective(focus) //Maybe this should be done manually? You figure it out, reader
|
||||
@@ -42,5 +42,5 @@
|
||||
for(var/k in 1 to macro_set.len)
|
||||
var/key = macro_set[k]
|
||||
var/command = macro_set[key]
|
||||
winset(src, "[setname]-[REF(key)]", "parent=[setname];name=[key];command=[command]")
|
||||
winset(src, "[setname]-[UID(key)]", "parent=[setname];name=[key];command=[command]")
|
||||
winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=default")
|
||||
|
||||
@@ -20,5 +20,3 @@
|
||||
for(var/datum/light_source/L in light_sources)
|
||||
L.source_atom.update_light()
|
||||
return 1
|
||||
/mob/dead/Initialize()
|
||||
set_focus(src)
|
||||
Reference in New Issue
Block a user