Files
Letter N 00045a5961 update vv (#7478)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
title
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Please note that
maintainers freely reserve the right to remove and add tags should they
deem it appropriate. You can attempt to finagle the system all you want,
but it's best to shoot for clear communication right off the bat. -->

🆑
add: new adminbuse view matrix editor
code: cleanup legacy stuff & moved them into their own respective
dropdown option
code: use tg display-mutable-appearance
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2026-01-13 22:03:31 -05:00

74 lines
3.1 KiB
Plaintext

/// Shows a header name on top when you investigate an appearance/image
/image/vv_get_header()
. = list()
var/icon_name = "<b>[icon || "null"]</b><br/>"
. += replacetext(icon_name, "icons/obj", "") // shortens the name. We know the path already.
if(icon)
. += icon_state ? "\"[icon_state]\"" : "(icon_state = null)"
/// Makes nice short vv names for images
/image/debug_variable_value(name, level, datum/owner, sanitize, display_flags)
var/display_name = "[type]"
if("[src]" != "[type]") // If we have a name var, let's use it.
display_name = "[src] [type]"
var/display_value
var/list/icon_file_name = splittext("[icon]", "/")
if(length(icon_file_name))
display_value = icon_file_name[length(icon_file_name)]
else
display_value = "null"
if(icon_state)
display_value = "[display_value]:[icon_state]"
var/display_ref = get_vv_link_ref()
return "<a href='byond://?_src_=vars;[HrefToken()];Vars=[display_ref]'>[display_name] (<span class='value'>[display_value]</span>) [display_ref]</a>"
/// Returns the ref string to use when displaying this image in the vv menu of something else
/image/proc/get_vv_link_ref()
return REF(src)
// It is endlessly annoying to display /appearance directly for stupid byond reasons, so we copy everything we care about into a holder datum
// That we can override procs on and store other vars on and such.
/mutable_appearance/appearance_mirror
// So people can see where it came from
var/appearance_ref
// arg is actually an appearance, typed as mutable_appearance as closest mirror
/mutable_appearance/appearance_mirror/New(mutable_appearance/appearance_father)
. = ..() // /mutable_appearance/New() copies over all the appearance vars MAs care about by default
appearance_ref = REF(appearance_father)
// This means if the appearance loses refs before a click it's gone, but that's consistent to other datums so it's fine
// Need to ref the APPEARANCE because we just free on our own, which sorta fucks this operation up you know?
/mutable_appearance/appearance_mirror/get_vv_link_ref()
return appearance_ref
/mutable_appearance/appearance_mirror/can_vv_get(var_name)
var/static/datum/beloved = new()
if(beloved.vars.Find(var_name)) // If datums have it, get out
return FALSE
// Could make an argument for this but I think they will just confuse people, so yeeet
if(var_name == NAMEOF(src, vis_contents))
return FALSE
return ..()
/mutable_appearance/appearance_mirror/vv_get_var(var_name)
// No editing for you
var/value = vars[var_name]
return "<li style='backgroundColor:white'>(READ ONLY) [var_name] = [_debug_variable_value(var_name, value, 0, src, sanitize = TRUE, display_flags = NONE)]</li>"
/mutable_appearance/appearance_mirror/vv_get_dropdown()
SHOULD_CALL_PARENT(FALSE)
. = list()
VV_DROPDOWN_OPTION("", "---")
VV_DROPDOWN_OPTION(VV_HK_CALLPROC, "Call Proc")
VV_DROPDOWN_OPTION(VV_HK_MARK, "Mark Object")
VV_DROPDOWN_OPTION(VV_HK_DELETE, "Delete")
VV_DROPDOWN_OPTION(VV_HK_EXPOSE, "Show VV To Player")
/proc/get_vv_appearance(mutable_appearance/appearance) // actually appearance yadeeyada
return new /mutable_appearance/appearance_mirror(appearance)