From: Laszlo T. <ave...@us...> - 2005-11-21 16:43:07
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1787 Modified Files: GUICG13.py TextScreen.py Log Message: implemented bg1 TextScreen Index: GUICG13.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUICG13.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GUICG13.py 14 Dec 2004 20:58:44 -0000 1.3 --- GUICG13.py 21 Nov 2005 16:42:56 -0000 1.4 *************** *** 120,124 **** ColorPicker=GemRB.LoadWindow(14) GemRB.SetVar("Selected",-1) ! for i in range(0,34): Button = GemRB.GetControl(ColorPicker, i) GemRB.SetButtonState(ColorPicker, Button, IE_GUI_BUTTON_LOCKED) --- 120,124 ---- ColorPicker=GemRB.LoadWindow(14) GemRB.SetVar("Selected",-1) ! for i in range(34): Button = GemRB.GetControl(ColorPicker, i) GemRB.SetButtonState(ColorPicker, Button, IE_GUI_BUTTON_LOCKED) *************** *** 127,131 **** Selected = -1 ! for i in range(0,34): MyColor = GemRB.GetTableValue(ColorTable, ColorIndex, i) if MyColor == "*": --- 127,131 ---- Selected = -1 ! for i in range(34): MyColor = GemRB.GetTableValue(ColorTable, ColorIndex, i) if MyColor == "*": Index: TextScreen.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/TextScreen.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TextScreen.py 13 Aug 2005 10:50:07 -0000 1.4 --- TextScreen.py 21 Nov 2005 16:42:56 -0000 1.5 *************** *** 28,31 **** --- 28,32 ---- TextScreen = None TextArea = None + Position = 1 def StartTextScreen (): *************** *** 35,50 **** LoadPic = GemRB.GetGameString (STR_LOADMOS) #if there is no preset loadpic, try to determine it from the chapter ! if LoadPic == "": Chapter = GemRB.GetVar("CHAPTER") #set ID according to the Chapter? ID = Chapter else: ID = 62 TextScreen = GemRB.LoadWindow (ID) GemRB.SetWindowFrame (TextScreen) - if LoadPic != "": - GemRB.SetWindowPicture (TextScreen, LoadPic) TextArea = GemRB.GetControl (TextScreen, 2) GemRB.SetTextAreaFlags (TextScreen, TextArea, IE_GUI_TEXTAREA_SMOOTHSCROLL) #done --- 36,59 ---- LoadPic = GemRB.GetGameString (STR_LOADMOS) #if there is no preset loadpic, try to determine it from the chapter ! if LoadPic[:6] == "CHPTXT": Chapter = GemRB.GetVar("CHAPTER") #set ID according to the Chapter? ID = Chapter + GemRB.LoadMusicPL("chapter.mus") else: ID = 62 TextScreen = GemRB.LoadWindow (ID) GemRB.SetWindowFrame (TextScreen) TextArea = GemRB.GetControl (TextScreen, 2) GemRB.SetTextAreaFlags (TextScreen, TextArea, IE_GUI_TEXTAREA_SMOOTHSCROLL) + GemRB.SetEvent (TextScreen, TextArea, IE_GUI_TEXTAREA_OUT_OF_TEXT, "FeedScroll") + + #caption + TableName = GemRB.GetGameString (STR_LOADMOS) + Table = GemRB.LoadTable(TableName) + Value = GemRB.GetTableValue (Table, 2, 0) + GemRB.UnloadTable (Table) + Label=GemRB.GetControl (TextScreen, 0x10000000) + GemRB.SetText (TextScreen, Label, Value) #done *************** *** 61,69 **** GemRB.SetVisible (0, 0) #removing the gamecontrol screen GemRB.SetVisible (TextScreen, 1) def ReplayTextScreen (): ! global TextScreen, TextArea ! #GemRB.Rewind(TextScreen, TextArea) def EndTextScreen (): --- 70,95 ---- GemRB.SetVisible (0, 0) #removing the gamecontrol screen GemRB.SetVisible (TextScreen, 1) + GemRB.RewindTA(TextScreen, TextArea, 100) + GemRB.GamePause(1, 1) + + + def FeedScroll (): + global TextScreen, TextArea, Position + + TableName = GemRB.GetGameString (STR_LOADMOS) + Table = GemRB.LoadTable(TableName) + Value = GemRB.GetTableValue (Table, 2, Position) + GemRB.UnloadTable (Table) + if Value ==-1: + Position = 1 + else: + GemRB.TextAreaAppend (TextScreen, TextArea, Value) + Position = Position + 1 def ReplayTextScreen (): ! global TextScreen, TextArea, Position ! Position = 1 ! GemRB.RewindTA(TextScreen, TextArea, 100) def EndTextScreen (): *************** *** 74,76 **** --- 100,103 ---- GemRB.SetVisible (0, 1) #enabling gamecontrol screen GemRB.UnhideGUI () + GemRB.GamePause(0, 1) |