viddie / ConsistencyTrackerMod

A mod to track your progress while grinding goldens in Celeste! GameBanana page: https://gamebanana.com/mods/358978
11 stars 9 forks source link

Extract Mod Setting Dialogs #93

Closed ZTL-UwU closed 1 year ago

ZTL-UwU commented 1 year ago

9

ZTL-UwU commented 1 year ago

Hi viddie! All the dialogs in settings have been extracted :D We have a few people in the Chinese community working on the Chinese translation now, which will be in an another PR after it's done. we love your mod! Also, do you have any idea on how to localize format.txts and the web overlays? I'm going to try to work on it after this. Thank you!

viddie commented 1 year ago

OMG i completely missed this. didnt get notified for some reason... @ZTL-UwU

awesome! sadly you caught me 1 day before going on vacation, so i wont get to check this until after im back, but from what i could tell looking over it very quickly, it looks good!

the placeholder explanations can be localized by modifying the GetPlaceholderExplanation method in the Stats classes:

https://github.com/viddie/ConsistencyTrackerMod/blob/ab63ff7ac865c37ea9a422e2b22983c48b74a5db/Stats/BasicInfoStat.cs#L141

i have absolutely no clue on how to localize the web tools easily. theoretically one could create a new DebugRC endpoint that provides all of the localization strings and have all the web tools fetch that endpoint to get the localizations and display them from there, but thats quite a lot of effort.

ZTL-UwU commented 1 year ago

I've ran into some trouble regarding the Stat classes. Unfortunately the Dialog class seems to load after the mod is loaded. Therefore, when the StatManager is being initialized, one can't access the Dialogs.

I guess we just merge this mod settings pr first and try to figure out some other ways to localize it. @viddie

viddie commented 1 year ago

I've ran into some trouble regarding the Stat classes. Unfortunately the Dialog class seems to load after the mod is loaded. Therefore, when the StatManager is being initialized, one can't access the Dialogs.

I'm not sure, but you might be able to access the Dialogs in the StatManager initialization by moving the StatsManager = new StatManager(); from EverestModule.Load() to EverestModule.Initialize(). I have not tested if that works, but it could maybe do

ZTL-UwU commented 1 year ago

I'm not sure, but you might be able to access the Dialogs in the StatManager initialization by moving the StatsManager = new StatManager(); from EverestModule.Load() to EverestModule.Initialize(). I have not tested if that works, but it could maybe do

emmm... it doesn't seem to work

Celeste Error Log
==========================================

Ver 1.4.0.0-xna [Everest: 4157-azure-257ea]
09/02/2023 13:11:48
System.NullReferenceException: Object reference not set to an instance of an object.
   at Celeste.Dialog.Clean(String name, Language language) in /home/vsts/work/1/s/Celeste.Mod.mm/Patches/Dialog.cs:line 209
   at Celeste.Mod.ConsistencyTracker.Stats.AverageLastRunsStat.GetDefaultFormats() in D:\SteamLibrary\steamapps\common\Celeste\Mods\cct\Stats\AverageLastRunsStat.cs:line 337
   at Celeste.Mod.ConsistencyTracker.Stats.StatManager.CreateDefaultFormatsObject() in D:\SteamLibrary\steamapps\common\Celeste\Mods\cct\Stats\StatManager.cs:line 446
   at Celeste.Mod.ConsistencyTracker.Stats.StatManager.LoadFormats() in D:\SteamLibrary\steamapps\common\Celeste\Mods\cct\Stats\StatManager.cs:line 79
   at Celeste.Mod.ConsistencyTracker.Stats.StatManager..ctor() in D:\SteamLibrary\steamapps\common\Celeste\Mods\cct\Stats\StatManager.cs:line 63
   at Celeste.Mod.ConsistencyTracker.ConsistencyTrackerModule.Initialize() in D:\SteamLibrary\steamapps\common\Celeste\Mods\cct\ConsistencyTracker.cs:line 276
   at Celeste.Mod.Everest.Initialize() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Everest/Everest.cs:line 528
   at Celeste.Celeste.Initialize() in /home/vsts/work/1/s/Celeste.Mod.mm/Patches/Celeste.cs:line 271
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at Monocle.Engine.RunWithLogging() in /home/vsts/work/1/s/Celeste.Mod.mm/Patches/Monocle/Engine.cs:line 41
viddie commented 1 year ago

image

uhhh this might work, havent tested tho

ZTL-UwU commented 1 year ago

image

uhhh this might work, havent tested tho

yes, it works! thx

viddie commented 1 year ago

finally got around to test this, and it seems to work nicely!

if you could rename private void CreateStatsManager to private void MainMenu_OnCreateButtons in order to keep with how i have already written all the events, i would be ready to merge this 👍

ZTL-UwU commented 1 year ago

well there are a few stat classes not extrcted yet. I'll do it later on and leave a comment when it's done.

ZTL-UwU commented 1 year ago

okay now it's done :) @viddie

viddie commented 1 year ago

awesome, looks good. i'll test this later today against a few changes i've done locally and then merge if its all good 👍