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

Formation link Image Help #11385

Closed
tuvus opened this issue Apr 4, 2024 · 5 comments · Fixed by #11449
Closed

Formation link Image Help #11385

tuvus opened this issue Apr 4, 2024 · 5 comments · Fixed by #11449
Labels

Comments

@tuvus
Copy link
Collaborator

tuvus commented Apr 4, 2024

Problem Description

I am having trouble adding in the correct unit action link pictures for the Formation UI. I have tried in my branch FormationLinkImage, however I haven't had any success. Could someone else please take a look at this.

Thanks!

@tuvus tuvus added the feature label Apr 4, 2024
@SomeTroglodyte
Copy link
Collaborator

What do you mean, FormationLinkImage looks not too bad - what is the issue?

(apart from branch proliferation - 91 is lots, and why both getUnitActionPortrait and getImage for the same usecase)

@tuvus
Copy link
Collaborator Author

tuvus commented Apr 7, 2024

The images still aren't aligning correctly though.

Pictures The escort image isn't showing up correctly like the sleep icon.

EscortImageProblem1

The escort formation image here also isn't set up correctly. Even with my image changes.

EscortImageProblem2

@SomeTroglodyte
Copy link
Collaborator

SomeTroglodyte commented Apr 8, 2024

The images still aren't aligning correctly though.

Now there's a clear problem description... But could be a variety of causes... Adding remote... git fetch... wading through oodles of branches... checkout... Commenting...

  • UnitActionIcons/Stop is the same as UnitActionIcons/StopMove - two copies get atlas-merged anyway but allow a modder to provide distinct images - OK but then "StopFormation" or so would be nicer than just "Stop"
  • Link is 50x50 white on transparent, UnitActionIcons should be 100x100 Black on transparent. 1
  • I forgot the attribution back in Spruced up Civilopedia - phase 4 - Visual candy, Units #4350, so I can't quickly gimp a proper one from source - maybe I kept a copy on the other box...?

But otherwise...
image

Index: core/src/com/unciv/models/UnitAction.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/models/UnitAction.kt b/core/src/com/unciv/models/UnitAction.kt
--- a/core/src/com/unciv/models/UnitAction.kt	(revision 09b97ddb09ce9ddda5241e1af3a2e4ce7f84fe9e)
+++ b/core/src/com/unciv/models/UnitAction.kt	(date 1712561897004)
@@ -15,8 +15,8 @@
  */
 open class UnitAction(
     val type: UnitActionType,
-    /** How often this action is used, a higher value means more often and that it should be on an earlier page. 
-     * 100 is very frequent, 50 is somewhat frequent, less than 25 is press one time for multi-turn movement. 
+    /** How often this action is used, a higher value means more often and that it should be on an earlier page.
+     * 100 is very frequent, 50 is somewhat frequent, less than 25 is press one time for multi-turn movement.
      * A Rare case is > 100 if a button is something like add in capital, promote or something,
      * we need to inform the player that taking the action is an option. */
     val useFrequency: Float,
@@ -105,7 +105,7 @@
     StopEscortFormation("Stop Escort formation",
         { ImageGetter.getUnitActionPortrait("Stop") }, false, defaultPage = 1),
     EscortFormation("Escort formation",
-        { ImageGetter.getImage("OtherIcons/Link") }, false, defaultPage = 1),
+        { ImageGetter.getUnitActionPortrait("Formation") }, false, defaultPage = 1),
     SwapUnits("Swap units",
         { ImageGetter.getUnitActionPortrait("Swap") }, false, defaultPage = 0),
     Automate("Automate",
Index: core/src/com/unciv/ui/components/widgets/UnitGroup.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/ui/components/widgets/UnitGroup.kt b/core/src/com/unciv/ui/components/widgets/UnitGroup.kt
--- a/core/src/com/unciv/ui/components/widgets/UnitGroup.kt	(revision 09b97ddb09ce9ddda5241e1af3a2e4ce7f84fe9e)
+++ b/core/src/com/unciv/ui/components/widgets/UnitGroup.kt	(date 1712561896988)
@@ -177,7 +177,7 @@
     private fun getActionImage(): Image? {
         return when {
             unit.isSleeping() -> ImageGetter.getImage("UnitActionIcons/Sleep")
-            unit.isEscorting() -> ImageGetter.getImage("UnitActionIcons/Link")
+            unit.isEscorting() -> ImageGetter.getImage("UnitActionIcons/Formation")
             unit.isMoving() -> ImageGetter.getImage("UnitActionIcons/MoveTo")
             unit.isExploring() -> ImageGetter.getImage("UnitActionIcons/Explore")
             unit.getTile().improvementInProgress!=null && unit.canBuildImprovement(unit.getTile().getTileImprovementInProgress()!!) ->
diff --git a/android/Images.ConstructionIcons/UnitActionIcons/Formation.png b/android/Images.ConstructionIcons/UnitActionIcons/Formation.png
new file mode 100644
index 0000000000000000000000000000000000000000..7a997a2ff244e0463797a2803579c638ce6f964d
GIT binary patch
literal 2354
zc$@(;3C;G2P)<h;3K|Lk000e1NJLTq003kF003kN1^@s6aN?Cz000R2Nkl<Zc-rlq
zdyG{_8Nh$voO}1py}&+%T@9_udsz^9lrDz0wzeXvY<)C@jgrvt2WeIlqw!4}6O&?8
zOcV)iG(sB_idN&Iw5YT!v~*3RQV?H-LZJf7qgHltm%C^D<Ictn?%qA;+;i@0=S$|l
zb7$tv?|d`!J!Y<Gt+7%#qU;b@AXY383&e^AVu4t(Kr9d|7KjC6#R9Qnfmk3`ERYhA
z*tq)ol$xZqejhL$m;xjK7kCRe1N==yUU6NwKX0AXT9<5TZf*vc3VaUe2Ko&EJxXzb
zw}DQeT|}zaty`DVK9?kjrlux<cLUpjz6=1yD(8W(h)81Fwrv(jkRl>gz?Xo3WdY*m
zauQfwQBk2H?|&(Ua7E-@z)yfXBdFd5ejp-WbX~VEvUeyIAR;mccm|jeaZ{Zl@+sGK
zuUa6Z!)O714K(Gb$^9boao2UPSUV*DFaYk<TJKOwRa+qWhcP4{(ON%NUS1yR7#8i6
zl_iYVf#bjhV;naE3xUZ#>lp;rXsw?fw}xS7XD2`laMtJ6bpUu0nBUyo{D1YvVlfB!
zFmTWewAXrH7m-Qh(hk|Wbt}Mp;0>QJjsuIlv{6=8rhs<fl8^cyX=!O0UqE*5+!+)`
z7tr8)U|=b5&Z|W)A`{0I5Hn5rg>e9=%c9MtK##|^9vU}50<IYcfcg;HUIU~&wD(+N
zV`J$90h)bG9ihU|S`&}QmD$aW)#h~(sm``NRp49OX}~Ycw$!T}1Rl^@_k_`hfq?-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kfS
zYkddMMmovvy`yOApb0j00lyTH=UvymPN_@2zJ#{6HWG=1m{g*<r0>NVx*uz{h*Tz%
zN!h%4b4mX#Q%V1!i(S;MSRfXN6$``yv0{N(u|O;kD;9_aV#NZnK&)6G7KjxK#L5Wr
YUlK3gdDAlqBLDyZ07*qoM6N<$f?|_ZlK=n!

That is a new link from https://www.freeiconspng.com/img/9888 - to be resolved (use and credit this, replace "link.png" - or - find old tnp source and credit it and gimp to Formation.png)

Question remains - why is the image on the Worker with 0 movement ungrayed while the one on the Archer with 1mp is? unit.isIdle() gets actionGroup?.color?.a = opacity * 0.5f - is that intuitive??

Footnotes

  1. Which is your original problem - if you can call it that - nano-misunderstanding perhaps

@SomeTroglodyte
Copy link
Collaborator

  • maybe I kept a copy on the other box

Nope, I've kept an intermediate with better resolution, but no metadata. So should we replace it so we can name a proper credit? I'd prefer thenounproject over freeiconspng - the latter explicitly says for personal use only. Any votes? Should be a relatively thick one, so maybe this one rotated, maybe the ring-overlap gaps widened? Or - I supply a 100x100 black gimped from my intermediate and we ignore the credits problem for now:
Formation

@tuvus
Copy link
Collaborator Author

tuvus commented Apr 12, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants