Пример #1
0
def DonePress():
    global HairColor, SkinColor, MajorColor, MinorColor
    global PickedColor

    GUIRECCommon.CloseSubSubCustomizeWindow()
    PickedColor = ColorTable.GetValue(ColorIndex, GemRB.GetVar("Selected"))
    if ColorIndex == 0:
        HairColor = PickedColor
        UpdatePaperDoll()
        return
    if ColorIndex == 1:
        SkinColor = PickedColor
        UpdatePaperDoll()
        return
    if ColorIndex == 2:
        MinorColor = PickedColor
        UpdatePaperDoll()
        return

    MajorColor = PickedColor
    UpdatePaperDoll()
    return
Пример #2
0
def OpenRecordsWindow():
    import GUICommonWindows

    global RecordsWindow, OptionsWindow, PortraitWindow, PauseState
    global OldPortraitWindow, OldOptionsWindow

    if GUICommon.CloseOtherWindow(OpenRecordsWindow):
        if InformationWindow: OpenInformationWindow()

        GUIRECCommon.CloseSubSubCustomizeWindow()
        GUIRECCommon.CloseSubCustomizeWindow()
        GUIRECCommon.CloseCustomizeWindow()
        GUIRECCommon.ExportCancelPress()
        GUIRECCommon.CloseBiographyWindow()
        KitDonePress()
        CloseInformationWindow()

        if RecordsWindow:
            RecordsWindow.Unload()
        if OptionsWindow:
            OptionsWindow.Unload()
        if PortraitWindow:
            PortraitWindow.Unload()

        RecordsWindow = None
        GemRB.SetVar("OtherWindow", -1)
        GUICommon.GameWindow.SetVisible(WINDOW_VISIBLE)
        GemRB.UnhideGUI()
        GUICommonWindows.PortraitWindow = OldPortraitWindow
        OldPortraitWindow = None
        GUICommonWindows.UpdatePortraitWindow()
        GUICommonWindows.OptionsWindow = OldOptionsWindow
        OldOptionsWindow = None
        GUICommonWindows.SetSelectionChangeHandler(None)
        GemRB.GamePause(PauseState, 3)
        return

    PauseState = GemRB.GamePause(3, 1)
    GemRB.GamePause(1, 3)

    GemRB.HideGUI()
    GUICommon.GameWindow.SetVisible(WINDOW_INVISIBLE)

    GemRB.LoadWindowPack("GUIREC", 640, 480)
    RecordsWindow = Window = GemRB.LoadWindow(2)
    GemRB.SetVar("OtherWindow", RecordsWindow.ID)
    # saving the original portrait window
    OldOptionsWindow = GUICommonWindows.OptionsWindow
    OptionsWindow = GemRB.LoadWindow(0)
    GUICommonWindows.SetupMenuWindowControls(OptionsWindow, 0,
                                             OpenRecordsWindow)
    GUICommonWindows.MarkMenuButton(OptionsWindow)
    OptionsWindow.SetFrame()
    OldPortraitWindow = GUICommonWindows.PortraitWindow
    PortraitWindow = GUICommonWindows.OpenPortraitWindow(0)

    # dual class
    Button = Window.GetControl(0)
    Button.SetText(7174)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, DualClass.DualClassWindow)

    # levelup
    Button = Window.GetControl(37)
    Button.SetText(7175)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, LevelUp.OpenLevelUpWindow)

    # information
    Button = Window.GetControl(1)
    Button.SetText(11946)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenInformationWindow)

    # reform party
    Button = Window.GetControl(51)
    Button.SetText(16559)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenRecReformPartyWindow)

    # customize
    Button = Window.GetControl(50)
    Button.SetText(10645)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, GUIRECCommon.OpenCustomizeWindow)

    # export
    Button = Window.GetControl(36)
    Button.SetText(13956)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, GUIRECCommon.OpenExportWindow)

    # kit info
    if GameCheck.IsBG2():
        Button = Window.GetControl(52)
        Button.SetText(61265)
        Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenKitInfoWindow)

    # create a button so we can map it do ESC for quit exiting
    Button = Window.CreateButton(99, 0, 0, 1, 1)
    Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenRecordsWindow)
    Button.SetFlags(IE_GUI_BUTTON_CANCEL, OP_OR)

    GUICommonWindows.SetSelectionChangeHandler(UpdateRecordsWindow)
    UpdateRecordsWindow()

    Window.SetKeyPressEvent(GUICommonWindows.SwitchPCByKey)

    OptionsWindow.SetVisible(WINDOW_VISIBLE)
    Window.SetVisible(WINDOW_VISIBLE)
    PortraitWindow.SetVisible(WINDOW_VISIBLE)
    return