Formatting Icons (#10359)

* formatIcons

* Smarter end check

I think it's smarter?

* unecessary

* oop

* Update UI.java

* Just don't check for adjacent colons.

The hasUnicodeStr already checks for validity

* Copy from I18NBundle

* Revert "Copy from I18NBundle"

This reverts commit ac660fcd9f.

* If get and format refer to parent, then just set the existing bundle as parent

* Test with Ground Zero objectives

* Update MBundle.java

* That didn't work

* Slip the method into reasonable places like objectives and chat

* Check for Icons as well

* More testing with objective text

* Apply to hints

* Optimized formatIcons

No longer scans through every character

* TIME UPDATE THE BUNDLES YIPPEEEEEEEEEEE

* residual

* Apply to message blocks

* IntelliJ lied

* Suggestions

* Format before sending
This commit is contained in:
MEEPofFaith 2025-02-08 21:05:43 -08:00 committed by GitHub
parent aaf335d06c
commit e8a4ecc61e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 984 additions and 939 deletions

View file

@ -11,6 +11,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.core.*;
import mindustry.ctype.*;
import mindustry.game.MapObjectives.*;
import mindustry.gen.*;
@ -661,17 +662,19 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
if(text.startsWith("@")){
String key = text.substring(1);
String out;
if(mobile){
return state.mapLocales.containsProperty(key + ".mobile") ?
state.mapLocales.getProperty(key + ".mobile") :
Core.bundle.get(key + ".mobile", Core.bundle.get(key));
out = state.mapLocales.containsProperty(key + ".mobile") ?
state.mapLocales.getProperty(key + ".mobile") :
Core.bundle.get(key + ".mobile", Core.bundle.get(key));
}else{
return state.mapLocales.containsProperty(key) ?
state.mapLocales.getProperty(key) :
Core.bundle.get(key);
out = state.mapLocales.containsProperty(key) ?
state.mapLocales.getProperty(key) :
Core.bundle.get(key);
}
return UI.formatIcons(out);
}else{
return text;
return UI.formatIcons(text);
}
}
}