Skip to content

Commit

Permalink
🐛 refresh locales on first session before start
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Nov 28, 2024
1 parent c0b7692 commit ea7eb84
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/audioware/reds/Codeware.reds
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ public class LocalizationPackage extends ModLocalizationPackage {
}

public class LocalizationProvider extends ModLocalizationProvider {
protected func OnAttach() {
super.OnAttach();
GameInstance.GetCallbackSystem()
.RegisterCallback(n"Session/BeforeStart", this, n"OnSessionBeforeStart", false)
.SetRunMode(CallbackRunMode.Once);
}
private cb func OnSessionBeforeStart(event: ref<GameSessionEvent>) {
this.OnLocaleChange();
}
public func OnLocaleChange() {
let system = LocalizationSystem.GetInstance(this.GetGameInstance());
let spoken = system.GetVoiceLanguage();
Expand Down

0 comments on commit ea7eb84

Please sign in to comment.