Datum var cleanup (#34314)

* Consolidates datum var location

* Move ui_screen to /datum/tgui

* Move focusers to datum.dm. Move fingerprintslast to /atom

* Remove focusers list, makes mobs check if their focus is QDELETED in Life()

* Consolidate use_tag and var_edited into datum_flags

* Revert garbage comment

* Thought I already removed this

* Remove the var_edited preservation

* Removes focus QDELETED handling
This commit is contained in:
Jordan Brown
2018-01-21 22:38:56 -05:00
committed by CitadelStationBot
parent 193c4d6971
commit e84617f17b
15 changed files with 40 additions and 60 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
GLOBAL_LIST_INIT(VVlocked, list("vars", "var_edited", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "force_ending"))
GLOBAL_LIST_INIT(VVlocked, list("vars", "datum_flags", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "force_ending"))
GLOBAL_PROTECT(VVlocked)
GLOBAL_LIST_INIT(VVicon_edit_lock, list("icon", "icon_state", "overlays", "underlays", "resize"))
GLOBAL_PROTECT(VVicon_edit_lock)
@@ -214,7 +214,7 @@ GLOBAL_PROTECT(VVpixelmovement)
return
.["type"] = type
var/atom/newguy = new type()
newguy.var_edited = TRUE
newguy.datum_flags |= DF_VAR_EDITED
.["value"] = newguy
if (VV_NEW_DATUM)
@@ -224,7 +224,7 @@ GLOBAL_PROTECT(VVpixelmovement)
return
.["type"] = type
var/datum/newguy = new type()
newguy.var_edited = TRUE
newguy.datum_flags |= DF_VAR_EDITED
.["value"] = newguy
if (VV_NEW_TYPE)
@@ -243,7 +243,7 @@ GLOBAL_PROTECT(VVpixelmovement)
.["type"] = type
var/datum/newguy = new type()
if(istype(newguy))
newguy.var_edited = TRUE
newguy.datum_flags |= DF_VAR_EDITED
.["value"] = newguy
+1 -1
View File
@@ -228,7 +228,7 @@ GLOBAL_PROTECT(exp_to_update)
play_records[role] += minutes
if(announce_changes)
to_chat(mob,"<span class='notice'>You got: [minutes] [role] EXP!</span>")
if(mob.mind.special_role && !mob.mind.var_edited)
if(mob.mind.special_role && !(mob.mind.datum_flags & DF_VAR_EDITED))
var/trackedrole = mob.mind.special_role
play_records[trackedrole] += minutes
if(announce_changes)
+1 -13
View File
@@ -1,20 +1,8 @@
/datum
var/list/focusers //Only initialized when needed. Contains a list of mobs focusing on this.
/mob
var/datum/focus //What receives our keyboard inputs. src by default
/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
reset_perspective(focus) //Maybe this should be done manually? You figure it out, reader
+1 -2
View File
@@ -174,8 +174,7 @@
return 0
/mob/proc/Life()
set waitfor = 0
return
set waitfor = FALSE
/mob/proc/get_item_by_slot(slot_id)
return null
+1 -1
View File
@@ -1,11 +1,11 @@
/mob
datum_flags = DF_USE_TAG
density = TRUE
layer = MOB_LAYER
animate_movement = 2
flags_1 = HEAR_1
hud_possible = list(ANTAG_HUD)
pressure_resistance = 8
use_tag = TRUE
var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
var/datum/mind/mind
var/list/datum/action/actions = list()
+3 -2
View File
@@ -35,6 +35,7 @@
var/list/datum/tgui/children = list() // Children of this UI.
var/titlebar = TRUE
var/custom_browser_id = FALSE
var/ui_screen = "home"
/**
* public
@@ -216,7 +217,7 @@
var/list/config_data = list(
"title" = title,
"status" = status,
"screen" = src_object.ui_screen,
"screen" = ui_screen,
"style" = style,
"interface" = interface,
"fancy" = user.client.prefs.tgui_fancy,
@@ -277,7 +278,7 @@
initialized = TRUE
if("tgui:view")
if(params["screen"])
src_object.ui_screen = params["screen"]
ui_screen = params["screen"]
SStgui.update_uis(src_object)
if("tgui:link")
user << link(params["url"])