From: Laszlo T. <ave...@us...> - 2007-01-07 16:19:26
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30456/bg2 Modified Files: GUIREC.py ImportFile.py Log Message: cleaned up scripts implemented character export in bg2/tob Index: ImportFile.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/ImportFile.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImportFile.py 4 Jan 2007 17:29:04 -0000 1.5 --- ImportFile.py 7 Jan 2007 16:19:16 -0000 1.6 *************** *** 4,10 **** #import from a character sheet ImportWindow = 0 def OnLoad(): ! global ImportWindow GemRB.LoadWindowPack("GUICG",640,480) --- 4,11 ---- #import from a character sheet ImportWindow = 0 + TextAreaControl = 0 def OnLoad(): ! global ImportWindow, TextAreaControl GemRB.LoadWindowPack("GUICG",640,480) *************** *** 27,36 **** GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetVisible(ImportWindow,1) return def DonePress(): GemRB.UnloadWindow(ImportWindow) ! GemRB.SetNextScript("Start") return --- 28,46 ---- GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") + GemRB.SetEvent(ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") GemRB.SetVisible(ImportWindow,1) return + def SelectPress(): + DoneButton = GemRB.GetControl(ImportWindow, 0) + GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) + return + def DonePress(): + FileName = GemRB.QueryText(ImportWindow, TextAreaControl) + Slot = GemRB.GetVar("Slot") + GemRB.CreatePlayer(FileName, Slot| 0x8000, 1) GemRB.UnloadWindow(ImportWindow) ! GemRB.SetNextScript("CharGen7") return Index: GUIREC.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUIREC.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** GUIREC.py 31 Dec 2006 15:18:36 -0000 1.29 --- GUIREC.py 7 Jan 2007 16:19:16 -0000 1.30 *************** *** 41,44 **** --- 41,45 ---- OldOptionsWindow = None ExportDoneButton = None + ExportFileName = "" ################################################### *************** *** 593,596 **** --- 594,599 ---- GemRB.UnloadWindow(ExportWindow) #save file under name from EditControl + pc = GemRB.GameGetSelectedPCSingle () + GemRB.SaveCharacter(pc, ExportFileName) return *************** *** 600,603 **** --- 603,608 ---- def ExportEditChanged(): + global ExportFileName + ExportFileName = GemRB.QueryText(ExportWindow, NameField) if ExportFileName == "": |