Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds color boxes to View Variable hex colors #28064

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Vi3trice
Copy link
Contributor

@Vi3trice Vi3trice commented Jan 22, 2025

What Does This PR Do

Adds a helper to detect hex colors, and have VV display a colorbox matching the value.

Why It's Good For The Game

Gives a better idea of what you're looking at.

Images of changes

SpessColors

Testing

Spawned a rather colorful mob and VVed it. Also messed with values and saw the resulting changes.


Declaration

  • I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.

Changelog

NPFC

@ParadiseSS13-Bot ParadiseSS13-Bot added the -Status: Awaiting review This PR is awaiting review from the review team label Jan 23, 2025
code/datums/datumvars.dm Outdated Show resolved Hide resolved
Vi3trice and others added 2 commits January 24, 2025 08:13
Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>
Signed-off-by: Vi3trice <80771500+Vi3trice@users.noreply.github.com>
@@ -491,6 +491,9 @@
if(isnull(value))
item = "[VV_HTML_ENCODE(name)] = <span class='value'>null</span>"

else if(is_color_text(value))
item = "[VV_HTML_ENCODE(name)] = <span class='value'><span class='colorbox' style='width: 1em; background-color: [value]; border: 1px solid black; display: inline-block'>&nbsp;</span> \"[value]\"</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
item = "[VV_HTML_ENCODE(name)] = <span class='value'><span class='colorbox' style='width: 1em; background-color: [value]; border: 1px solid black; display: inline-block'>&nbsp;</span> \"[value]\"</span>
item = "[VV_HTML_ENCODE(name)] = <span class='value'><span class='colorbox' style='width: 1em; background-color: [value]; border: 1px solid black; display: inline-block'>&nbsp;</span> \"[value]\"</span>"

Sorry about that, must have dropped a character when copy-pasting.

@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting merge This PR is ready for merge and removed -Status: Awaiting review This PR is awaiting review from the review team labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Status: Awaiting merge This PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants