tyfon7 / UIFixes

Small QOL fixes for SPTarkov
MIT License
8 stars 1 forks source link

Use localized strings #8

Open reysonk opened 1 month ago

reysonk commented 1 month ago

The idea is to use global values for button names instead of hardcode

.\SPT\Aki_Data\Server\database\locales\global
12446    "Back": "BACK",
12446   "Back": "НАЗАД",
....and etc
eng
                if (Settings.EnableFleaHistory.Value && PreviousButton == null)
                {
                    var addOfferLayout = ____addOfferButton.GetComponent<LayoutElement>();
                    PreviousButton = UnityEngine.Object.Instantiate(____addOfferButton, ____addOfferButton.transform.parent, false);
                    PreviousButton.transform.SetAsFirstSibling();
                    PreviousButton.SetRawText("< BACK", 20);

Otherwise, I have to rebuild the mod from the source, to rename the button, every time :)

RU
                if (Settings.EnableFleaHistory.Value && PreviousButton == null)
                {
                    var addOfferLayout = ____addOfferButton.GetComponent<LayoutElement>();
                    PreviousButton = UnityEngine.Object.Instantiate(____addOfferButton, ____addOfferButton.transform.parent, false);
                    PreviousButton.transform.SetAsFirstSibling();
                    PreviousButton.SetRawText("< НАЗАД", 20);
tyfon7 commented 1 month ago

Good call. Now I'm searching through trying to find something to replace "SHOW MOD STATS" and "HIDE MOD STATS" with...

tyfon7 commented 1 month ago

I've been unable to find a good replacement for the show/hide mods stats button text, but leaving this open aspirationally.