Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 117276 Details for
Bug 158336
GemRB: Infinity Engine Emulator (new package)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix saving in 0.2.8
0.2.8-save_fix.patch (text/plain), 41.82 KB, created by
Nick White
on 2007-04-25 23:09:24 UTC
(
hide
)
Description:
Patch to fix saving in 0.2.8
Filename:
MIME Type:
Creator:
Nick White
Created:
2007-04-25 23:09:24 UTC
Size:
41.82 KB
patch
obsolete
>Index: gemrb/GUIScripts/iwd/GUISAVE.py >=================================================================== >--- gemrb/GUIScripts/iwd/GUISAVE.py (revision 0) >+++ gemrb/GUIScripts/iwd/GUISAVE.py (revision 4246) >@@ -0,0 +1,239 @@ >+#load window >+import GemRB >+from LoadScreen import * >+from GUICommon import CloseOtherWindow >+ >+SaveWindow = 0 >+ConfirmWindow = 0 >+NameField = 0 >+SaveButton = 0 >+TextAreaControl = 0 >+GameCount = 0 >+ScrollBar = 0 >+ >+def OpenSaveWindow (): >+ global SaveWindow, TextAreaControl, GameCount, ScrollBar >+ >+ if CloseOtherWindow (OpenSaveWindow): >+ CloseSaveWindow () >+ return >+ >+ GemRB.HideGUI () >+ GemRB.SetVisible (0,0) >+ >+ GemRB.LoadWindowPack ("GUISAVE", 640, 480) >+ Window = SaveWindow = GemRB.LoadWindow (0) >+ GemRB.SetWindowFrame (Window) >+ CancelButton=GemRB.GetControl (Window,34) >+ GemRB.SetText (Window, CancelButton, 13727) >+ GemRB.SetEvent (Window,CancelButton,IE_GUI_BUTTON_ON_PRESS, "OpenSaveWindow") >+ GemRB.SetVar ("LoadIdx",0) >+ >+ for i in range(4): >+ Button = GemRB.GetControl (Window,26+i) >+ GemRB.SetText (Window, Button, 15588) >+ GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SavePress") >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) >+ >+ Button = GemRB.GetControl (Window, 30+i) >+ GemRB.SetText (Window, Button, 13957) >+ GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DeleteGamePress") >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) >+ >+ #area previews >+ Button = GemRB.GetControl (Window, 1+i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) >+ >+ #PC portraits >+ for j in range(PARTY_SIZE): >+ Button = GemRB.GetControl (Window,40+i*PARTY_SIZE+j) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) >+ >+ ScrollBar=GemRB.GetControl (Window, 25) >+ GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "ScrollBarPress") >+ GameCount=GemRB.GetSaveGameCount ()+1 #one more for the 'new game' >+ if GameCount>4: >+ TopIndex = GameCount-4 >+ else: >+ TopIndex = 0 >+ GemRB.SetVar ("TopIndex",TopIndex) >+ GemRB.SetVarAssoc (Window, ScrollBar, "TopIndex", TopIndex+1) >+ ScrollBarPress () >+ GemRB.SetVisible (Window,1) >+ return >+ >+def ScrollBarPress(): >+ Window = SaveWindow >+ >+ #draw load game portraits >+ Pos = GemRB.GetVar ("TopIndex") >+ for i in range(4): >+ ActPos = Pos + i >+ >+ Button1 = GemRB.GetControl (Window,26+i) >+ Button2 = GemRB.GetControl (Window, 30+i) >+ if ActPos<GameCount: >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_ENABLED) >+ else: >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_DISABLED) >+ >+ if ActPos<GameCount-1: >+ Slotname = GemRB.GetSaveGameAttrib (0,ActPos) >+ elif ActPos == GameCount-1: >+ Slotname = 15304 >+ else: >+ Slotname = "" >+ Label = GemRB.GetControl (Window, 0x10000008+i) >+ GemRB.SetText (Window, Label, Slotname) >+ >+ if ActPos<GameCount-1: >+ Slotname = GemRB.GetSaveGameAttrib (4,ActPos) >+ else: >+ Slotname = "" >+ Label = GemRB.GetControl (Window, 0x10000010+i) >+ GemRB.SetText (Window, Label, Slotname) >+ >+ Button=GemRB.GetControl (Window, 1+i) >+ if ActPos<GameCount-1: >+ GemRB.SetSaveGamePreview(Window, Button, ActPos) >+ else: >+ GemRB.SetButtonPicture(Window, Button, "") >+ for j in range(PARTY_SIZE): >+ Button=GemRB.GetControl (Window, 40+i*PARTY_SIZE+j) >+ if ActPos<GameCount-1: >+ GemRB.SetSaveGamePortrait(Window, Button, ActPos,j) >+ else: >+ GemRB.SetButtonPicture(Window, Button, "") >+ return >+ >+def AbortedSaveGame(): >+ GemRB.UnloadWindow (ConfirmWindow) >+ GemRB.SetVisible (SaveWindow,1) >+ return >+ >+def ConfirmedSaveGame(): >+ global ConfirmWindow >+ >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") >+ Label = GemRB.GetControl (ConfirmWindow, 3) >+ Slotname = GemRB.QueryText (ConfirmWindow, Label) >+ StartLoadScreen() >+ GemRB.SaveGame(Pos, Slotname) #loads and enters savegame >+ GemRB.UnloadWindow (ConfirmWindow) >+ #CloseSaveWindow () >+ GemRB.SetVisible (SaveWindow,1) >+ return >+ >+def SavePress(): >+ global ConfirmWindow, NameField, SaveButton >+ >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") >+ ConfirmWindow = GemRB.LoadWindow (1) >+ >+ #slot name >+ if Pos<GameCount-1: >+ Slotname = GemRB.GetSaveGameAttrib (0,Pos) >+ else: >+ Slotname = "" >+ NameField = GemRB.GetControl (ConfirmWindow, 3) >+ GemRB.SetText (ConfirmWindow, NameField, Slotname) >+ GemRB.SetEvent (ConfirmWindow, NameField, IE_GUI_EDIT_ON_CHANGE,"EditChange") >+ >+ #game hours (should be generated from game) >+ if Pos<GameCount-1: >+ Slotname = GemRB.GetSaveGameAttrib (4,Pos) >+ else: >+ Slotname = "" >+ Label = GemRB.GetControl (ConfirmWindow, 0x10000004) >+ GemRB.SetText (ConfirmWindow, Label, Slotname) >+ >+ #areapreview >+ Button=GemRB.GetControl (ConfirmWindow, 0) >+ if Pos<GameCount-1: >+ GemRB.SetSaveGamePreview(ConfirmWindow, Button, Pos) >+ else: >+ GemRB.SetButtonPicture(ConfirmWindow, Button, "") >+ >+ #portraits >+ for j in range(PARTY_SIZE): >+ Button=GemRB.GetControl (ConfirmWindow, 40+j) >+ if Pos<GameCount-1: >+ GemRB.SetSaveGamePortrait(ConfirmWindow, Button, Pos,j) >+ else: >+ GemRB.SetButtonPicture(ConfirmWindow, Button, "") >+ >+ #save >+ SaveButton=GemRB.GetControl (ConfirmWindow, 7) >+ GemRB.SetText (ConfirmWindow, SaveButton, 15588) >+ GemRB.SetEvent (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ON_PRESS, "ConfirmedSaveGame") >+ GemRB.SetButtonFlags (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DEFAULT, OP_OR) >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ >+ #cancel >+ CancelButton=GemRB.GetControl (ConfirmWindow, 8) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) >+ GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "AbortedSaveGame") >+ GemRB.SetVisible (ConfirmWindow,1) >+ GemRB.SetControlStatus (ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) >+ return >+ >+def EditChange(): >+ Name = GemRB.QueryText (ConfirmWindow, NameField) >+ if len(Name)==0: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ else: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ENABLED) >+ return >+ >+def DeleteGameConfirm(): >+ global GameCount >+ >+ TopIndex = GemRB.GetVar ("TopIndex") >+ Pos = TopIndex +GemRB.GetVar ("LoadIdx") >+ GemRB.DeleteSaveGame(Pos) >+ if TopIndex>0: >+ GemRB.SetVar ("TopIndex",TopIndex-1) >+ GameCount=GemRB.GetSaveGameCount () #count of games in save folder? >+ GemRB.SetVarAssoc (SaveWindow, ScrollBar, "TopIndex", GameCount) >+ ScrollBarPress() >+ GemRB.UnloadWindow (ConfirmWindow) >+ GemRB.SetVisible (SaveWindow,1) >+ return >+ >+def DeleteGameCancel(): >+ GemRB.UnloadWindow (ConfirmWindow) >+ GemRB.SetVisible (SaveWindow,1) >+ return >+ >+def DeleteGamePress(): >+ global ConfirmWindow >+ >+ GemRB.SetVisible (SaveWindow, 0) >+ ConfirmWindow=GemRB.LoadWindow (2) >+ Text=GemRB.GetControl (ConfirmWindow, 0) >+ GemRB.SetText (ConfirmWindow, Text, 15305) >+ DeleteButton=GemRB.GetControl (ConfirmWindow, 1) >+ GemRB.SetText (ConfirmWindow, DeleteButton, 13957) >+ GemRB.SetEvent (ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") >+ CancelButton=GemRB.GetControl (ConfirmWindow, 2) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) >+ GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") >+ GemRB.SetVisible (ConfirmWindow,1) >+ return >+ >+def CloseSaveWindow (): >+ GemRB.UnloadWindow (SaveWindow) >+ if GemRB.GetVar ("QuitAfterSave"): >+ GemRB.QuitGame () >+ GemRB.SetNextScript ("Start") >+ return >+ >+ GemRB.SetVisible (0,1) #enabling the game control screen >+ GemRB.UnhideGUI () #enabling the other windows >+ return > >Property changes on: gemrb/GUIScripts/iwd/GUISAVE.py >___________________________________________________________________ >Name: svn:eol-style > + native >Name: svn:mime-type > + text/plain > >Index: gemrb/GUIScripts/tob/GUISAVE.py >=================================================================== >--- gemrb/GUIScripts/tob/GUISAVE.py (revision 4224) >+++ gemrb/GUIScripts/tob/GUISAVE.py (revision 4246) >@@ -5,6 +5,8 @@ > > SaveWindow = 0 > ConfirmWindow = 0 >+NameField = 0 >+SaveButton = 0 > TextAreaControl = 0 > GameCount = 0 > ScrollBar = 0 >@@ -19,41 +21,41 @@ > GemRB.HideGUI () > GemRB.SetVisible (0,0) > >- GemRB.LoadWindowPack("GUISAVE", 640, 480) >+ GemRB.LoadWindowPack ("GUISAVE", 640, 480) > Window = SaveWindow = GemRB.LoadWindow (0) > GemRB.SetWindowFrame (Window) > CancelButton=GemRB.GetControl (Window,34) >- GemRB.SetText(Window, CancelButton, 13727) >+ GemRB.SetText (Window, CancelButton, 13727) > GemRB.SetEvent (Window,CancelButton,IE_GUI_BUTTON_ON_PRESS, "OpenSaveWindow") >- GemRB.SetVar("LoadIdx",0) >+ GemRB.SetVar ("LoadIdx",0) > > for i in range(4): > Button = GemRB.GetControl (Window,26+i) >- GemRB.SetText(Window, Button, 15588) >+ GemRB.SetText (Window, Button, 15588) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SavePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > Button = GemRB.GetControl (Window, 30+i) >- GemRB.SetText(Window, Button, 13957) >+ GemRB.SetText (Window, Button, 13957) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DeleteGamePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > #area previews > Button = GemRB.GetControl (Window, 1+i) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > #PC portraits > for j in range(PARTY_SIZE): > Button = GemRB.GetControl (Window,40+i*PARTY_SIZE+j) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > ScrollBar=GemRB.GetControl (Window, 25) > GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "ScrollBarPress") >- GameCount=GemRB.GetSaveGameCount()+1 #one more for the 'new game' >+ GameCount=GemRB.GetSaveGameCount ()+1 #one more for the 'new game' > if GameCount>4: > TopIndex = GameCount-4 > else: >@@ -68,34 +70,34 @@ > Window = SaveWindow > > #draw load game portraits >- Pos = GemRB.GetVar("TopIndex") >+ Pos = GemRB.GetVar ("TopIndex") > for i in range(4): > ActPos = Pos + i > > Button1 = GemRB.GetControl (Window,26+i) > Button2 = GemRB.GetControl (Window, 30+i) > if ActPos<GameCount: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_ENABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_ENABLED) > else: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_DISABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_DISABLED) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (0,ActPos) > elif ActPos == GameCount-1: > Slotname = 15304 > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000008+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (4,ActPos) > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000010+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > Button=GemRB.GetControl (Window, 1+i) > if ActPos<GameCount-1: >@@ -118,37 +120,38 @@ > def ConfirmedSaveGame(): > global ConfirmWindow > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > Label = GemRB.GetControl (ConfirmWindow, 3) >- Slotname = GemRB.QueryText(ConfirmWindow, Label) >+ Slotname = GemRB.QueryText (ConfirmWindow, Label) > StartLoadScreen() > GemRB.SaveGame(Pos, Slotname) #loads and enters savegame > GemRB.UnloadWindow (ConfirmWindow) >- CloseSaveWindow () >+ #CloseSaveWindow () >+ GemRB.SetVisible (SaveWindow,1) > return > > def SavePress(): >- global ConfirmWindow >+ global ConfirmWindow, NameField, SaveButton > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > ConfirmWindow = GemRB.LoadWindow (1) > > #slot name > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (0,Pos) > else: > Slotname = "" > NameField = GemRB.GetControl (ConfirmWindow, 3) >- GemRB.SetText(ConfirmWindow, NameField, Slotname) >- GemRB.SetControlStatus(ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) >+ GemRB.SetText (ConfirmWindow, NameField, Slotname) >+ GemRB.SetEvent (ConfirmWindow, NameField, IE_GUI_EDIT_ON_CHANGE,"EditChange") > > #game hours (should be generated from game) > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (4,Pos) > else: > Slotname = "" > Label = GemRB.GetControl (ConfirmWindow, 0x10000004) >- GemRB.SetText(ConfirmWindow, Label, Slotname) >+ GemRB.SetText (ConfirmWindow, Label, Slotname) > > #areapreview > Button=GemRB.GetControl (ConfirmWindow, 0) >@@ -167,27 +170,37 @@ > > #save > SaveButton=GemRB.GetControl (ConfirmWindow, 7) >- GemRB.SetText(ConfirmWindow, SaveButton, 15588) >+ GemRB.SetText (ConfirmWindow, SaveButton, 15588) > GemRB.SetEvent (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ON_PRESS, "ConfirmedSaveGame") > GemRB.SetButtonFlags (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DEFAULT, OP_OR) >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) > > #cancel > CancelButton=GemRB.GetControl (ConfirmWindow, 8) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "AbortedSaveGame") > GemRB.SetVisible (ConfirmWindow,1) >+ GemRB.SetControlStatus (ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) > return > >+def EditChange(): >+ Name = GemRB.QueryText (ConfirmWindow, NameField) >+ if len(Name)==0: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ else: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ENABLED) >+ return >+ > def DeleteGameConfirm(): > global GameCount > >- TopIndex = GemRB.GetVar("TopIndex") >- Pos = TopIndex +GemRB.GetVar("LoadIdx") >+ TopIndex = GemRB.GetVar ("TopIndex") >+ Pos = TopIndex +GemRB.GetVar ("LoadIdx") > GemRB.DeleteSaveGame(Pos) > if TopIndex>0: >- GemRB.SetVar("TopIndex",TopIndex-1) >- GameCount=GemRB.GetSaveGameCount() #count of games in save folder? >- GemRB.SetVarAssoc(SaveWindow, ScrollBar, "TopIndex", GameCount) >+ GemRB.SetVar ("TopIndex",TopIndex-1) >+ GameCount=GemRB.GetSaveGameCount () #count of games in save folder? >+ GemRB.SetVarAssoc (SaveWindow, ScrollBar, "TopIndex", GameCount) > ScrollBarPress() > GemRB.UnloadWindow (ConfirmWindow) > GemRB.SetVisible (SaveWindow,1) >@@ -204,12 +217,12 @@ > GemRB.SetVisible (SaveWindow, 0) > ConfirmWindow=GemRB.LoadWindow (2) > Text=GemRB.GetControl (ConfirmWindow, 0) >- GemRB.SetText(ConfirmWindow, Text, 15305) >+ GemRB.SetText (ConfirmWindow, Text, 15305) > DeleteButton=GemRB.GetControl (ConfirmWindow, 1) >- GemRB.SetText(ConfirmWindow, DeleteButton, 13957) >+ GemRB.SetText (ConfirmWindow, DeleteButton, 13957) > GemRB.SetEvent (ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") > CancelButton=GemRB.GetControl (ConfirmWindow, 2) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") > GemRB.SetVisible (ConfirmWindow,1) > return >Index: gemrb/GUIScripts/bg1/GUISAVE.py >=================================================================== >--- gemrb/GUIScripts/bg1/GUISAVE.py (revision 4224) >+++ gemrb/GUIScripts/bg1/GUISAVE.py (revision 4246) >@@ -5,6 +5,8 @@ > > SaveWindow = 0 > ConfirmWindow = 0 >+NameField = 0 >+SaveButton = 0 > TextAreaControl = 0 > GameCount = 0 > ScrollBar = 0 >@@ -19,41 +21,41 @@ > GemRB.HideGUI () > GemRB.SetVisible (0,0) > >- GemRB.LoadWindowPack("GUISAVE", 640, 480) >+ GemRB.LoadWindowPack ("GUISAVE", 640, 480) > Window = SaveWindow = GemRB.LoadWindow (0) > GemRB.SetWindowFrame (Window) > CancelButton=GemRB.GetControl (Window,34) >- GemRB.SetText(Window, CancelButton, 13727) >+ GemRB.SetText (Window, CancelButton, 13727) > GemRB.SetEvent (Window,CancelButton,IE_GUI_BUTTON_ON_PRESS, "OpenSaveWindow") >- GemRB.SetVar("LoadIdx",0) >+ GemRB.SetVar ("LoadIdx",0) > > for i in range(4): > Button = GemRB.GetControl (Window,26+i) >- GemRB.SetText(Window, Button, 15588) >+ GemRB.SetText (Window, Button, 15588) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SavePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > Button = GemRB.GetControl (Window, 30+i) >- GemRB.SetText(Window, Button, 13957) >+ GemRB.SetText (Window, Button, 13957) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DeleteGamePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > #area previews > Button = GemRB.GetControl (Window, 1+i) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > #PC portraits > for j in range(PARTY_SIZE): > Button = GemRB.GetControl (Window,40+i*PARTY_SIZE+j) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > ScrollBar=GemRB.GetControl (Window, 25) > GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "ScrollBarPress") >- GameCount=GemRB.GetSaveGameCount()+1 #one more for the 'new game' >+ GameCount=GemRB.GetSaveGameCount ()+1 #one more for the 'new game' > if GameCount>4: > TopIndex = GameCount-4 > else: >@@ -68,34 +70,34 @@ > Window = SaveWindow > > #draw load game portraits >- Pos = GemRB.GetVar("TopIndex") >+ Pos = GemRB.GetVar ("TopIndex") > for i in range(4): > ActPos = Pos + i > > Button1 = GemRB.GetControl (Window,26+i) > Button2 = GemRB.GetControl (Window, 30+i) > if ActPos<GameCount: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_ENABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_ENABLED) > else: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_DISABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_DISABLED) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (0,ActPos) > elif ActPos == GameCount-1: > Slotname = 15304 > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000008+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (4,ActPos) > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000010+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > Button=GemRB.GetControl (Window, 1+i) > if ActPos<GameCount-1: >@@ -118,37 +120,38 @@ > def ConfirmedSaveGame(): > global ConfirmWindow > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > Label = GemRB.GetControl (ConfirmWindow, 3) >- Slotname = GemRB.QueryText(ConfirmWindow, Label) >+ Slotname = GemRB.QueryText (ConfirmWindow, Label) > StartLoadScreen() > GemRB.SaveGame(Pos, Slotname) #loads and enters savegame > GemRB.UnloadWindow (ConfirmWindow) >- CloseSaveWindow () >+ #CloseSaveWindow () >+ GemRB.SetVisible (SaveWindow,1) > return > > def SavePress(): >- global ConfirmWindow >+ global ConfirmWindow, NameField, SaveButton > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > ConfirmWindow = GemRB.LoadWindow (1) > > #slot name > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (0,Pos) > else: > Slotname = "" > NameField = GemRB.GetControl (ConfirmWindow, 3) >- GemRB.SetText(ConfirmWindow, NameField, Slotname) >- GemRB.SetControlStatus(ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) >+ GemRB.SetText (ConfirmWindow, NameField, Slotname) >+ GemRB.SetEvent (ConfirmWindow, NameField, IE_GUI_EDIT_ON_CHANGE,"EditChange") > > #game hours (should be generated from game) > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (4,Pos) > else: > Slotname = "" > Label = GemRB.GetControl (ConfirmWindow, 0x10000004) >- GemRB.SetText(ConfirmWindow, Label, Slotname) >+ GemRB.SetText (ConfirmWindow, Label, Slotname) > > #areapreview > Button=GemRB.GetControl (ConfirmWindow, 0) >@@ -167,27 +170,37 @@ > > #save > SaveButton=GemRB.GetControl (ConfirmWindow, 7) >- GemRB.SetText(ConfirmWindow, SaveButton, 15588) >+ GemRB.SetText (ConfirmWindow, SaveButton, 15588) > GemRB.SetEvent (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ON_PRESS, "ConfirmedSaveGame") > GemRB.SetButtonFlags (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DEFAULT, OP_OR) >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) > > #cancel > CancelButton=GemRB.GetControl (ConfirmWindow, 8) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "AbortedSaveGame") > GemRB.SetVisible (ConfirmWindow,1) >+ GemRB.SetControlStatus (ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) > return > >+def EditChange(): >+ Name = GemRB.QueryText (ConfirmWindow, NameField) >+ if len(Name)==0: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ else: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ENABLED) >+ return >+ > def DeleteGameConfirm(): > global GameCount > >- TopIndex = GemRB.GetVar("TopIndex") >- Pos = TopIndex +GemRB.GetVar("LoadIdx") >+ TopIndex = GemRB.GetVar ("TopIndex") >+ Pos = TopIndex +GemRB.GetVar ("LoadIdx") > GemRB.DeleteSaveGame(Pos) > if TopIndex>0: >- GemRB.SetVar("TopIndex",TopIndex-1) >- GameCount=GemRB.GetSaveGameCount() #count of games in save folder? >- GemRB.SetVarAssoc(SaveWindow, ScrollBar, "TopIndex", GameCount) >+ GemRB.SetVar ("TopIndex",TopIndex-1) >+ GameCount=GemRB.GetSaveGameCount () #count of games in save folder? >+ GemRB.SetVarAssoc (SaveWindow, ScrollBar, "TopIndex", GameCount) > ScrollBarPress() > GemRB.UnloadWindow (ConfirmWindow) > GemRB.SetVisible (SaveWindow,1) >@@ -204,12 +217,12 @@ > GemRB.SetVisible (SaveWindow, 0) > ConfirmWindow=GemRB.LoadWindow (2) > Text=GemRB.GetControl (ConfirmWindow, 0) >- GemRB.SetText(ConfirmWindow, Text, 15305) >+ GemRB.SetText (ConfirmWindow, Text, 15305) > DeleteButton=GemRB.GetControl (ConfirmWindow, 1) >- GemRB.SetText(ConfirmWindow, DeleteButton, 13957) >+ GemRB.SetText (ConfirmWindow, DeleteButton, 13957) > GemRB.SetEvent (ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") > CancelButton=GemRB.GetControl (ConfirmWindow, 2) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") > GemRB.SetVisible (ConfirmWindow,1) > return >Index: gemrb/GUIScripts/bg2/GUISAVE.py >=================================================================== >--- gemrb/GUIScripts/bg2/GUISAVE.py (revision 4224) >+++ gemrb/GUIScripts/bg2/GUISAVE.py (revision 4246) >@@ -5,6 +5,8 @@ > > SaveWindow = 0 > ConfirmWindow = 0 >+NameField = 0 >+SaveButton = 0 > TextAreaControl = 0 > GameCount = 0 > ScrollBar = 0 >@@ -19,41 +21,41 @@ > GemRB.HideGUI () > GemRB.SetVisible (0,0) > >- GemRB.LoadWindowPack("GUISAVE", 640, 480) >+ GemRB.LoadWindowPack ("GUISAVE", 640, 480) > Window = SaveWindow = GemRB.LoadWindow (0) > GemRB.SetWindowFrame (Window) > CancelButton=GemRB.GetControl (Window,34) >- GemRB.SetText(Window, CancelButton, 13727) >+ GemRB.SetText (Window, CancelButton, 13727) > GemRB.SetEvent (Window,CancelButton,IE_GUI_BUTTON_ON_PRESS, "OpenSaveWindow") >- GemRB.SetVar("LoadIdx",0) >+ GemRB.SetVar ("LoadIdx",0) > > for i in range(4): > Button = GemRB.GetControl (Window,26+i) >- GemRB.SetText(Window, Button, 15588) >+ GemRB.SetText (Window, Button, 15588) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SavePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > Button = GemRB.GetControl (Window, 30+i) >- GemRB.SetText(Window, Button, 13957) >+ GemRB.SetText (Window, Button, 13957) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DeleteGamePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > #area previews > Button = GemRB.GetControl (Window, 1+i) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > #PC portraits > for j in range(PARTY_SIZE): > Button = GemRB.GetControl (Window,40+i*PARTY_SIZE+j) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > ScrollBar=GemRB.GetControl (Window, 25) > GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "ScrollBarPress") >- GameCount=GemRB.GetSaveGameCount()+1 #one more for the 'new game' >+ GameCount=GemRB.GetSaveGameCount ()+1 #one more for the 'new game' > if GameCount>4: > TopIndex = GameCount-4 > else: >@@ -68,34 +70,34 @@ > Window = SaveWindow > > #draw load game portraits >- Pos = GemRB.GetVar("TopIndex") >+ Pos = GemRB.GetVar ("TopIndex") > for i in range(4): > ActPos = Pos + i > > Button1 = GemRB.GetControl (Window,26+i) > Button2 = GemRB.GetControl (Window, 30+i) > if ActPos<GameCount: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_ENABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_ENABLED) > else: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_DISABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_DISABLED) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (0,ActPos) > elif ActPos == GameCount-1: > Slotname = 15304 > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000008+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (4,ActPos) > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000010+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > Button=GemRB.GetControl (Window, 1+i) > if ActPos<GameCount-1: >@@ -118,37 +120,38 @@ > def ConfirmedSaveGame(): > global ConfirmWindow > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > Label = GemRB.GetControl (ConfirmWindow, 3) >- Slotname = GemRB.QueryText(ConfirmWindow, Label) >+ Slotname = GemRB.QueryText (ConfirmWindow, Label) > StartLoadScreen() > GemRB.SaveGame(Pos, Slotname) #loads and enters savegame > GemRB.UnloadWindow (ConfirmWindow) >- CloseSaveWindow () >+ #CloseSaveWindow () >+ GemRB.SetVisible (SaveWindow,1) > return > > def SavePress(): >- global ConfirmWindow >+ global ConfirmWindow, NameField, SaveButton > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > ConfirmWindow = GemRB.LoadWindow (1) > > #slot name > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (0,Pos) > else: > Slotname = "" > NameField = GemRB.GetControl (ConfirmWindow, 3) >- GemRB.SetText(ConfirmWindow, NameField, Slotname) >- GemRB.SetControlStatus(ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) >+ GemRB.SetText (ConfirmWindow, NameField, Slotname) >+ GemRB.SetEvent (ConfirmWindow, NameField, IE_GUI_EDIT_ON_CHANGE,"EditChange") > > #game hours (should be generated from game) > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (4,Pos) > else: > Slotname = "" > Label = GemRB.GetControl (ConfirmWindow, 0x10000004) >- GemRB.SetText(ConfirmWindow, Label, Slotname) >+ GemRB.SetText (ConfirmWindow, Label, Slotname) > > #areapreview > Button=GemRB.GetControl (ConfirmWindow, 0) >@@ -167,27 +170,37 @@ > > #save > SaveButton=GemRB.GetControl (ConfirmWindow, 7) >- GemRB.SetText(ConfirmWindow, SaveButton, 15588) >+ GemRB.SetText (ConfirmWindow, SaveButton, 15588) > GemRB.SetEvent (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ON_PRESS, "ConfirmedSaveGame") > GemRB.SetButtonFlags (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DEFAULT, OP_OR) >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) > > #cancel > CancelButton=GemRB.GetControl (ConfirmWindow, 8) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "AbortedSaveGame") > GemRB.SetVisible (ConfirmWindow,1) >+ GemRB.SetControlStatus (ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) > return > >+def EditChange(): >+ Name = GemRB.QueryText (ConfirmWindow, NameField) >+ if len(Name)==0: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ else: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ENABLED) >+ return >+ > def DeleteGameConfirm(): > global GameCount > >- TopIndex = GemRB.GetVar("TopIndex") >- Pos = TopIndex +GemRB.GetVar("LoadIdx") >+ TopIndex = GemRB.GetVar ("TopIndex") >+ Pos = TopIndex +GemRB.GetVar ("LoadIdx") > GemRB.DeleteSaveGame(Pos) > if TopIndex>0: >- GemRB.SetVar("TopIndex",TopIndex-1) >- GameCount=GemRB.GetSaveGameCount() #count of games in save folder? >- GemRB.SetVarAssoc(SaveWindow, ScrollBar, "TopIndex", GameCount) >+ GemRB.SetVar ("TopIndex",TopIndex-1) >+ GameCount=GemRB.GetSaveGameCount () #count of games in save folder? >+ GemRB.SetVarAssoc (SaveWindow, ScrollBar, "TopIndex", GameCount) > ScrollBarPress() > GemRB.UnloadWindow (ConfirmWindow) > GemRB.SetVisible (SaveWindow,1) >@@ -204,12 +217,12 @@ > GemRB.SetVisible (SaveWindow, 0) > ConfirmWindow=GemRB.LoadWindow (2) > Text=GemRB.GetControl (ConfirmWindow, 0) >- GemRB.SetText(ConfirmWindow, Text, 15305) >+ GemRB.SetText (ConfirmWindow, Text, 15305) > DeleteButton=GemRB.GetControl (ConfirmWindow, 1) >- GemRB.SetText(ConfirmWindow, DeleteButton, 13957) >+ GemRB.SetText (ConfirmWindow, DeleteButton, 13957) > GemRB.SetEvent (ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") > CancelButton=GemRB.GetControl (ConfirmWindow, 2) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") > GemRB.SetVisible (ConfirmWindow,1) > return >Index: gemrb/GUIScripts/how/GUISAVE.py >=================================================================== >--- gemrb/GUIScripts/how/GUISAVE.py (revision 4224) >+++ gemrb/GUIScripts/how/GUISAVE.py (revision 4246) >@@ -5,6 +5,8 @@ > > SaveWindow = 0 > ConfirmWindow = 0 >+NameField = 0 >+SaveButton = 0 > TextAreaControl = 0 > GameCount = 0 > ScrollBar = 0 >@@ -19,41 +21,41 @@ > GemRB.HideGUI () > GemRB.SetVisible (0,0) > >- GemRB.LoadWindowPack("GUISAVE", 640, 480) >+ GemRB.LoadWindowPack ("GUISAVE", 640, 480) > Window = SaveWindow = GemRB.LoadWindow (0) > GemRB.SetWindowFrame (Window) > CancelButton=GemRB.GetControl (Window,34) >- GemRB.SetText(Window, CancelButton, 13727) >+ GemRB.SetText (Window, CancelButton, 13727) > GemRB.SetEvent (Window,CancelButton,IE_GUI_BUTTON_ON_PRESS, "OpenSaveWindow") >- GemRB.SetVar("LoadIdx",0) >+ GemRB.SetVar ("LoadIdx",0) > > for i in range(4): > Button = GemRB.GetControl (Window,26+i) >- GemRB.SetText(Window, Button, 15588) >+ GemRB.SetText (Window, Button, 15588) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SavePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > Button = GemRB.GetControl (Window, 30+i) >- GemRB.SetText(Window, Button, 13957) >+ GemRB.SetText (Window, Button, 13957) > GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DeleteGamePress") >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_DISABLED) >- GemRB.SetVarAssoc(Window, Button, "LoadIdx",i) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetVarAssoc (Window, Button, "LoadIdx",i) > > #area previews > Button = GemRB.GetControl (Window, 1+i) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > #PC portraits > for j in range(PARTY_SIZE): > Button = GemRB.GetControl (Window,40+i*PARTY_SIZE+j) >- GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) >+ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) > GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_NO_IMAGE|IE_GUI_BUTTON_PICTURE,OP_SET) > > ScrollBar=GemRB.GetControl (Window, 25) > GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "ScrollBarPress") >- GameCount=GemRB.GetSaveGameCount()+1 #one more for the 'new game' >+ GameCount=GemRB.GetSaveGameCount ()+1 #one more for the 'new game' > if GameCount>4: > TopIndex = GameCount-4 > else: >@@ -68,34 +70,34 @@ > Window = SaveWindow > > #draw load game portraits >- Pos = GemRB.GetVar("TopIndex") >+ Pos = GemRB.GetVar ("TopIndex") > for i in range(4): > ActPos = Pos + i > > Button1 = GemRB.GetControl (Window,26+i) > Button2 = GemRB.GetControl (Window, 30+i) > if ActPos<GameCount: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_ENABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_ENABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_ENABLED) > else: >- GemRB.SetButtonState(Window, Button1, IE_GUI_BUTTON_DISABLED) >- GemRB.SetButtonState(Window, Button2, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button1, IE_GUI_BUTTON_DISABLED) >+ GemRB.SetButtonState (Window, Button2, IE_GUI_BUTTON_DISABLED) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (0,ActPos) > elif ActPos == GameCount-1: > Slotname = 15304 > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000008+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > if ActPos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,ActPos) >+ Slotname = GemRB.GetSaveGameAttrib (4,ActPos) > else: > Slotname = "" > Label = GemRB.GetControl (Window, 0x10000010+i) >- GemRB.SetText(Window, Label, Slotname) >+ GemRB.SetText (Window, Label, Slotname) > > Button=GemRB.GetControl (Window, 1+i) > if ActPos<GameCount-1: >@@ -118,37 +120,38 @@ > def ConfirmedSaveGame(): > global ConfirmWindow > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > Label = GemRB.GetControl (ConfirmWindow, 3) >- Slotname = GemRB.QueryText(ConfirmWindow, Label) >+ Slotname = GemRB.QueryText (ConfirmWindow, Label) > StartLoadScreen() > GemRB.SaveGame(Pos, Slotname) #loads and enters savegame > GemRB.UnloadWindow (ConfirmWindow) >- CloseSaveWindow () >+ #CloseSaveWindow () >+ GemRB.SetVisible (SaveWindow,1) > return > > def SavePress(): >- global ConfirmWindow >+ global ConfirmWindow, NameField, SaveButton > >- Pos = GemRB.GetVar("TopIndex")+GemRB.GetVar("LoadIdx") >+ Pos = GemRB.GetVar ("TopIndex")+GemRB.GetVar ("LoadIdx") > ConfirmWindow = GemRB.LoadWindow (1) > > #slot name > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(0,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (0,Pos) > else: > Slotname = "" > NameField = GemRB.GetControl (ConfirmWindow, 3) >- GemRB.SetText(ConfirmWindow, NameField, Slotname) >- GemRB.SetControlStatus(ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) >+ GemRB.SetText (ConfirmWindow, NameField, Slotname) >+ GemRB.SetEvent (ConfirmWindow, NameField, IE_GUI_EDIT_ON_CHANGE,"EditChange") > > #game hours (should be generated from game) > if Pos<GameCount-1: >- Slotname = GemRB.GetSaveGameAttrib(4,Pos) >+ Slotname = GemRB.GetSaveGameAttrib (4,Pos) > else: > Slotname = "" > Label = GemRB.GetControl (ConfirmWindow, 0x10000004) >- GemRB.SetText(ConfirmWindow, Label, Slotname) >+ GemRB.SetText (ConfirmWindow, Label, Slotname) > > #areapreview > Button=GemRB.GetControl (ConfirmWindow, 0) >@@ -167,27 +170,37 @@ > > #save > SaveButton=GemRB.GetControl (ConfirmWindow, 7) >- GemRB.SetText(ConfirmWindow, SaveButton, 15588) >+ GemRB.SetText (ConfirmWindow, SaveButton, 15588) > GemRB.SetEvent (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ON_PRESS, "ConfirmedSaveGame") > GemRB.SetButtonFlags (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DEFAULT, OP_OR) >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) > > #cancel > CancelButton=GemRB.GetControl (ConfirmWindow, 8) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "AbortedSaveGame") > GemRB.SetVisible (ConfirmWindow,1) >+ GemRB.SetControlStatus (ConfirmWindow, NameField, IE_GUI_CONTROL_FOCUSED) > return > >+def EditChange(): >+ Name = GemRB.QueryText (ConfirmWindow, NameField) >+ if len(Name)==0: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_DISABLED) >+ else: >+ GemRB.SetButtonState (ConfirmWindow, SaveButton, IE_GUI_BUTTON_ENABLED) >+ return >+ > def DeleteGameConfirm(): > global GameCount > >- TopIndex = GemRB.GetVar("TopIndex") >- Pos = TopIndex +GemRB.GetVar("LoadIdx") >+ TopIndex = GemRB.GetVar ("TopIndex") >+ Pos = TopIndex +GemRB.GetVar ("LoadIdx") > GemRB.DeleteSaveGame(Pos) > if TopIndex>0: >- GemRB.SetVar("TopIndex",TopIndex-1) >- GameCount=GemRB.GetSaveGameCount() #count of games in save folder? >- GemRB.SetVarAssoc(SaveWindow, ScrollBar, "TopIndex", GameCount) >+ GemRB.SetVar ("TopIndex",TopIndex-1) >+ GameCount=GemRB.GetSaveGameCount () #count of games in save folder? >+ GemRB.SetVarAssoc (SaveWindow, ScrollBar, "TopIndex", GameCount) > ScrollBarPress() > GemRB.UnloadWindow (ConfirmWindow) > GemRB.SetVisible (SaveWindow,1) >@@ -204,12 +217,12 @@ > GemRB.SetVisible (SaveWindow, 0) > ConfirmWindow=GemRB.LoadWindow (2) > Text=GemRB.GetControl (ConfirmWindow, 0) >- GemRB.SetText(ConfirmWindow, Text, 15305) >+ GemRB.SetText (ConfirmWindow, Text, 15305) > DeleteButton=GemRB.GetControl (ConfirmWindow, 1) >- GemRB.SetText(ConfirmWindow, DeleteButton, 13957) >+ GemRB.SetText (ConfirmWindow, DeleteButton, 13957) > GemRB.SetEvent (ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") > CancelButton=GemRB.GetControl (ConfirmWindow, 2) >- GemRB.SetText(ConfirmWindow, CancelButton, 13727) >+ GemRB.SetText (ConfirmWindow, CancelButton, 13727) > GemRB.SetEvent (ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") > GemRB.SetVisible (ConfirmWindow,1) > return
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 158336
:
104184
|
104185
|
104186
|
111412
|
111413
|
111415
|
111416
|
111423
|
117276
|
117277
|
120400
|
120401
|
120483
|
129700
|
135108
|
135117
|
135119
|
135208
|
144585
|
144610
|
144993
|
144995
|
171043
|
182651
|
182653
|
192717
|
201372