def QuickLoadPressed(): QuickLoadSlot = GetQuickLoadSlot() if QuickLoadSlot != None: LoadScreen.StartLoadScreen() GemRB.LoadGame(QuickLoadSlot) GemRB.EnterGame() return
def QuickLoadPress(): global StartWindow, QuickLoadSlot LoadScreen.StartLoadScreen() GemRB.LoadGame(QuickLoadSlot) # load & start game GemRB.EnterGame() return
def LoadGamePress(): if LoadWindow: LoadWindow.Close() Pos = GemRB.GetVar("TopIndex") + GemRB.GetVar("LoadIdx") LoadScreen.StartLoadScreen() GemRB.LoadGame(Games[Pos]) # load & start game GemRB.EnterGame() return
def LoadGamePress (): if LoadWindow: LoadWindow.Unload () Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") LoadScreen.StartLoadScreen() GemRB.LoadGame(Games[Pos]) #loads and enters savegame GemRB.EnterGame () return
def LoadGamePress(): if LoadWindow: LoadWindow.Unload() Pos = GemRB.GetVar("TopIndex") + GemRB.GetVar("LoadIdx") LoadScreen.StartLoadScreen() GemRB.LoadGame(Games[Pos]) #loads and enters savegame GemRB.SetNextScript("PartyFormation") return
def LoadGamePress(btn): if LoadWindow: LoadWindow.Close() Pos = GemRB.GetVar("TopIndex") + btn.Value LoadScreen.StartLoadScreen() GemRB.LoadGame(Games[Pos]) #loads and enters savegame GemRB.EnterGame() return
def LoadGamePress(): if LoadWindow: LoadWindow.Unload() Pos = GemRB.GetVar("TopIndex") + GemRB.GetVar("LoadIdx") LoadScreen.StartLoadScreen() #loads savegame GemRB.LoadGame(Games[Pos]) #enters game GemRB.EnterGame() #it will close windows, including the loadscreen return
def LoadGamePress (): if LoadWindow: LoadWindow.Unload () Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") LoadScreen.StartLoadScreen() #loads savegame GemRB.LoadGame (Games[Pos]) #enters game if GameCheck.IsIWD1(): GemRB.SetNextScript ("PartyFormation") else: # it will close windows, including the loadscreen GemRB.EnterGame () return
def LoadGamePress(btn, val): if GemRB.GetView( "GC"): # FIXME: is this the best way to know if we are ingame? OpenLoadMsgWindow(btn, val) return Pos = GemRB.GetVar("TopIndex") + val LoadScreen.StartLoadScreen() #loads savegame GemRB.LoadGame(Games[Pos]) #enters game if GameCheck.IsIWD1(): GemRB.SetNextScript("PartyFormation") else: # it will close windows, including the loadscreen GemRB.EnterGame() return
def ConfirmedSaveGame(): Window = SaveDetailWindow Pos = GemRB.GetVar("TopIndex") + GemRB.GetVar("SaveIdx") Label = Window.GetControl(1) Slotname = Label.QueryText() # Empty save name. We can get here if user presses Enter key if Slotname == "": return # We have to close floating window first OpenSaveDetailWindow() LoadScreen.StartLoadScreen(LoadScreen.LS_TYPE_SAVING) CloseSaveWindow() if Pos < len(Games): GemRB.SaveGame(Games[Pos], Slotname) else: GemRB.SaveGame(None, Slotname)
def OnLoad(): global PartyFormationWindow GUICommonWindows.PortraitWindow = None GUICommonWindows.SelectionChangeHandler = None GemRB.LoadWindowPack("GUISP", 640, 480) PartyFormationWindow = GemRB.LoadWindow(0) PartyFormationWindow.SetFrame() ModifyCharsButton = PartyFormationWindow.GetControl(43) ModifyCharsButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, None) #TODO: ModifyPress ModifyCharsButton.SetStatus(IE_GUI_BUTTON_DISABLED) ModifyCharsButton.SetText(18816) ExitButton = PartyFormationWindow.GetControl(30) ExitButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, ExitPress) ExitButton.SetStatus(IE_GUI_BUTTON_ENABLED) ExitButton.SetText(13906) ExitButton.SetFlags(IE_GUI_BUTTON_CANCEL, OP_OR) DoneButton = PartyFormationWindow.GetControl(28) DoneButton.SetText(11973) Portraits = 0 for i in range(18, 24): Label = PartyFormationWindow.GetControl(0x10000012 + i) #removing this label, it just disturbs us Label.SetSize(0, 0) Button = PartyFormationWindow.GetControl(i - 12) ResRef = GemRB.GetPlayerPortrait(i - 17, 1) if ResRef == "": Button.SetFlags(IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetPicture(ResRef) Button.SetFlags(IE_GUI_BUTTON_PICTURE, OP_OR) Portraits = Portraits + 1 Button.SetState(IE_GUI_BUTTON_LOCKED) CreateCharButton = PartyFormationWindow.GetControl(i) CreateCharButton.SetVarAssoc("Slot", i - 17) CreateCharButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, CreateCharPress) CreateCharButton.SetStatus(IE_GUI_BUTTON_ENABLED) CreateCharButton.SetFont("NORMAL") if ResRef == "": CreateCharButton.SetText(10264) else: CreateCharButton.SetText(GemRB.GetPlayerName(i - 17, 0)) if Portraits == 0: DoneButton.SetState(IE_GUI_BUTTON_DISABLED) else: DoneButton.SetState(IE_GUI_BUTTON_ENABLED) DoneButton.SetFlags(IE_GUI_BUTTON_DEFAULT, OP_OR) DoneButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, EnterGamePress) if not GUICommon.HasHOW(): GemRB.SetVar("SaveDir", 1) #using mpsave?? GemRB.SetVar("PlayMode", 0) #using second row?? else: GemRB.SetGlobal("EXPANSION_DOOR", "GLOBAL", 1) # entrance to the HOW start if GUICommon.HasTOTL(): GemRB.SetGlobal("9101_SPAWN_HOBART", "GLOBAL", 1) if GemRB.GetVar("ExpansionGame") == 1: GemRB.SetGlobal("CHAPTER", "GLOBAL", 1) GemRB.SetVar("SaveDir", 1) #using mpsave GemRB.SetVar("PlayMode", 2) #using second row else: GemRB.SetVar("SaveDir", 1) #using mpsave GemRB.SetVar("PlayMode", 0) #using first row LoadScreen.CloseLoadScreen() PartyFormationWindow.SetVisible(WINDOW_VISIBLE) return