Contraband examine changes (again) (#36032)

* g

* no one caught it in review, damn
This commit is contained in:
Killerqu00
2025-04-18 03:23:02 +02:00
committed by GitHub
parent 4f24b25cf9
commit e0308d0913
9 changed files with 17 additions and 16 deletions

View File

@@ -84,26 +84,21 @@ public sealed class ContrabandSystem : EntitySystem
}
}
String carryingMessage;
// either its fully restricted, you have no departments, or your departments dont intersect with the restricted departments
// if it is fully restricted, you're department-less, or your department isn't in the allowed list, you cannot carry it. Otherwise, you can.
var carryingMessage = Loc.GetString("contraband-examine-text-avoid-carrying-around");
var iconTexture = "/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png";
if (departments.Intersect(component.AllowedDepartments).Any()
|| jobs.Contains(jobId))
{
carryingMessage = Loc.GetString("contraband-examine-text-in-the-clear");
iconTexture = "/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png";
}
else
{
// otherwise fine to use :tm:
carryingMessage = Loc.GetString("contraband-examine-text-avoid-carrying-around");
}
var examineMarkup = GetContrabandExamine(departmentExamineMessage, carryingMessage);
_examine.AddDetailedExamineVerb(args,
_examine.AddHoverExamineVerb(args,
component,
examineMarkup,
Loc.GetString("contraband-examinable-verb-text"),
"/Textures/Interface/VerbIcons/lock.svg.192dpi.png",
Loc.GetString("contraband-examinable-verb-message"));
examineMarkup.ToMarkup(),
iconTexture);
}
private FormattedMessage GetContrabandExamine(String deptMessage, String carryMessage)

View File

@@ -184,9 +184,9 @@ namespace Content.Shared.Examine
/// <summary>
/// Adds an icon aligned to the left of examine window that gives you info on hover.
/// </summary>
public void AddHoverExamineVerb(GetVerbsEvent<ExamineVerb> verbsEvent, Component component, string hoverMessage, string iconTexture = DefaultIconTexture)
public void AddHoverExamineVerb(GetVerbsEvent<ExamineVerb> verbsEvent, Component component, string verbText, string hoverMessage, string iconTexture = DefaultIconTexture)
{
AddDetailedExamineVerb(verbsEvent, component, FormattedMessage.Empty, "", iconTexture, hoverMessage, true);
AddDetailedExamineVerb(verbsEvent, component, FormattedMessage.Empty, verbText, iconTexture, hoverMessage, true);
}
}
}

View File

@@ -2,10 +2,10 @@ All icons are public domain.
Pulled mostly from this source https://github.com/apancik/public-domain-icons.
lock.svg by Lorc under CC BY 3.0
lock.svg and lock-red.svg by Lorc under CC BY 3.0
https://game-icons.net/1x1/lorc/padlock.html
unlock.svg by Delapouite under CC BY 3.0
unlock.svg and unlock-green by Delapouite under CC BY 3.0
https://game-icons.net/1x1/delapouite/padlock-open.html
bubbles.svg by Lorc under CC BY 3.0

View File

@@ -0,0 +1 @@
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g class="" style="" transform="translate(0,0)"><path d="M254.28 17.313c-81.048 0-146.624 65.484-146.624 146.406V236h49.594v-69.094c0-53.658 43.47-97.187 97.03-97.187 53.563 0 97.032 44.744 97.032 97.186V236h49.594v-72.28c0-78.856-65.717-146.407-146.625-146.407zM85.157 254.688c-14.61 22.827-22.844 49.148-22.844 76.78 0 88.358 84.97 161.5 191.97 161.5 106.998 0 191.968-73.142 191.968-161.5 0-27.635-8.26-53.95-22.875-76.78H85.155zM254 278.625c22.34 0 40.875 17.94 40.875 40.28 0 16.756-10.6 31.23-25.125 37.376l32.72 98.126h-96.376l32.125-98.125c-14.526-6.145-24.532-20.62-24.532-37.374 0-22.338 17.972-40.28 40.312-40.28z" fill="#8b0000" fill-opacity="1" style="--darkreader-inline-fill: var(--darkreader-background-8b0000, #6f0000);" data-darkreader-inline-fill=""></path></g></svg>

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -0,0 +1 @@
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g class="" style="" transform="translate(0,0)"><path d="M402.6 164.6c0-78.92-65.7-146.47-146.6-146.47-81.1 0-146.6 65.49-146.6 146.47v72.3H159v-69.1c0-53.7 43.4-97.26 97-97.26 53.5 0 97 41.66 97 94.06zm-315.7 91C72.2 278.4 64 304.7 64 332.4c0 88.3 85 161.5 192 161.5s192-73.2 192-161.5c0-27.7-8.3-54-22.9-76.8zm168.8 23.9c22.3 0 40.9 18 40.9 40.3 0 16.8-10.6 31.2-25.1 37.3l32.7 98.2h-96.4l32.1-98.2c-14.5-6.1-24.5-20.6-24.5-37.3 0-22.3 18-40.3 40.3-40.3z" fill="#006400" fill-opacity="1" style="--darkreader-inline-fill: var(--darkreader-background-006400, #005000);" data-darkreader-inline-fill=""></path></g></svg>

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,2 @@
sample:
filter: true