private void AddCloseHandler(MyGuiScreenBase previousScreen, MyGuiScreenLogo logoScreen, Action afterLogosAction) { previousScreen.Closed += (screen) => { if (!screen.Cancelled) { AddScreen(logoScreen); } else { afterLogosAction(); } }; }
public void BackToIntroLogos(Action afterLogosAction) { MyScreenManager.CloseAllScreensNowExcept(null); string[] logos = new string[] { //"Textures\\Logo\\keen_swh", //"Textures\\Logo\\game", //"Textures\\Logo\\vrage", }; MyGuiScreenBase previousScreen = null; foreach (var logo in logos) { var logoScreen = new MyGuiScreenLogo(logo); if (previousScreen != null) { AddCloseHandler(previousScreen, logoScreen, afterLogosAction); } else { AddScreen(logoScreen); } previousScreen = logoScreen; } if (previousScreen != null) { previousScreen.Closed += (screen) => afterLogosAction(); } else { afterLogosAction(); } }
private void AddCloseHandler(MyGuiScreenBase previousScreen, MyGuiScreenLogo logoScreen, Action afterLogosAction) { previousScreen.Closed += (screen) => { if (!screen.Cancelled) AddScreen(logoScreen); else afterLogosAction(); }; }
public void BackToIntroLogos(Action afterLogosAction) { MyScreenManager.CloseAllScreensNowExcept(null); string[] logos = new string[] { //"Textures\\Logo\\keen_swh", //"Textures\\Logo\\game", //"Textures\\Logo\\vrage", }; MyGuiScreenBase previousScreen = null; foreach (var logo in logos) { var logoScreen = new MyGuiScreenLogo(logo); if (previousScreen != null) AddCloseHandler(previousScreen, logoScreen, afterLogosAction); else AddScreen(logoScreen); previousScreen = logoScreen; } if (previousScreen != null) previousScreen.Closed += (screen) => afterLogosAction(); else afterLogosAction(); }