mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-20 23:47:16 -05:00
default done loading after OnLoad finishes (#447)
This commit is contained in:
parent
44ca39ce36
commit
bed386be87
@ -73,7 +73,10 @@ func Advance(elapsed float64) error {
|
||||
d2gui.ShowLoadScreen(0)
|
||||
d2gui.HideCursor()
|
||||
singleton.loadingState = LoadingState{updates: make(chan loadingUpdate)}
|
||||
go handler.OnLoad(singleton.loadingState)
|
||||
go func() {
|
||||
handler.OnLoad(singleton.loadingState)
|
||||
singleton.loadingState.Done()
|
||||
}()
|
||||
singleton.currentScreen = nil
|
||||
singleton.loadingScreen = singleton.nextScreen
|
||||
} else {
|
||||
|
@ -23,6 +23,4 @@ func (v *BlizzardIntro) OnLoad(loading d2screen.LoadingState) {
|
||||
loading.Progress(0.5)
|
||||
|
||||
v.videoDecoder = d2video.CreateBinkDecoder(videoBytes)
|
||||
loading.Done()
|
||||
return
|
||||
}
|
||||
|
@ -141,8 +141,6 @@ func (v *CharacterSelect) OnLoad(loading d2screen.LoadingState) {
|
||||
v.characterExpLabel[i].SetPosition(xOffset, 130+((i/2)*95))
|
||||
}
|
||||
v.refreshGameStates()
|
||||
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (v *CharacterSelect) onScrollUpdate() {
|
||||
|
@ -91,7 +91,6 @@ func (v *Credits) OnLoad(loading d2screen.LoadingState) {
|
||||
loading.Progress(0.8)
|
||||
|
||||
v.creditsText = append(v.LoadContributors(), v.creditsText...)
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
// Render renders the credits screen
|
||||
|
@ -44,7 +44,6 @@ func CreateGame(gameClient *d2client.GameClient) *Game {
|
||||
|
||||
func (v *Game) OnLoad(loading d2screen.LoadingState) {
|
||||
d2audio.PlayBGM("")
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (v *Game) OnUnload() error {
|
||||
|
@ -40,8 +40,6 @@ func (g *GuiTestMain) OnLoad(loading d2screen.LoadingState) {
|
||||
|
||||
layout.SetVerticalAlign(d2gui.VerticalAlignMiddle)
|
||||
d2gui.SetLayout(layout)
|
||||
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (g *GuiTestMain) Render(screen d2render.Surface) error {
|
||||
|
@ -249,8 +249,6 @@ func (v *MainMenu) OnLoad(loading d2screen.LoadingState) {
|
||||
}
|
||||
|
||||
d2input.BindHandler(v)
|
||||
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (v *MainMenu) onMapTestClicked() {
|
||||
|
@ -151,8 +151,6 @@ func (met *MapEngineTest) OnLoad(loading d2screen.LoadingState) {
|
||||
met.mapRenderer = d2maprenderer.CreateMapRenderer(met.mapEngine)
|
||||
loading.Progress(0.7)
|
||||
met.LoadRegionByIndex(met.currentRegion, met.levelPreset, met.fileIndex)
|
||||
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (met *MapEngineTest) OnUnload() error {
|
||||
|
@ -417,8 +417,6 @@ func (v *SelectHeroClass) OnLoad(loading d2screen.LoadingState) {
|
||||
v.heroRenderInfo[d2enum.HeroDruid].BackWalkSprite.PlayForward()
|
||||
v.heroRenderInfo[d2enum.HeroDruid].BackWalkSprite.SetPlayLengthMs(1500)
|
||||
v.heroRenderInfo[d2enum.HeroDruid].BackWalkSprite.SetPlayLoop(false)
|
||||
|
||||
loading.Done()
|
||||
}
|
||||
|
||||
func (v *SelectHeroClass) OnUnload() error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user