mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Replaces a bunch of obj vars (and emagged on machinery/items) with obj_flags (#34078)
* It works, but is it worth it? * bitfield helpers take 1 * Would this work? * remove dangling debug code * rebase & fixes * vv bitfield stuff, reading * DNM oceans of shitcode DNM * honk * honk2 * plonk * rebase & fix
This commit is contained in:
committed by
AnturK
parent
70bec96f9c
commit
6406896df1
@@ -53,7 +53,7 @@
|
||||
if (prompt != "Continue")
|
||||
return
|
||||
|
||||
default = vv_get_class(var_value)
|
||||
default = vv_get_class(variable, var_value)
|
||||
|
||||
if(isnull(default))
|
||||
to_chat(src, "Unable to determine variable type.")
|
||||
@@ -263,4 +263,3 @@
|
||||
if (typecache[thing.type])
|
||||
. += thing
|
||||
CHECK_TICK
|
||||
|
||||
|
||||
@@ -8,12 +8,15 @@ GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "bound_height", "boun
|
||||
GLOBAL_PROTECT(VVpixelmovement)
|
||||
|
||||
|
||||
/client/proc/vv_get_class(var/var_value)
|
||||
/client/proc/vv_get_class(var/var_name, var/var_value)
|
||||
if(isnull(var_value))
|
||||
. = VV_NULL
|
||||
|
||||
else if (isnum(var_value))
|
||||
. = VV_NUM
|
||||
if (var_name in GLOB.bitfields)
|
||||
. = VV_BITFIELD
|
||||
else
|
||||
. = VV_NUM
|
||||
|
||||
else if (istext(var_value))
|
||||
if (findtext(var_value, "\n"))
|
||||
@@ -52,7 +55,7 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
else
|
||||
. = VV_NULL
|
||||
|
||||
/client/proc/vv_get_value(class, default_class, current_value, list/restricted_classes, list/extra_classes, list/classes)
|
||||
/client/proc/vv_get_value(class, default_class, current_value, list/restricted_classes, list/extra_classes, list/classes, var_name)
|
||||
. = list("class" = class, "value" = null)
|
||||
if (!class)
|
||||
if (!classes)
|
||||
@@ -109,6 +112,11 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
.["class"] = null
|
||||
return
|
||||
|
||||
if (VV_BITFIELD)
|
||||
.["value"] = input_bitfield(usr, "Editing bitfield: [var_name]", var_name, current_value)
|
||||
if (.["value"] == null)
|
||||
.["class"] = null
|
||||
return
|
||||
|
||||
if (VV_ATOM_TYPE)
|
||||
.["value"] = pick_closest_path(FALSE)
|
||||
@@ -436,7 +444,7 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
else
|
||||
variable = L[index]
|
||||
|
||||
default = vv_get_class(variable)
|
||||
default = vv_get_class(objectvar, variable)
|
||||
|
||||
to_chat(src, "Variable appears to be <b>[uppertext(default)]</b>.")
|
||||
|
||||
@@ -556,7 +564,7 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
return
|
||||
|
||||
|
||||
var/default = vv_get_class(var_value)
|
||||
var/default = vv_get_class(variable, var_value)
|
||||
|
||||
if(isnull(default))
|
||||
to_chat(src, "Unable to determine variable type.")
|
||||
@@ -585,7 +593,7 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
default = VV_MESSAGE
|
||||
class = default
|
||||
|
||||
var/list/value = vv_get_value(class, default, var_value, extra_classes = list(VV_LIST))
|
||||
var/list/value = vv_get_value(class, default, var_value, extra_classes = list(VV_LIST), var_name = variable)
|
||||
class = value["class"]
|
||||
|
||||
if (!class)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set name = "Possess Obj"
|
||||
set category = "Object"
|
||||
|
||||
if(O.dangerous_possession && CONFIG_GET(flag/forbid_singulo_possession))
|
||||
if((O.obj_flags & DANGEROUS_POSSESSION) && CONFIG_GET(flag/forbid_singulo_possession))
|
||||
to_chat(usr, "[O] is too powerful for you to possess.")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user