From: <lyn...@us...> - 2009-02-18 10:10:58
|
Revision: 5715 http://gemrb.svn.sourceforge.net/gemrb/?rev=5715&view=rev Author: lynxlupodian Date: 2009-02-18 10:10:54 +0000 (Wed, 18 Feb 2009) Log Message: ----------- iwd: added the missing map and journal improvements from how both games have now identical guiscripts! Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/iwd/GUIJRNL.py gemrb/trunk/gemrb/GUIScripts/iwd/GUIMA.py Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUIJRNL.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUIJRNL.py 2009-02-18 09:50:41 UTC (rev 5714) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUIJRNL.py 2009-02-18 10:10:54 UTC (rev 5715) @@ -23,11 +23,18 @@ ################################################### import GemRB +import GUICommonWindows from GUIDefines import * from GUICommon import CloseOtherWindow +from GUICommonWindows import * ################################################### JournalWindow = None +PortraitWindow = None +OptionsWindow = None +OldPortraitWindow = None +OldOptionsWindow = None + Chapter = 0 StartTime = 0 StartYear = 0 @@ -35,30 +42,47 @@ ################################################### def OpenJournalWindow (): global StartTime, StartYear - global JournalWindow + global JournalWindow, PortraitWindow, OptionsWindow + global OldPortraitWindow, OldOptionsWindow - Table = GemRB.LoadTableObject("YEARS") - #StartTime is the time offset for ingame time, beginning from the startyear - StartTime = Table.GetValue("STARTTIME", "VALUE") / 4500 - #StartYear is the year of the lowest ingame date to be printed - StartYear = Table.GetValue("STARTYEAR", "VALUE") - if CloseOtherWindow (OpenJournalWindow): - GemRB.HideGUI () if JournalWindow: JournalWindow.Unload () + if OptionsWindow: + OptionsWindow.Unload () + if PortraitWindow: + PortraitWindow.Unload () + JournalWindow = None GemRB.SetVar ("OtherWindow", -1) - + GemRB.SetVisible (0,1) GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None return GemRB.HideGUI () - GemRB.LoadWindowPack ("GUIJRNL") + GemRB.SetVisible (0,0) + + GemRB.LoadWindowPack ("GUIJRNL", 640, 480) JournalWindow = Window = GemRB.LoadWindowObject (2) - GemRB.SetVar("OtherWindow", JournalWindow.ID) + GemRB.SetVar ("OtherWindow", JournalWindow.ID) + #saving the original portrait window + OldOptionsWindow = GUICommonWindows.OptionsWindow + OptionsWindow = GemRB.LoadWindowObject (0) + SetupMenuWindowControls (OptionsWindow, 0, "OpenJournalWindow") + OptionsWindow.SetFrame () + OldPortraitWindow = GUICommonWindows.PortraitWindow + PortraitWindow = OpenPortraitWindow (0) - + Table = GemRB.LoadTableObject("YEARS") + #StartTime is the time offset for ingame time, beginning from the startyear + StartTime = Table.GetValue("STARTTIME", "VALUE") / 4500 + #StartYear is the year of the lowest ingame date to be printed + StartYear = Table.GetValue("STARTYEAR", "VALUE") + Button = Window.GetControl (3) Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, "JournalPrevSectionPress") @@ -67,9 +91,10 @@ Chapter = GemRB.GetGameVar("chapter") UpdateJournalWindow () - GemRB.UnhideGUI () + OptionsWindow.SetVisible (1) + Window.SetVisible (1) + PortraitWindow.SetVisible (1) - ################################################### def UpdateJournalWindow (): Window = JournalWindow Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUIMA.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUIMA.py 2009-02-18 09:50:41 UTC (rev 5714) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUIMA.py 2009-02-18 10:10:54 UTC (rev 5715) @@ -24,25 +24,40 @@ ################################################### import GemRB +import GUICommonWindows from GUIDefines import * from GUICommon import CloseOtherWindow +from GUICommonWindows import * MapWindow = None WorldMapWindow = None WorldMapControl = None +PortraitWindow = None +OptionsWindow = None +OldPortraitWindow = None +OldOptionsWindow = None def RevealMap (): global MapWindow + global OldPortraitWindow, OldOptionsWindow if CloseOtherWindow (ShowMap): if MapWindow: MapWindow.Unload () + if OptionsWindow: + OptionsWindow.Unload () + if PortraitWindow: + PortraitWindow.Unload () MapWindow = None #this window type should block the game GemRB.SetVar ("OtherWindow", -1) GemRB.SetVisible (0,1) GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None PosX = GemRB.GetVar ("MapControlX") PosY = GemRB.GetVar ("MapControlY") @@ -54,17 +69,26 @@ # for farsight effect ################################################### def ShowMap (): - global MapWindow + global MapWindow, OptionsWindow, PortraitWindow + global OldPortraitWindow, OldOptionsWindow if CloseOtherWindow (ShowMap): if MapWindow: MapWindow.Unload () + if OptionsWindow: + OptionsWindow.Unload () + if PortraitWindow: + PortraitWindow.Unload () MapWindow = None #this window type should block the game GemRB.SetVar ("OtherWindow", -1) GemRB.SetVisible (0,1) GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None return GemRB.HideGUI () @@ -75,7 +99,12 @@ #this window type blocks the game normally, but map window doesn't GemRB.SetVar ("OtherWindow", MapWindow.ID) #saving the original portrait window - MapWindow.SetFrame () + OldOptionsWindow = GUICommonWindows.OptionsWindow + OptionsWindow = GemRB.LoadWindowObject (0) + SetupMenuWindowControls (OptionsWindow, 0, "ShowMap") + OldPortraitWindow = GUICommonWindows.PortraitWindow + PortraitWindow = OpenPortraitWindow (0) + OptionsWindow.SetFrame () # World Map Button = Window.GetControl (1) @@ -93,13 +122,16 @@ GemRB.SetVar("ShowMapNotes",IE_GUI_MAP_REVEAL_MAP) Map.SetVarAssoc ("ShowMapNotes", IE_GUI_MAP_REVEAL_MAP) Map.SetEvent (IE_GUI_MAP_ON_PRESS, "RevealMap") + OptionsWindow.SetVisible (2) Window.SetVisible (1) + PortraitWindow.SetVisible (2) GemRB.GamePause (0,0) return ################################################### def OpenMapWindow (): - global MapWindow + global MapWindow, OptionsWindow, PortraitWindow + global OldPortraitWindow, OldOptionsWindow if CloseOtherWindow (OpenMapWindow): if WorldMapWindow: OpenWorldMapWindowInside () @@ -118,6 +150,14 @@ MapWindow = Window = GemRB.LoadWindowObject (2) #this window type blocks the game normally, but map window doesn't GemRB.SetVar ("OtherWindow", MapWindow.ID) + #saving the original portrait window + OldOptionsWindow = GUICommonWindows.OptionsWindow + OptionsWindow = GemRB.LoadWindowObject (0) + SetupMenuWindowControls (OptionsWindow, 0, "OpenMapWindow") + OptionsWindow.SetFrame () + OldPortraitWindow = GUICommonWindows.PortraitWindow + PortraitWindow = OpenPortraitWindow (0) + OptionsWindow.SetFrame () # World Map Button = Window.GetControl (1) @@ -126,6 +166,10 @@ # Map Control Window.CreateMapControl (2, 0, 0, 0, 0) Map = Window.GetControl (2) + + OptionsWindow.SetVisible (1) + Window.SetVisible (1) + PortraitWindow.SetVisible (1) Map.SetStatus (IE_GUI_CONTROL_FOCUSED) GemRB.UnhideGUI () return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |