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
31 changed files with 984 additions and 939 deletions

View File

@@ -12,6 +12,7 @@ import arc.scene.ui.layout.*;
import arc.util.*;
import arc.util.io.*;
import arc.util.pooling.*;
import mindustry.core.*;
import mindustry.gen.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
@@ -79,7 +80,7 @@ public class MessageBlock extends Block{
font.getData().setScale(1 / 4f / Scl.scl(1f));
font.setUseIntegerPositions(false);
CharSequence text = message == null || message.length() == 0 ? "[lightgray]" + Core.bundle.get("empty") : message;
String text = message == null || message.length() == 0 ? "[lightgray]" + Core.bundle.get("empty") : UI.formatIcons(message.toString());
l.setText(font, text, Color.white, 90f, Align.left, true);
float offset = 1f;