Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(559) |
Nov
(772) |
Dec
(914) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(291) |
Feb
(312) |
Mar
(215) |
Apr
(243) |
May
(150) |
Jun
(18) |
Jul
(131) |
Aug
(436) |
Sep
(171) |
Oct
(233) |
Nov
(222) |
Dec
(141) |
2005 |
Jan
(74) |
Feb
(220) |
Mar
(326) |
Apr
(142) |
May
(165) |
Jun
(187) |
Jul
(246) |
Aug
(116) |
Sep
(10) |
Oct
(30) |
Nov
(257) |
Dec
(247) |
2006 |
Jan
(165) |
Feb
(38) |
Mar
(58) |
Apr
(135) |
May
(18) |
Jun
(102) |
Jul
(228) |
Aug
(250) |
Sep
(47) |
Oct
(26) |
Nov
(69) |
Dec
(263) |
2007 |
Jan
(120) |
Feb
(268) |
Mar
(50) |
Apr
(64) |
May
(49) |
Jun
(39) |
Jul
(22) |
Aug
(56) |
Sep
(9) |
Oct
(2) |
Nov
(47) |
Dec
(115) |
2008 |
Jan
(57) |
Feb
(81) |
Mar
(26) |
Apr
(10) |
May
(19) |
Jun
(69) |
Jul
(10) |
Aug
(6) |
Sep
(111) |
Oct
(105) |
Nov
(11) |
Dec
(19) |
2009 |
Jan
(92) |
Feb
(159) |
Mar
(86) |
Apr
(59) |
May
(320) |
Jun
(443) |
Jul
(103) |
Aug
(315) |
Sep
(221) |
Oct
(122) |
Nov
(13) |
Dec
(46) |
2010 |
Jan
(6) |
Feb
(1) |
Mar
(65) |
Apr
(100) |
May
(83) |
Jun
(171) |
Jul
(145) |
Aug
(223) |
Sep
(107) |
Oct
(89) |
Nov
(123) |
Dec
(86) |
2011 |
Jan
(66) |
Feb
(101) |
Mar
(140) |
Apr
(80) |
May
(68) |
Jun
(45) |
Jul
(97) |
Aug
(119) |
Sep
(46) |
Oct
(45) |
Nov
(74) |
Dec
(89) |
2012 |
Jan
(124) |
Feb
(156) |
Mar
(102) |
Apr
(56) |
May
(25) |
Jun
(16) |
Jul
(73) |
Aug
(82) |
Sep
(53) |
Oct
(59) |
Nov
(90) |
Dec
(112) |
2013 |
Jan
(191) |
Feb
(58) |
Mar
(68) |
Apr
(49) |
May
(28) |
Jun
(42) |
Jul
(25) |
Aug
(15) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
(58) |
2014 |
Jan
(100) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(24) |
Jun
(8) |
Jul
(3) |
Aug
(9) |
Sep
(2) |
Oct
(90) |
Nov
(56) |
Dec
(44) |
2015 |
Jan
(51) |
Feb
(40) |
Mar
(7) |
Apr
(11) |
May
(6) |
Jun
(23) |
Jul
(46) |
Aug
(63) |
Sep
(58) |
Oct
(32) |
Nov
(32) |
Dec
(9) |
2016 |
Jan
(5) |
Feb
(8) |
Mar
(12) |
Apr
(24) |
May
(13) |
Jun
(7) |
Jul
(6) |
Aug
(18) |
Sep
(6) |
Oct
(9) |
Nov
(4) |
Dec
(5) |
2017 |
Jan
(6) |
Feb
(3) |
Mar
(13) |
Apr
(2) |
May
(2) |
Jun
(77) |
Jul
(13) |
Aug
(42) |
Sep
(92) |
Oct
(39) |
Nov
(35) |
Dec
(27) |
2018 |
Jan
(20) |
Feb
(17) |
Mar
(47) |
Apr
(65) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
|
2
(1) |
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
(6) |
14
(39) |
15
(2) |
16
(4) |
17
(23) |
18
(17) |
19
(5) |
20
(7) |
21
(4) |
22
|
23
|
24
(8) |
25
(8) |
26
(9) |
27
(10) |
28
(3) |
29
(12) |
30
(3) |
31
(4) |
|
|
|
|
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 21:55:40
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29723/Core Modified Files: GameScript.cpp GameScript.h Log Message: Added PCCanSeePoint, AtLocation, GlobalBAndGlobalExact pst triggers Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.275 retrieving revision 1.276 diff -C2 -d -r1.275 -r1.276 *** GameScript.cpp 27 May 2005 17:10:00 -0000 1.275 --- GameScript.cpp 27 May 2005 21:55:30 -0000 1.276 *************** *** 76,79 **** --- 76,80 ---- {"areaflag", GameScript::AreaFlag,0}, {"areatype", GameScript::AreaType,0}, + {"atlocation", GameScript::AtLocation,0}, {"bitcheck", GameScript::BitCheck,TF_MERGESTRINGS}, {"bitcheckexact", GameScript::BitCheckExact,TF_MERGESTRINGS}, *************** *** 123,126 **** --- 124,128 ---- {"globalband", GameScript::BitCheck,AF_MERGESTRINGS}, {"globalbandglobal", GameScript::GlobalBAndGlobal_Trigger,AF_MERGESTRINGS}, + {"globalbandglobalexact", GameScript::GlobalBAndGlobalExact,AF_MERGESTRINGS}, {"globalbitglobal", GameScript::GlobalBitGlobal_Trigger,TF_MERGESTRINGS}, {"globalequalsglobal", GameScript::GlobalsEqual,TF_MERGESTRINGS}, //this is the same *************** *** 170,173 **** --- 172,176 ---- {"interactingwith", GameScript::InteractingWith,0}, {"inventoryfull", GameScript::InventoryFull,0}, + {"inview", GameScript::LOS,0}, //it seems the same, needs research {"inweaponrange", GameScript::InWeaponRange,0}, {"isaclown", GameScript::IsAClown,0}, *************** *** 230,233 **** --- 233,239 ---- {"numtimestalkedtolt", GameScript::NumTimesTalkedToLT,0}, {"objectactionlistempty", GameScript::ObjectActionListEmpty,0}, //same function + {"objitemcounteq", GameScript::NumItems,0}, + {"objitemcountgt", GameScript::NumItemsGT,0}, + {"objitemcountlt", GameScript::NumItemsLT,0}, {"oncreation", GameScript::OnCreation,0}, {"onscreen", GameScript::OnScreen,0}, *************** *** 243,247 **** --- 249,257 ---- {"partyhasitem", GameScript::PartyHasItem,0}, {"partyhasitemidentified", GameScript::PartyHasItemIdentified,0}, + {"partyitemcounteq", GameScript::NumItemsParty,0}, + {"partyitemcountgt", GameScript::NumItemsPartyGT,0}, + {"partyitemcountlt", GameScript::NumItemsPartyLT,0}, {"partymemberdied", GameScript::PartyMemberDied,0}, + {"pccanseepoint", GameScript::PCCanSeePoint,0}, {"pcinstore", GameScript::PCInStore,0}, {"proficiency", GameScript::Proficiency,0}, *************** *** 262,265 **** --- 272,276 ---- {"specifics", GameScript::Specifics,0}, {"statecheck", GameScript::StateCheck,0}, + {"stuffglobalrandom", GameScript::StuffGlobalRandom,0},//hm, this is a trigger {"subrace", GameScript::SubRace,0}, {"targetunreachable", GameScript::TargetUnreachable,0}, *************** *** 293,296 **** --- 304,308 ---- {"addjournalentry", GameScript::AddJournalEntry,0}, {"addmapnote", GameScript::AddMapnote,0}, + {"addpartyexperience", GameScript::AddExperienceParty,0}, {"addspecialability", GameScript::AddSpecialAbility,0}, {"addwaypoint", GameScript::AddWayPoint,AF_BLOCKING}, *************** *** 552,555 **** --- 564,569 ---- {"setleavepartydialogfile", GameScript::SetLeavePartyDialogFile,0}, {"setmasterarea", GameScript::SetMasterArea,0}, + {"setmazeeasier", GameScript::SetMazeEasier,0}, //pst specific crap + {"setmazeharder", GameScript::SetMazeHarder,0}, //pst specific crap {"setmoraleai", GameScript::SetMoraleAI,0}, {"setmusic", GameScript::SetMusic,0}, *************** *** 604,608 **** {"stopmoving", GameScript::StopMoving,0}, {"storepartylocations", GameScript::StorePartyLocation,0}, - {"stuffglobalrandom", GameScript::SetGlobalRandom,0}, {"swing", GameScript::Swing,0}, {"swingonce", GameScript::SwingOnce,0}, --- 618,621 ---- *************** *** 3671,3674 **** --- 3684,3694 ---- } + int GameScript::GlobalBAndGlobalExact(Scriptable* Sender, Trigger* parameters) + { + ieDword value1 = CheckVariable(Sender, parameters->string0Parameter ); + ieDword value2 = CheckVariable(Sender, parameters->string1Parameter ); + return ( value1& value2 ) == value2; + } + int GameScript::GlobalBitGlobal_Trigger(Scriptable* Sender, Trigger* parameters) { *************** *** 4218,4221 **** --- 4238,4251 ---- } + int GameScript::AtLocation( Scriptable* Sender, Trigger* parameters) + { + Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); + if ( (tar->Pos.x==parameters->pointParameter.x) && + (tar->Pos.y==parameters->pointParameter.y) ) { + return 1; + } + return 0; + } + int GameScript::NearLocation(Scriptable* Sender, Trigger* parameters) { *************** *** 5604,5607 **** --- 5634,5663 ---- } + int GameScript::PCCanSeePoint( Scriptable* /*Sender*/, Trigger* parameters) + { + Map* map = core->GetGame()->GetCurrentArea(); + if (map->IsVisible(parameters->pointParameter, false) ) { + return 1; + } + return 0; + } + + //i'm clueless about this trigger + int GameScript::StuffGlobalRandom( Scriptable* Sender, Trigger* parameters) + { + unsigned int max=parameters->int0Parameter+1; + ieDword Value; + if (max) { + Value = RandomNumValue%max; + } else { + Value = RandomNumValue; + } + SetVariable( Sender, parameters->string0Parameter, Value ); + if (Value) { + return 1; + } + return 0; + } + //------------------------------------------------------------- // Action Functions *************** *** 9396,9397 **** --- 9452,9465 ---- Sender->CurrentAction = NULL; } + + //these are stored in the Game structure i guess + void GameScript::SetMazeEasier(Scriptable* /*Sender*/, Action* /*parameters*/) + { + printf("Easier\n"); + } + + void GameScript::SetMazeHarder(Scriptable* /*Sender*/, Action* /*parameters*/) + { + printf("Harder\n"); + } + Index: GameScript.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.h,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** GameScript.h 27 May 2005 17:10:02 -0000 1.179 --- GameScript.h 27 May 2005 21:55:31 -0000 1.180 *************** *** 707,710 **** --- 707,711 ---- static int AreaRestDisabled(Scriptable* Sender, Trigger* parameter); static int AreaType(Scriptable* Sender, Trigger* parameter); + static int AtLocation(Scriptable* Sender, Trigger* parameter); static int BitCheck(Scriptable* Sender, Trigger* parameters); static int BitCheckExact(Scriptable* Sender, Trigger* parameters); *************** *** 750,753 **** --- 751,755 ---- static int GlobalAndGlobal_Trigger(Scriptable* Sender, Trigger* parameters); static int GlobalBAndGlobal_Trigger(Scriptable* Sender, Trigger* parameters); + static int GlobalBAndGlobalExact(Scriptable* Sender, Trigger* parameters); static int GlobalBitGlobal_Trigger(Scriptable* Sender, Trigger* parameters); static int GlobalGT(Scriptable* Sender, Trigger* parameters); *************** *** 864,867 **** --- 866,870 ---- static int PartyHasItemIdentified(Scriptable* Sender, Trigger* parameters); static int PartyMemberDied(Scriptable* Sender, Trigger* parameters); + static int PCCanSeePoint(Scriptable* Sender, Trigger* parameters); static int PCInStore(Scriptable* Sender, Trigger* parameters); static int Proficiency(Scriptable* Sender, Trigger* parameters); *************** *** 882,885 **** --- 885,889 ---- static int Specifics(Scriptable* Sender, Trigger* parameters); static int StateCheck(Scriptable* Sender, Trigger* parameters); + static int StuffGlobalRandom(Scriptable* Sender, Trigger* parameters); static int SubRace(Scriptable* Sender, Trigger* parameters); static int TargetUnreachable(Scriptable* Sender, Trigger* parameters); *************** *** 1133,1136 **** --- 1137,1142 ---- static void SetLeavePartyDialogFile(Scriptable* Sender, Action* parameters); static void SetMasterArea(Scriptable* Sender, Action* parameters); + static void SetMazeEasier(Scriptable* Sender, Action* parameters); + static void SetMazeHarder(Scriptable* Sender, Action* parameters); static void SetMoraleAI(Scriptable* Sender, Action* parameters); static void SetMusic(Scriptable* Sender, Action* parameters); |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:34
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/bg1 Modified Files: GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUIWORLD.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUIWORLD.py 4 Dec 2004 12:33:42 -0000 1.1 --- GUIWORLD.py 27 May 2005 20:03:53 -0000 1.2 *************** *** 27,79 **** import GemRB from GUIDefines import * ContainerWindow = None FormationWindow = None ReformPartyWindow = None ! def OpenContainerWindow (): ! global ContainerWindow ! GemRB.HideGUI () ! if ContainerWindow: ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("OtherWindow", -1) ! GemRB.UnhideGUI () return GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! GemRB.SetVar ("OtherWindow", Window) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller groound, scroller personal # 54 - encumbrance ! encumbrance = '10\n255' ! Button = GemRB.GetControl (Window, 54) ! GemRB.SetText (Window, Button, encumbrance) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) ! party_gold = GemRB.GameGetPartyGold () ! Text = GemRB.GetControl (Window, 0x10000036) ! GemRB.SetText (Window, Text, str (party_gold)) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenContainerWindow") GemRB.UnhideGUI () def OpenReformPartyWindow (): global ReformPartyWindow ! GemRB.HideGUI () ! if ReformPartyWindow: GemRB.UnloadWindow (ReformPartyWindow) ReformPartyWindow = None --- 27,310 ---- import GemRB from GUIDefines import * + from GUICommon import CloseOtherWindow + from GUICommonWindows import SetEncumbranceLabels ContainerWindow = None + ContinueWindow = None FormationWindow = None ReformPartyWindow = None + OldActionsWindow = None + OldMessageWindow = None + Container = None ! def CloseContinueWindow (): ! global ContinueWindow, OldActionsWindow ! if ContinueWindow == None: ! return ! GemRB.UnloadWindow (ContinueWindow) ! GemRB.SetVar ("ActionsWindow", OldActionsWindow) ! ContinueWindow = None ! OldActionsWindow = None ! GemRB.UnhideGUI () ! ! def OpenEndMessageWindow (): ! global ContinueWindow, OldActionsWindow ! ! GemRB.HideGUI () ! ! if ContinueWindow: ! return ! ! GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! ! #end dialog ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9371) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", -1) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! def OpenContinueMessageWindow (): ! global ContinueWindow, OldActionsWindow ! ! GemRB.HideGUI () ! ! if ContinueWindow: ! return ! ! GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! ! #continue ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9372) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", 0) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! ! def CloseContainerWindow (): ! global OldActionsWindow, OldMessageWindow, ContainerWindow ! ! if ContainerWindow == None: ! return ! ! GemRB.HideGUI () ! ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("ActionsWindow", OldActionsWindow) ! GemRB.SetVar ("MessageWindow", OldMessageWindow) ! Table = GemRB.LoadTable ("containr") ! row = Container['Type'] ! tmp = GemRB.GetTableValue (Table, row, 2) ! #play closing sound if applicable ! if tmp!='*': ! GemRB.PlaySound (tmp) ! ! #it is enough to close here ! GemRB.UnloadTable (Table) ! ! GemRB.UnhideGUI () ! ! ! def UpdateContainerWindow (): ! global Container ! ! Window = ContainerWindow ! ! pc = GemRB.GameGetFirstSelectedPC () ! SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) ! ! party_gold = GemRB.GameGetPartyGold () ! Text = GemRB.GetControl (Window, 0x10000036) ! GemRB.SetText (Window, Text, str (party_gold)) ! ! Container = GemRB.GetContainer(0) #will use first selected pc anyway ! LeftCount = Container['ItemCount'] ! ScrollBar = GemRB.GetControl (Window, 52) ! Count = LeftCount/3 ! if Count<1: ! Count=1 ! GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) ! ! inventory_slots = GemRB.GetSlots (pc, 0x8000) ! RightCount = len(inventory_slots) ! ScrollBar = GemRB.GetControl (Window, 53) ! Count = RightCount/2 ! if Count<1: ! Count=1 ! GemRB.SetVarAssoc (Window, ScrollBar, "RightTopIndex", Count) ! RedrawContainerWindow () ! ! ! def RedrawContainerWindow (): ! Window = ContainerWindow ! ! LeftTopIndex = GemRB.GetVar ("LeftTopIndex") * 3 ! LeftIndex = GemRB.GetVar ("LeftIndex") ! RightTopIndex = GemRB.GetVar ("RightTopIndex") * 2 ! RightIndex = GemRB.GetVar ("RightIndex") ! LeftCount = Container['ItemCount'] ! pc = GemRB.GameGetFirstSelectedPC () ! inventory_slots = GemRB.GetSlots (pc, 0x8000) ! RightCount = len(inventory_slots) ! ! for i in range(6): ! #this is an autoselected container, but we could use PC too ! Slot = GemRB.GetContainerItem (0, i+LeftTopIndex) ! Button = GemRB.GetControl (Window, i) ! if Slot != None: ! Item = GemRB.GetItem (Slot['ItemResRef']) ! GemRB.SetVarAssoc (Window, Button, "LeftIndex", LeftTopIndex+i) ! GemRB.SetItemIcon (Window, Button, Slot['ItemResRef'],0) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) ! GemRB.SetTooltip (Window, Button, Slot['ItemName']) ! else: ! GemRB.SetVarAssoc (Window, Button, "LeftIndex", -1) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) ! GemRB.SetTooltip (Window, Button, "") ! ! ! for i in range(4): ! if i+RightTopIndex<RightCount: ! Slot = GemRB.GetSlotItem (pc, inventory_slots[i+RightTopIndex]) ! else: ! Slot = None ! Button = GemRB.GetControl (Window, i+10) ! if Slot!=None: ! Item = GemRB.GetItem (Slot['ItemResRef']) ! GemRB.SetVarAssoc (Window, Button, "RightIndex", RightTopIndex+i) ! GemRB.SetItemIcon (Window,Button, Slot['ItemResRef'],0) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) ! #is this needed? ! #Slot = GemRB.GetItem(Slot['ItemResRef']) ! #GemRB.SetTooltip (Window, Button, Slot['ItemName']) ! else: ! GemRB.SetVarAssoc (Window, Button, "RightIndex", -1) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) ! GemRB.SetTooltip (Window, Button, "") ! ! ! def OpenContainerWindow (): ! global OldActionsWindow, OldMessageWindow ! global ContainerWindow, Container ! ! if ContainerWindow: return + GemRB.HideGUI () + GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! OldMessageWindow = GemRB.GetVar ("MessageWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! GemRB.SetVar ("MessageWindow", -1) ! ! pc = GemRB.GameGetFirstSelectedPC() ! Container = GemRB.GetContainer(0) ! ! # Gears (time) when options pane is down ! Button = GemRB.GetControl (Window, 62) ! GemRB.SetAnimation (Window, Button, "CGEAR") ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ANIMATED, OP_SET) ! GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller ground, scroller personal # 54 - encumbrance ! for i in range(6): ! Button = GemRB.GetControl (Window, i) ! GemRB.SetVarAssoc (Window, Button, "LeftIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "TakeItemContainer") ! for i in range(4): ! Button = GemRB.GetControl (Window, i+10) ! GemRB.SetVarAssoc (Window, Button, "RightIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DropItemContainer") ! ! # left scrollbar ! ScrollBar = GemRB.GetControl (Window, 52) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! # right scrollbar ! ScrollBar = GemRB.GetControl (Window, 53) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! Label = GemRB.CreateLabel (Window, 0x10000043, 323,14,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) ! ! Button = GemRB.GetControl (Window, 50) ! GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) ! Table = GemRB.LoadTable ("containr") ! row = Container['Type'] ! tmp = GemRB.GetTableValue (Table, row, 0) ! if tmp!='*': ! GemRB.PlaySound (tmp) ! tmp = GemRB.GetTableValue (Table, row, 1) ! if tmp!='*': ! GemRB.SetButtonSprites (Window, Button, tmp, 0, 0, 0, 0, 0 ) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LeaveContainer") + GemRB.SetVar ("LeftTopIndex", 0) + GemRB.SetVar ("RightTopIndex", 0) + UpdateContainerWindow () GemRB.UnhideGUI () + + #doing this way it will inform the core system too, which in turn will call + #CloseContainerWindow () + def LeaveContainer (): + GemRB.LeaveContainer() + + def DropItemContainer (): + RightIndex = GemRB.GetVar ("RightIndex") + if RightIndex<0: + return + + #we need to get the right slot number + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + if RightIndex >= len(inventory_slots): + return + GemRB.ChangeContainerItem (0, inventory_slots[RightIndex], 0) + UpdateContainerWindow () + + + def TakeItemContainer (): + LeftIndex = GemRB.GetVar ("LeftIndex") + if LeftIndex<0: + return + if LeftIndex >= Container['ItemCount']: + return + GemRB.ChangeContainerItem (0, LeftIndex, 1) + UpdateContainerWindow () + + def OpenReformPartyWindow (): global ReformPartyWindow ! GemRB.HideGUI () ! if ReformPartyWindow: GemRB.UnloadWindow (ReformPartyWindow) ReformPartyWindow = None *************** *** 105,111 **** def OpenFormationWindow (): global FormationWindow - GemRB.HideGUI () ! if FormationWindow: GemRB.UnloadWindow (FormationWindow) FormationWindow = None --- 336,342 ---- def OpenFormationWindow (): global FormationWindow ! if CloseOtherWindow (OpenFormationWindow): ! GemRB.HideGUI () GemRB.UnloadWindow (FormationWindow) FormationWindow = None *************** *** 116,119 **** --- 347,351 ---- return + GemRB.HideGUI () GemRB.LoadWindowPack (GetWindowPack()) FormationWindow = Window = GemRB.LoadWindow (27) *************** *** 157,161 **** formation = GemRB.GetVar ("SelectedFormation") - print "FORMATION:", formation if last_formation != None and last_formation != formation: Button = GemRB.GetControl (Window, last_formation) --- 389,392 ---- *************** *** 172,175 **** --- 403,411 ---- if width == 800: return "GUIW08" + if width == 1024: + return "GUIW10" + if width == 1280: + return "GUIW12" + #default return "GUIW" |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:33
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/bg2 Modified Files: GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUIWORLD.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GUIWORLD.py 25 May 2005 19:51:47 -0000 1.10 --- GUIWORLD.py 27 May 2005 20:03:54 -0000 1.11 *************** *** 123,126 **** --- 123,133 ---- Window = ContainerWindow + pc = GemRB.GameGetFirstSelectedPC () + SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) + + party_gold = GemRB.GameGetPartyGold () + Text = GemRB.GetControl (Window, 0x10000036) + GemRB.SetText (Window, Text, str (party_gold)) + Container = GemRB.GetContainer(0) #will use first selected pc anyway LeftCount = Container['ItemCount'] *************** *** 131,135 **** GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) - pc = GemRB.GameGetFirstSelectedPC () inventory_slots = GemRB.GetSlots (pc, 0x8000) RightCount = len(inventory_slots) --- 138,141 ---- *************** *** 244,253 **** Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) - SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) - - party_gold = GemRB.GameGetPartyGold () - Text = GemRB.GetControl (Window, 0x10000036) - GemRB.SetText (Window, Text, str (party_gold)) - Button = GemRB.GetControl (Window, 50) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) --- 250,253 ---- |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:33
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/how Modified Files: GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how/GUIWORLD.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUIWORLD.py 12 Dec 2004 18:19:47 -0000 1.1 --- GUIWORLD.py 27 May 2005 20:03:54 -0000 1.2 *************** *** 28,75 **** from GUIDefines import * from GUICommon import CloseOtherWindow ContainerWindow = None FormationWindow = None ReformPartyWindow = None - def OpenContainerWindow (): - global ContainerWindow GemRB.HideGUI () ! if ContainerWindow: ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("OtherWindow", -1) ! GemRB.UnhideGUI () return GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! GemRB.SetVar ("OtherWindow", Window) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller groound, scroller personal # 54 - encumbrance ! encumbrance = '10\n255' ! Button = GemRB.GetControl (Window, 54) ! GemRB.SetText (Window, Button, encumbrance) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) ! party_gold = GemRB.GameGetPartyGold () ! Text = GemRB.GetControl (Window, 0x10000036) ! GemRB.SetText (Window, Text, str (party_gold)) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenContainerWindow") GemRB.UnhideGUI () def OpenReformPartyWindow (): global ReformPartyWindow --- 28,305 ---- from GUIDefines import * from GUICommon import CloseOtherWindow + from GUICommonWindows import SetEncumbranceLabels ContainerWindow = None + ContinueWindow = None FormationWindow = None ReformPartyWindow = None + OldActionsWindow = None + OldMessageWindow = None + Container = None + + def CloseContinueWindow (): + global ContinueWindow, OldActionsWindow + + if ContinueWindow == None: + return + GemRB.UnloadWindow (ContinueWindow) + GemRB.SetVar ("ActionsWindow", OldActionsWindow) + ContinueWindow = None + OldActionsWindow = None + GemRB.UnhideGUI () + + + def OpenEndMessageWindow (): + global ContinueWindow, OldActionsWindow GemRB.HideGUI () ! if ContinueWindow: ! return ! GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! ! #end dialog ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9371) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", -1) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! def OpenContinueMessageWindow (): ! global ContinueWindow, OldActionsWindow ! ! GemRB.HideGUI () ! ! if ContinueWindow: return GemRB.LoadWindowPack (GetWindowPack()) + ContinueWindow = Window = GemRB.LoadWindow (9) + OldActionsWindow = GemRB.GetVar ("ActionsWindow") + GemRB.SetVar ("ActionsWindow", Window) + + #continue + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 9372) + GemRB.SetVarAssoc (Window, Button, "DialogChoose", 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") + + GemRB.UnhideGUI () + + + def CloseContainerWindow (): + global OldActionsWindow, OldMessageWindow, ContainerWindow + + if ContainerWindow == None: + return + + GemRB.HideGUI () + + GemRB.UnloadWindow (ContainerWindow) + ContainerWindow = None + GemRB.SetVar ("ActionsWindow", OldActionsWindow) + GemRB.SetVar ("MessageWindow", OldMessageWindow) + Table = GemRB.LoadTable ("containr") + row = Container['Type'] + tmp = GemRB.GetTableValue (Table, row, 2) + #play closing sound if applicable + if tmp!='*': + GemRB.PlaySound (tmp) + + #it is enough to close here + GemRB.UnloadTable (Table) + + GemRB.UnhideGUI () + + + def UpdateContainerWindow (): + global Container + + Window = ContainerWindow + + pc = GemRB.GameGetFirstSelectedPC () + SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) + + party_gold = GemRB.GameGetPartyGold () + Text = GemRB.GetControl (Window, 0x10000036) + GemRB.SetText (Window, Text, str (party_gold)) + + Container = GemRB.GetContainer(0) #will use first selected pc anyway + LeftCount = Container['ItemCount'] + ScrollBar = GemRB.GetControl (Window, 52) + Count = LeftCount/3 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) + + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + ScrollBar = GemRB.GetControl (Window, 53) + Count = RightCount/2 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "RightTopIndex", Count) + RedrawContainerWindow () + + + def RedrawContainerWindow (): + Window = ContainerWindow + + LeftTopIndex = GemRB.GetVar ("LeftTopIndex") * 3 + LeftIndex = GemRB.GetVar ("LeftIndex") + RightTopIndex = GemRB.GetVar ("RightTopIndex") * 2 + RightIndex = GemRB.GetVar ("RightIndex") + LeftCount = Container['ItemCount'] + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + + for i in range(6): + #this is an autoselected container, but we could use PC too + Slot = GemRB.GetContainerItem (0, i+LeftTopIndex) + Button = GemRB.GetControl (Window, i) + if Slot != None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "LeftIndex", LeftTopIndex+i) + GemRB.SetItemIcon (Window, Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "LeftIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + for i in range(4): + if i+RightTopIndex<RightCount: + Slot = GemRB.GetSlotItem (pc, inventory_slots[i+RightTopIndex]) + else: + Slot = None + Button = GemRB.GetControl (Window, i+10) + if Slot!=None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "RightIndex", RightTopIndex+i) + GemRB.SetItemIcon (Window,Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #is this needed? + #Slot = GemRB.GetItem(Slot['ItemResRef']) + #GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "RightIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + def OpenContainerWindow (): + global OldActionsWindow, OldMessageWindow + global ContainerWindow, Container + + if ContainerWindow: + return + + GemRB.HideGUI () + + GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! OldMessageWindow = GemRB.GetVar ("MessageWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! GemRB.SetVar ("MessageWindow", -1) ! ! pc = GemRB.GameGetFirstSelectedPC() ! Container = GemRB.GetContainer(0) ! ! # Gears (time) when options pane is down ! Button = GemRB.GetControl (Window, 62) ! GemRB.SetAnimation (Window, Button, "CGEAR") ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ANIMATED, OP_SET) ! GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller ground, scroller personal # 54 - encumbrance ! for i in range(6): ! Button = GemRB.GetControl (Window, i) ! GemRB.SetVarAssoc (Window, Button, "LeftIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "TakeItemContainer") ! for i in range(4): ! Button = GemRB.GetControl (Window, i+10) ! GemRB.SetVarAssoc (Window, Button, "RightIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DropItemContainer") ! ! # left scrollbar ! ScrollBar = GemRB.GetControl (Window, 52) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! # right scrollbar ! ScrollBar = GemRB.GetControl (Window, 53) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! Label = GemRB.CreateLabel (Window, 0x10000043, 323,14,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) ! ! Button = GemRB.GetControl (Window, 50) ! GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) ! Table = GemRB.LoadTable ("containr") ! row = Container['Type'] ! tmp = GemRB.GetTableValue (Table, row, 0) ! if tmp!='*': ! GemRB.PlaySound (tmp) ! tmp = GemRB.GetTableValue (Table, row, 1) ! if tmp!='*': ! GemRB.SetButtonSprites (Window, Button, tmp, 0, 0, 0, 0, 0 ) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LeaveContainer") + GemRB.SetVar ("LeftTopIndex", 0) + GemRB.SetVar ("RightTopIndex", 0) + UpdateContainerWindow () GemRB.UnhideGUI () + + #doing this way it will inform the core system too, which in turn will call + #CloseContainerWindow () + def LeaveContainer (): + GemRB.LeaveContainer() + + def DropItemContainer (): + RightIndex = GemRB.GetVar ("RightIndex") + if RightIndex<0: + return + #we need to get the right slot number + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + if RightIndex >= len(inventory_slots): + return + GemRB.ChangeContainerItem (0, inventory_slots[RightIndex], 0) + UpdateContainerWindow () + + + def TakeItemContainer (): + LeftIndex = GemRB.GetVar ("LeftIndex") + if LeftIndex<0: + return + + if LeftIndex >= Container['ItemCount']: + return + GemRB.ChangeContainerItem (0, LeftIndex, 1) + UpdateContainerWindow () + + def OpenReformPartyWindow (): global ReformPartyWindow *************** *** 159,163 **** formation = GemRB.GetVar ("SelectedFormation") - print "FORMATION:", formation if last_formation != None and last_formation != formation: Button = GemRB.GetControl (Window, last_formation) --- 389,392 ---- |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:06
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/plugins/Core Modified Files: Interface.cpp Interface.h Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: Interface.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.cpp,v retrieving revision 1.311 retrieving revision 1.312 diff -C2 -d -r1.311 -r1.312 *** Interface.cpp 26 May 2005 17:48:04 -0000 1.311 --- Interface.cpp 27 May 2005 20:03:56 -0000 1.312 *************** *** 3291,3292 **** --- 3291,3303 ---- } + int Interface::CanMoveItem(CREItem *item) + { + if (item->Flags & IE_INV_ITEM_UNDROPPABLE) + return 0; + //not gold, we allow only one single coin ResRef, this is good + //for all of the original games + if (strnicmp(item->ItemResRef, GoldResRef, 8 ) ) + return 1; + //gold, returns the gold value (stack size) + return item->Usages[0]; + } Index: Interface.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.h,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** Interface.h 19 May 2005 14:56:17 -0000 1.154 --- Interface.h 27 May 2005 20:03:56 -0000 1.155 *************** *** 421,424 **** --- 421,427 ---- /** returns a cursor sprite (not cached) */ Sprite2D *GetCursorSprite(); + /** returns 0 for unmovable, -1 for movable items, otherwise it + returns gold value! */ + int CanMoveItem(CREItem *item); private: bool LoadConfig(void); |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:05
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/plugins/GUIScript Modified Files: GUIScript.cpp Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.313 retrieving revision 1.314 diff -C2 -d -r1.313 -r1.314 *** GUIScript.cpp 26 May 2005 19:43:45 -0000 1.313 --- GUIScript.cpp 27 May 2005 20:03:56 -0000 1.314 *************** *** 3835,3849 **** } if (action) { //get stuff from container - int slot = actor->inventory.FindCandidateSlot( SLOT_INVENTORY, 0); - if (slot<0) { //actually we should return something here! - Py_INCREF( Py_None ); - return Py_None; - } if (Slot<0 || Slot>=(int) container->inventory.GetSlotCount()) { return RuntimeError("Invalid Container slot!"); } ! CREItem *item = container->inventory.GetItem(Slot); if (!item) { Py_INCREF( Py_None ); return Py_None; --- 3835,3866 ---- } + CREItem *item; + int res; + if (action) { //get stuff from container if (Slot<0 || Slot>=(int) container->inventory.GetSlotCount()) { return RuntimeError("Invalid Container slot!"); } ! ! res = core->CanMoveItem(container->inventory.GetSlotItem(Slot) ); ! if (!res) { //cannot move ! printf("Cannot move item, it is undroppable!\n"); ! Py_INCREF( Py_None ); ! return Py_None; ! } ! ! item = container->inventory.GetItem(Slot); if (!item) { + printf("Cannot move item, there is something weird!\n"); + Py_INCREF( Py_None ); + return Py_None; + } + if (res!=-1) { //it is gold! + goto item_is_gold; + } + + int slot = actor->inventory.FindCandidateSlot( SLOT_INVENTORY, 0); + if (slot<0) { //actually we should return something here! + printf("Cannot move item, inventory is full!\n"); Py_INCREF( Py_None ); return Py_None; *************** *** 3851,3859 **** actor->inventory.SetSlotItem(item, slot); } else { //put stuff in container, simple! ! CREItem *item = actor->inventory.RemoveItem(Slot); if (!item) { Py_INCREF( Py_None ); return Py_None; } container->AddItem(item); } --- 3868,3889 ---- actor->inventory.SetSlotItem(item, slot); } else { //put stuff in container, simple! ! res = core->CanMoveItem(actor->inventory.GetSlotItem(Slot) ); ! if (!res) { //cannot move ! printf("Cannot move item, it is undroppable!\n"); ! Py_INCREF( Py_None ); ! return Py_None; ! } ! ! item = actor->inventory.RemoveItem(Slot); if (!item) { + printf("Cannot move item, there is something weird!\n"); Py_INCREF( Py_None ); return Py_None; } + + if (res!=-1) { //it is gold! + goto item_is_gold; + } + container->AddItem(item); } *************** *** 3861,3864 **** --- 3891,3899 ---- Py_INCREF( Py_None ); return Py_None; + item_is_gold: //we take gold! + core->GetGame()->PartyGold += res; + delete item; + Py_INCREF( Py_None ); + return Py_None; } |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:04
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/tob Modified Files: GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob/GUIWORLD.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GUIWORLD.py 25 May 2005 19:51:48 -0000 1.10 --- GUIWORLD.py 27 May 2005 20:03:55 -0000 1.11 *************** *** 123,126 **** --- 123,133 ---- Window = ContainerWindow + pc = GemRB.GameGetFirstSelectedPC () + SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) + + party_gold = GemRB.GameGetPartyGold () + Text = GemRB.GetControl (Window, 0x10000036) + GemRB.SetText (Window, Text, str (party_gold)) + Container = GemRB.GetContainer(0) #will use first selected pc anyway LeftCount = Container['ItemCount'] *************** *** 131,135 **** GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) - pc = GemRB.GameGetFirstSelectedPC () inventory_slots = GemRB.GetSlots (pc, 0x8000) RightCount = len(inventory_slots) --- 138,141 ---- *************** *** 244,253 **** Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) - SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) - - party_gold = GemRB.GameGetPartyGold () - Text = GemRB.GetControl (Window, 0x10000036) - GemRB.SetText (Window, Text, str (party_gold)) - Button = GemRB.GetControl (Window, 50) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) --- 250,253 ---- |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:04
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/iwd2 Modified Files: GUICommonWindows.py GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/GUICommonWindows.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GUICommonWindows.py 21 Mar 2005 23:09:33 -0000 1.8 --- GUICommonWindows.py 27 May 2005 20:03:55 -0000 1.9 *************** *** 311,312 **** --- 311,341 ---- return + def SetEncumbranceLabels (Window, Label, Label2, pc): + # encumbrance + # Loading tables of modifications + Table = GemRB.LoadTable("strmod") + TableEx = GemRB.LoadTable("strmodex") + # Getting the character's strength + sstr = GemRB.GetPlayerStat (pc, IE_STR) + ext_str = GemRB.GetPlayerStat (pc, IE_STREXTRA) + + max_encumb = GemRB.GetTableValue(Table, sstr, 3) + GemRB.GetTableValue(TableEx, ext_str, 3) + encumbrance = GemRB.GetPlayerStat (pc, IE_ENCUMBRANCE) + + Label = GemRB.GetControl (Window, 0x10000043) + GemRB.SetText (Window, Label, str(encumbrance) + ":") + + Label2 = GemRB.GetControl (Window, 0x10000044) + GemRB.SetText (Window, Label2, str(max_encumb) + ":") + ratio = (0.0 + encumbrance) / max_encumb + if ratio > 1.0: + GemRB.SetLabelTextColor (Window, Label, 255, 0, 0) + GemRB.SetLabelTextColor (Window, Label2, 255, 0, 0) + elif ratio > 0.8: + GemRB.SetLabelTextColor (Window, Label, 255, 255, 0) + GemRB.SetLabelTextColor (Window, Label2, 255, 0, 0) + else: + GemRB.SetLabelTextColor (Window, Label, 255, 255, 255) + GemRB.SetLabelTextColor (Window, Label2, 255, 0, 0) + return + Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/GUIWORLD.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUIWORLD.py 21 Mar 2005 23:10:46 -0000 1.1 --- GUIWORLD.py 27 May 2005 20:03:55 -0000 1.2 *************** *** 21,25 **** # GUIW.py - scripts to control some windows from GUIWORLD winpack ! # except of Actions, Portrait, Options and Dialog windows ################################################### --- 21,25 ---- # GUIW.py - scripts to control some windows from GUIWORLD winpack ! # except of Portrait, Portrait, Options and Dialog windows ################################################### *************** *** 27,61 **** import GemRB from GUIDefines import * ContainerWindow = None FormationWindow = None ReformPartyWindow = None - def OpenContainerWindow (): - global ContainerWindow GemRB.HideGUI () ! if ContainerWindow: ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("OtherWindow", -1) ! GemRB.UnhideGUI () return GemRB.LoadWindowPack (GetWindowPack()) ! ContainerWindow = Window = GemRB.LoadWindow (8) ! GemRB.SetVar ("OtherWindow", Window) ! # 0 - 5 - Ground Item ! # 10 - 13 - Personal Item ! # 50 hand ! # 52, 53 scroller groound, scroller personal ! # 54 - encumbrance ! encumbrance = '10\n255' ! Button = GemRB.GetControl (Window, 54) ! GemRB.SetText (Window, Button, encumbrance) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) party_gold = GemRB.GameGetPartyGold () --- 27,128 ---- import GemRB from GUIDefines import * + from GUICommon import CloseOtherWindow + from GUICommonWindows import SetEncumbranceLabels ContainerWindow = None + ContinueWindow = None FormationWindow = None ReformPartyWindow = None + OldPortraitWindow = None + OldMessageWindow = None + Container = None + + def CloseContinueWindow (): + global ContinueWindow, OldPortraitWindow + + if ContinueWindow == None: + return + GemRB.UnloadWindow (ContinueWindow) + GemRB.SetVar ("PortraitWindow", OldPortraitWindow) + ContinueWindow = None + OldPortraitWindow = None + GemRB.UnhideGUI () + + + def OpenEndMessageWindow (): + global ContinueWindow, OldPortraitWindow GemRB.HideGUI () ! if ContinueWindow: ! return ! GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldPortraitWindow = GemRB.GetVar ("PortraitWindow") ! GemRB.SetVar ("PortraitWindow", Window) ! ! #end dialog ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9371) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", -1) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! def OpenContinueMessageWindow (): ! global ContinueWindow, OldPortraitWindow ! ! GemRB.HideGUI () ! ! if ContinueWindow: return GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldPortraitWindow = GemRB.GetVar ("PortraitWindow") ! GemRB.SetVar ("PortraitWindow", Window) ! #continue ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9372) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", 0) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! def CloseContainerWindow (): ! global OldPortraitWindow, OldMessageWindow, ContainerWindow ! ! if ContainerWindow == None: ! return ! ! GemRB.HideGUI () ! ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("PortraitWindow", OldPortraitWindow) ! GemRB.SetVar ("MessageWindow", OldMessageWindow) ! Table = GemRB.LoadTable ("containr") ! row = Container['Type'] ! tmp = GemRB.GetTableValue (Table, row, 2) ! #play closing sound if applicable ! if tmp!='*': ! GemRB.PlaySound (tmp) ! ! #it is enough to close here ! GemRB.UnloadTable (Table) ! ! GemRB.UnhideGUI () ! ! ! def UpdateContainerWindow (): ! global Container ! ! Window = ContainerWindow ! ! pc = GemRB.GameGetFirstSelectedPC () ! SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) party_gold = GemRB.GameGetPartyGold () *************** *** 63,74 **** GemRB.SetText (Window, Text, str (party_gold)) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenContainerWindow") GemRB.UnhideGUI () def OpenReformPartyWindow (): global ReformPartyWindow --- 130,303 ---- GemRB.SetText (Window, Text, str (party_gold)) + Container = GemRB.GetContainer(0) #will use first selected pc anyway + LeftCount = Container['ItemCount'] + ScrollBar = GemRB.GetControl (Window, 52) + Count = LeftCount / 5 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) + + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + ScrollBar = GemRB.GetControl (Window, 53) + Count = RightCount / 2 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "RightTopIndex", Count) + RedrawContainerWindow () + + + def RedrawContainerWindow (): + Window = ContainerWindow + + LeftTopIndex = GemRB.GetVar ("LeftTopIndex") * 5 + LeftIndex = GemRB.GetVar ("LeftIndex") + RightTopIndex = GemRB.GetVar ("RightTopIndex") * 2 + RightIndex = GemRB.GetVar ("RightIndex") + LeftCount = Container['ItemCount'] + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + + for i in range(6): + #this is an autoselected container, but we could use PC too + Slot = GemRB.GetContainerItem (0, i+LeftTopIndex) + Button = GemRB.GetControl (Window, i) + if Slot != None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "LeftIndex", LeftTopIndex+i) + GemRB.SetItemIcon (Window, Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "LeftIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + for i in range(4): + if i+RightTopIndex<RightCount: + Slot = GemRB.GetSlotItem (pc, inventory_slots[i+RightTopIndex]) + else: + Slot = None + Button = GemRB.GetControl (Window, i+10) + if Slot!=None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "RightIndex", RightTopIndex+i) + GemRB.SetItemIcon (Window,Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #is this needed? + #Slot = GemRB.GetItem(Slot['ItemResRef']) + #GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "RightIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + def OpenContainerWindow (): + global OldPortraitWindow, OldMessageWindow + global ContainerWindow, Container + + if ContainerWindow: + return + + GemRB.HideGUI () + + GemRB.LoadWindowPack (GetWindowPack()) + ContainerWindow = Window = GemRB.LoadWindow (8) + OldPortraitWindow = GemRB.GetVar ("PortraitWindow") + OldMessageWindow = GemRB.GetVar ("MessageWindow") + GemRB.SetVar ("PortraitWindow", Window) + GemRB.SetVar ("MessageWindow", -1) + + pc = GemRB.GameGetFirstSelectedPC() + Container = GemRB.GetContainer(0) + + # 0 - 9 - Ground Item + # 10 - 13 - Personal Item + # 50 container icon + # 52, 53 scroller ground, scroller personal + # 54 - encumbrance + + for i in range(10): + Button = GemRB.GetControl (Window, i) + GemRB.SetVarAssoc (Window, Button, "LeftIndex", i) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "TakeItemContainer") + + for i in range(4): + Button = GemRB.GetControl (Window, i+10) + GemRB.SetVarAssoc (Window, Button, "RightIndex", i) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DropItemContainer") + + # left scrollbar + ScrollBar = GemRB.GetControl (Window, 52) + GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") + + # right scrollbar + ScrollBar = GemRB.GetControl (Window, 53) + GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") + + Label = GemRB.CreateLabel (Window, 0x10000043, 323,14,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) + Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) + + Button = GemRB.GetControl (Window, 50) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + Table = GemRB.LoadTable ("containr") + row = Container['Type'] + tmp = GemRB.GetTableValue (Table, row, 0) + if tmp!='*': + GemRB.PlaySound (tmp) + tmp = GemRB.GetTableValue (Table, row, 1) + if tmp!='*': + GemRB.SetButtonSprites (Window, Button, tmp, 0, 0, 0, 0, 0 ) + # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LeaveContainer") + GemRB.SetVar ("LeftTopIndex", 0) + GemRB.SetVar ("RightTopIndex", 0) + UpdateContainerWindow () GemRB.UnhideGUI () + + #doing this way it will inform the core system too, which in turn will call + #CloseContainerWindow () + def LeaveContainer (): + GemRB.LeaveContainer() + + def DropItemContainer (): + RightIndex = GemRB.GetVar ("RightIndex") + + print RightIndex + if RightIndex<0: + return + + #we need to get the right slot number + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + if RightIndex >= len(inventory_slots): + return + GemRB.ChangeContainerItem (0, inventory_slots[RightIndex], 0) + UpdateContainerWindow () + + + def TakeItemContainer (): + LeftIndex = GemRB.GetVar ("LeftIndex") + print LeftIndex + + if LeftIndex<0: + return + if LeftIndex >= Container['ItemCount']: + return + GemRB.ChangeContainerItem (0, LeftIndex, 1) + UpdateContainerWindow () + + def OpenReformPartyWindow (): global ReformPartyWindow *************** *** 105,111 **** def OpenFormationWindow (): global FormationWindow - GemRB.HideGUI () ! if FormationWindow: GemRB.UnloadWindow (FormationWindow) FormationWindow = None --- 334,340 ---- def OpenFormationWindow (): global FormationWindow ! if CloseOtherWindow (OpenFormationWindow): ! GemRB.HideGUI () GemRB.UnloadWindow (FormationWindow) FormationWindow = None *************** *** 116,119 **** --- 345,349 ---- return + GemRB.HideGUI () GemRB.LoadWindowPack (GetWindowPack()) FormationWindow = Window = GemRB.LoadWindow (27) *************** *** 157,161 **** formation = GemRB.GetVar ("SelectedFormation") - print "FORMATION:", formation if last_formation != None and last_formation != formation: Button = GemRB.GetControl (Window, last_formation) --- 387,390 ---- |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 20:04:03
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9160/GUIScripts/iwd Modified Files: GUIWORLD.py Log Message: Implemented taking gold items (they go to partygold) Implemented undroppable items Implemented iwd2 OpenContainerWindow Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd/GUIWORLD.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUIWORLD.py 12 Dec 2004 18:19:47 -0000 1.1 --- GUIWORLD.py 27 May 2005 20:03:55 -0000 1.2 *************** *** 28,75 **** from GUIDefines import * from GUICommon import CloseOtherWindow ContainerWindow = None FormationWindow = None ReformPartyWindow = None - def OpenContainerWindow (): - global ContainerWindow GemRB.HideGUI () ! if ContainerWindow: ! GemRB.UnloadWindow (ContainerWindow) ! ContainerWindow = None ! GemRB.SetVar ("OtherWindow", -1) ! GemRB.UnhideGUI () return GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! GemRB.SetVar ("OtherWindow", Window) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller groound, scroller personal # 54 - encumbrance ! encumbrance = '10\n255' ! Button = GemRB.GetControl (Window, 54) ! GemRB.SetText (Window, Button, encumbrance) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) ! party_gold = GemRB.GameGetPartyGold () ! Text = GemRB.GetControl (Window, 0x10000036) ! GemRB.SetText (Window, Text, str (party_gold)) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenContainerWindow") GemRB.UnhideGUI () def OpenReformPartyWindow (): global ReformPartyWindow --- 28,305 ---- from GUIDefines import * from GUICommon import CloseOtherWindow + from GUICommonWindows import SetEncumbranceLabels ContainerWindow = None + ContinueWindow = None FormationWindow = None ReformPartyWindow = None + OldActionsWindow = None + OldMessageWindow = None + Container = None + + def CloseContinueWindow (): + global ContinueWindow, OldActionsWindow + + if ContinueWindow == None: + return + GemRB.UnloadWindow (ContinueWindow) + GemRB.SetVar ("ActionsWindow", OldActionsWindow) + ContinueWindow = None + OldActionsWindow = None + GemRB.UnhideGUI () + + + def OpenEndMessageWindow (): + global ContinueWindow, OldActionsWindow GemRB.HideGUI () ! if ContinueWindow: ! return ! GemRB.LoadWindowPack (GetWindowPack()) ! ContinueWindow = Window = GemRB.LoadWindow (9) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! ! #end dialog ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetText (Window, Button, 9371) ! GemRB.SetVarAssoc (Window, Button, "DialogChoose", -1) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") ! ! GemRB.UnhideGUI () ! ! def OpenContinueMessageWindow (): ! global ContinueWindow, OldActionsWindow ! ! GemRB.HideGUI () ! ! if ContinueWindow: return GemRB.LoadWindowPack (GetWindowPack()) + ContinueWindow = Window = GemRB.LoadWindow (9) + OldActionsWindow = GemRB.GetVar ("ActionsWindow") + GemRB.SetVar ("ActionsWindow", Window) + + #continue + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 9372) + GemRB.SetVarAssoc (Window, Button, "DialogChoose", 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseContinueWindow") + + GemRB.UnhideGUI () + + + def CloseContainerWindow (): + global OldActionsWindow, OldMessageWindow, ContainerWindow + + if ContainerWindow == None: + return + + GemRB.HideGUI () + + GemRB.UnloadWindow (ContainerWindow) + ContainerWindow = None + GemRB.SetVar ("ActionsWindow", OldActionsWindow) + GemRB.SetVar ("MessageWindow", OldMessageWindow) + Table = GemRB.LoadTable ("containr") + row = Container['Type'] + tmp = GemRB.GetTableValue (Table, row, 2) + #play closing sound if applicable + if tmp!='*': + GemRB.PlaySound (tmp) + + #it is enough to close here + GemRB.UnloadTable (Table) + + GemRB.UnhideGUI () + + + def UpdateContainerWindow (): + global Container + + Window = ContainerWindow + + pc = GemRB.GameGetFirstSelectedPC () + SetEncumbranceLabels( Window, 0x10000043, 0x10000044, pc) + + party_gold = GemRB.GameGetPartyGold () + Text = GemRB.GetControl (Window, 0x10000036) + GemRB.SetText (Window, Text, str (party_gold)) + + Container = GemRB.GetContainer(0) #will use first selected pc anyway + LeftCount = Container['ItemCount'] + ScrollBar = GemRB.GetControl (Window, 52) + Count = LeftCount/3 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "LeftTopIndex", Count) + + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + ScrollBar = GemRB.GetControl (Window, 53) + Count = RightCount/2 + if Count<1: + Count=1 + GemRB.SetVarAssoc (Window, ScrollBar, "RightTopIndex", Count) + RedrawContainerWindow () + + + def RedrawContainerWindow (): + Window = ContainerWindow + + LeftTopIndex = GemRB.GetVar ("LeftTopIndex") * 3 + LeftIndex = GemRB.GetVar ("LeftIndex") + RightTopIndex = GemRB.GetVar ("RightTopIndex") * 2 + RightIndex = GemRB.GetVar ("RightIndex") + LeftCount = Container['ItemCount'] + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + RightCount = len(inventory_slots) + + for i in range(6): + #this is an autoselected container, but we could use PC too + Slot = GemRB.GetContainerItem (0, i+LeftTopIndex) + Button = GemRB.GetControl (Window, i) + if Slot != None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "LeftIndex", LeftTopIndex+i) + GemRB.SetItemIcon (Window, Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "LeftIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + for i in range(4): + if i+RightTopIndex<RightCount: + Slot = GemRB.GetSlotItem (pc, inventory_slots[i+RightTopIndex]) + else: + Slot = None + Button = GemRB.GetControl (Window, i+10) + if Slot!=None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetVarAssoc (Window, Button, "RightIndex", RightTopIndex+i) + GemRB.SetItemIcon (Window,Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #is this needed? + #Slot = GemRB.GetItem(Slot['ItemResRef']) + #GemRB.SetTooltip (Window, Button, Slot['ItemName']) + else: + GemRB.SetVarAssoc (Window, Button, "RightIndex", -1) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetTooltip (Window, Button, "") + + + def OpenContainerWindow (): + global OldActionsWindow, OldMessageWindow + global ContainerWindow, Container + + if ContainerWindow: + return + + GemRB.HideGUI () + + GemRB.LoadWindowPack (GetWindowPack()) ContainerWindow = Window = GemRB.LoadWindow (8) ! OldActionsWindow = GemRB.GetVar ("ActionsWindow") ! OldMessageWindow = GemRB.GetVar ("MessageWindow") ! GemRB.SetVar ("ActionsWindow", Window) ! GemRB.SetVar ("MessageWindow", -1) ! ! pc = GemRB.GameGetFirstSelectedPC() ! Container = GemRB.GetContainer(0) ! ! # Gears (time) when options pane is down ! Button = GemRB.GetControl (Window, 62) ! GemRB.SetAnimation (Window, Button, "CGEAR") ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ANIMATED, OP_SET) ! GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_LOCKED) # 0 - 5 - Ground Item # 10 - 13 - Personal Item # 50 hand ! # 52, 53 scroller ground, scroller personal # 54 - encumbrance ! for i in range(6): ! Button = GemRB.GetControl (Window, i) ! GemRB.SetVarAssoc (Window, Button, "LeftIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "TakeItemContainer") ! for i in range(4): ! Button = GemRB.GetControl (Window, i+10) ! GemRB.SetVarAssoc (Window, Button, "RightIndex", i) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "DropItemContainer") ! ! # left scrollbar ! ScrollBar = GemRB.GetControl (Window, 52) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! # right scrollbar ! ScrollBar = GemRB.GetControl (Window, 53) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RedrawContainerWindow") ! ! Label = GemRB.CreateLabel (Window, 0x10000043, 323,14,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! Label = GemRB.CreateLabel (Window, 0x10000044, 323,20,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) ! ! Button = GemRB.GetControl (Window, 50) ! GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) ! Table = GemRB.LoadTable ("containr") ! row = Container['Type'] ! tmp = GemRB.GetTableValue (Table, row, 0) ! if tmp!='*': ! GemRB.PlaySound (tmp) ! tmp = GemRB.GetTableValue (Table, row, 1) ! if tmp!='*': ! GemRB.SetButtonSprites (Window, Button, tmp, 0, 0, 0, 0, 0 ) # Done Button = GemRB.GetControl (Window, 51) GemRB.SetText (Window, Button, 1403) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LeaveContainer") + GemRB.SetVar ("LeftTopIndex", 0) + GemRB.SetVar ("RightTopIndex", 0) + UpdateContainerWindow () GemRB.UnhideGUI () + + #doing this way it will inform the core system too, which in turn will call + #CloseContainerWindow () + def LeaveContainer (): + GemRB.LeaveContainer() + + def DropItemContainer (): + RightIndex = GemRB.GetVar ("RightIndex") + if RightIndex<0: + return + #we need to get the right slot number + pc = GemRB.GameGetFirstSelectedPC () + inventory_slots = GemRB.GetSlots (pc, 0x8000) + if RightIndex >= len(inventory_slots): + return + GemRB.ChangeContainerItem (0, inventory_slots[RightIndex], 0) + UpdateContainerWindow () + + + def TakeItemContainer (): + LeftIndex = GemRB.GetVar ("LeftIndex") + if LeftIndex<0: + return + + if LeftIndex >= Container['ItemCount']: + return + GemRB.ChangeContainerItem (0, LeftIndex, 1) + UpdateContainerWindow () + + def OpenReformPartyWindow (): global ReformPartyWindow *************** *** 159,163 **** formation = GemRB.GetVar ("SelectedFormation") - print "FORMATION:", formation if last_formation != None and last_formation != formation: Button = GemRB.GetControl (Window, last_formation) --- 389,392 ---- |
From: Laszlo Toth <avenger_teambg@us...> - 2005-05-27 17:10:15
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4942 Modified Files: GameScript.cpp GameScript.h Log Message: added SubRace trigger Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.274 retrieving revision 1.275 diff -C2 -d -r1.274 -r1.275 *** GameScript.cpp 26 May 2005 19:43:37 -0000 1.274 --- GameScript.cpp 27 May 2005 17:10:00 -0000 1.275 *************** *** 262,265 **** --- 262,266 ---- {"specifics", GameScript::Specifics,0}, {"statecheck", GameScript::StateCheck,0}, + {"subrace", GameScript::SubRace,0}, {"targetunreachable", GameScript::TargetUnreachable,0}, {"team", GameScript::Team,0}, *************** *** 3419,3422 **** --- 3420,3433 ---- } + int GameScript::SubRace(Scriptable* Sender, Trigger* parameters) + { + Scriptable* scr = GetActorFromObject( Sender, parameters->objectParameter ); + if (!scr || scr->Type != ST_ACTOR) { + return 0; + } + Actor* actor = (Actor*)scr; + return ID_Subrace( actor, parameters->int0Parameter); + } + int GameScript::IsTeamBitOn(Scriptable* Sender, Trigger* parameters) { Index: GameScript.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.h,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** GameScript.h 26 May 2005 19:43:41 -0000 1.178 --- GameScript.h 27 May 2005 17:10:02 -0000 1.179 *************** *** 882,885 **** --- 882,886 ---- static int Specifics(Scriptable* Sender, Trigger* parameters); static int StateCheck(Scriptable* Sender, Trigger* parameters); + static int SubRace(Scriptable* Sender, Trigger* parameters); static int TargetUnreachable(Scriptable* Sender, Trigger* parameters); static int Team(Scriptable* Sender, Trigger* parameters); |