pacas00 / ModdersGearbox

A Fortresscraft Evolved Modding Library.
MIT License
1 stars 0 forks source link

Better Loading Screen Handling #9

Closed pacas00 closed 5 years ago

pacas00 commented 5 years ago

Need to handle loading better,

Currently, we block everything including UI updates.

Proposed new handling,

Postfix on someones .ctor

Prefix on someones UnityUpdate()

Our Update Method

pacas00 commented 5 years ago

New Plan,

Prefix ModManager.HandleActivation

if (WorldLoadState.State != WorldLoadStateEnum.LoadModUnityData) leave prefix

if (WorldLoadState.State == WorldLoadStateEnum.LoadModUnityData) then

Check if we are ready, if not, call our own update method for loading and return If we are ready, then leave prefix allowing normal execution

pacas00 commented 5 years ago

Prefix LoadingControl.Update

if (WorldLoadState.State != WorldLoadStateEnum.LoadModUnityData) leave prefix

if (WorldLoadState.State == WorldLoadStateEnum.LoadModUnityData) then

this.LoadingLabel.text = PersistentSettings.GetString("Game_Loading") + "[" + text + "]";

pacas00 commented 5 years ago

Thinking about this, We cannot patch a method we are running.

Not happening any time soon.

pacas00 commented 5 years ago

Closing this until i think of another way to do this.

ph3rr3t commented 5 years ago

Can't set it up as one of those; "Must restart program to apply setting change," options you see in plenty of other programs, games, etc?