From e3cb4d95cfc4f9161135334c4a984c626aaa3e70 Mon Sep 17 00:00:00 2001 From: Gingerbeard <68350259+Gingerbeard5773@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:50:08 -0500 Subject: [PATCH 1/3] Icon team & color --- EasyUI/Components/Icon.as | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/EasyUI/Components/Icon.as b/EasyUI/Components/Icon.as index 7a491eb..4fe23f5 100644 --- a/EasyUI/Components/Icon.as +++ b/EasyUI/Components/Icon.as @@ -9,6 +9,12 @@ interface Icon : Stack void SetFrameDim(uint width, uint height); Vec2f getFrameDim(); + void SetTeam(uint team); + uint getTeam(); + + void SetColor(SColor color); + SColor getColor(); + void SetCrop(float top, float right, float bottom, float left); void SetFixedAspectRatio(bool fixed); @@ -22,6 +28,8 @@ class StandardIcon : Icon, StandardStack private string texture = ""; private uint frameIndex = 0; private Vec2f frameDim = Vec2f_zero; + private uint team = 0; + private SColor color = color_white; private float cropTop = 0.0f; private float cropRight = 0.0f; private float cropBottom = 0.0f; @@ -72,6 +80,34 @@ class StandardIcon : Icon, StandardStack return frameDim; } + void SetTeam(uint team) + { + if (this.team == team) return; + + this.team = team; + + DispatchEvent(Event::Team); + } + + uint getTeam() + { + return team; + } + + void SetColor(SColor color) + { + if (this.color == color) return; + + this.color = color; + + DispatchEvent(Event::Color); + } + + SColor getColor() + { + return color; + } + void SetCrop(float top, float right, float bottom, float left) { if (cropTop == top && cropRight == right && cropBottom == bottom && cropLeft == left) return; @@ -176,7 +212,7 @@ class StandardIcon : Icon, StandardStack Vec2f scale = getScale() * 0.5f; Vec2f offset = getOffset(); - GUI::DrawIcon(texture, frameIndex, frameDim, position + offset, scale.x, scale.y, color_white); + GUI::DrawIcon(texture, frameIndex, frameDim, position + offset, scale.x, scale.y, team, color); } StandardStack::Render(); From 62e88068e8025c75eed40dedda87e809bebe0ce7 Mon Sep 17 00:00:00 2001 From: Gingerbeard <68350259+Gingerbeard5773@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:50:59 -0500 Subject: [PATCH 2/3] Added team event --- EasyUI/Events/Events.as | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EasyUI/Events/Events.as b/EasyUI/Events/Events.as index 022ff5a..3130647 100644 --- a/EasyUI/Events/Events.as +++ b/EasyUI/Events/Events.as @@ -31,6 +31,7 @@ enum Event Clickable, Text, Font, + Team, Color, Wrap, MaxLines, @@ -49,3 +50,4 @@ enum Event EndDrag, Scroll, } + From 7914fd83197514750e7c57be5e61219d5fb85e1d Mon Sep 17 00:00:00 2001 From: Gingerbeard <68350259+Gingerbeard5773@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:03:12 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 5e484da..f37e2e8 100644 --- a/README.md +++ b/README.md @@ -498,6 +498,28 @@ void SetFrameDim(uint width, uint height); Vec2f getFrameDim(); ``` +#### Team + +The team number of the icon. + +Default: `0` + +```angelscript +void SetTeam(uint team); +uint getTeam(); +``` + +#### Color + +The color of the icon. + +Default: `white` + +```angelscript +void SetColor(SColor color); +SColor getColor(); +``` + #### Crop The icon can be cropped if it is too small compared to its frame dimensions. @@ -654,3 +676,4 @@ Default: `false` void SetChecked(bool checked); bool isChecked(); ``` +