]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Contraband examine changes (again) (#36032)
authorKillerqu00 <47712032+Killerqu00@users.noreply.github.com>
Fri, 18 Apr 2025 01:23:02 +0000 (03:23 +0200)
committerGitHub <noreply@github.com>
Fri, 18 Apr 2025 01:23:02 +0000 (11:23 +1000)
* g

* no one caught it in review, damn

Content.Shared/Contraband/ContrabandSystem.cs
Content.Shared/Examine/ExamineSystemShared.Group.cs
Resources/Textures/Interface/VerbIcons/ATTRIBUTION.txt
Resources/Textures/Interface/VerbIcons/lock-red.svg [new file with mode: 0644]
Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png [new file with mode: 0644]
Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png.yml [new file with mode: 0644]
Resources/Textures/Interface/VerbIcons/unlock-green.svg [new file with mode: 0644]
Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png [new file with mode: 0644]
Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png.yml [new file with mode: 0644]

index bfd7100289246a4036e3f9ee7fc4c70a78c30754..c998875c87aabb7d8919690c940df5d66ced9678 100644 (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)
index 299d3c4af287f80cbcc69abd44fd826eca7f0593..64b70d0af34d54615d27b54ec025d9aede141231 100644 (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);
         }
     }
 }
index 1c71df2d5c951eeb927a2887ee96cf20f5802076..bb584a7c20dbf31883684d954719f962b43dd4f7 100644 (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
diff --git a/Resources/Textures/Interface/VerbIcons/lock-red.svg b/Resources/Textures/Interface/VerbIcons/lock-red.svg
new file mode 100644 (file)
index 0000000..ba2546d
--- /dev/null
@@ -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>
\ No newline at end of file
diff --git a/Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png b/Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png
new file mode 100644 (file)
index 0000000..0801b8c
Binary files /dev/null and b/Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png differ
diff --git a/Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png.yml b/Resources/Textures/Interface/VerbIcons/lock-red.svg.192dpi.png.yml
new file mode 100644 (file)
index 0000000..5c43e23
--- /dev/null
@@ -0,0 +1,2 @@
+sample:
+  filter: true
diff --git a/Resources/Textures/Interface/VerbIcons/unlock-green.svg b/Resources/Textures/Interface/VerbIcons/unlock-green.svg
new file mode 100644 (file)
index 0000000..83a61cc
--- /dev/null
@@ -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>
\ No newline at end of file
diff --git a/Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png b/Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png
new file mode 100644 (file)
index 0000000..baad170
Binary files /dev/null and b/Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png differ
diff --git a/Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png.yml b/Resources/Textures/Interface/VerbIcons/unlock-green.svg.192dpi.png.yml
new file mode 100644 (file)
index 0000000..5c43e23
--- /dev/null
@@ -0,0 +1,2 @@
+sample:
+  filter: true