From: Laszlo T. <ave...@us...> - 2011-08-12 16:59:34
|
gemrb: Infinity Engine emulator The branch master has been updated via 5899178ec85a92b80e7a150e47d7f8f356198427 (commit) via c44886c093bb54ec880a690b53424b4c40be6d1e (commit) Summary of changes: gemrb/GUIScripts/GUISTORE.py | 2 ++ gemrb/GUIScripts/bg2/GUICommonWindows.py | 3 +-- gemrb/GUIScripts/ie_sounds.py | 16 ++++++++++++++++ gemrb/override/bg1/defsound.2da | 2 +- gemrb/override/bg2/defsound.2da | 1 + gemrb/override/how/defsound.2da | 2 +- gemrb/override/iwd/defsound.2da | 2 +- gemrb/override/iwd2/defsound.2da | 2 +- gemrb/override/pst/defsound.2da | 2 +- gemrb/plugins/GUIScript/GUIScript.cpp | 19 +++++++++++++------ 10 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 gemrb/GUIScripts/ie_sounds.py from ba9980ca6a8376e9878e0655c18534952840ecdb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=5899178ec85a92b80e7a150e47d7f8f356198427 commit 5899178ec85a92b80e7a150e47d7f8f356198427 Author: Avenger <ave...@so...> Date: Fri Aug 12 18:57:49 2011 +0200 fixed formation tooltip hotkey play sound when item sold (use defsound.2da) diff --git a/gemrb/GUIScripts/GUISTORE.py b/gemrb/GUIScripts/GUISTORE.py index d9334fa..8c531cf 100644 --- a/gemrb/GUIScripts/GUISTORE.py +++ b/gemrb/GUIScripts/GUISTORE.py @@ -28,6 +28,7 @@ import GUICommonWindows from GUIDefines import * from ie_stats import * from ie_slots import * +from ie_sounds import * StoreWindow = None MessageWindow = None @@ -749,6 +750,7 @@ def SellPressed (): GemRB.ChangeStoreItem (pc, inventory_slots[Slot], SHOP_SELL) GemRB.GameSetPartyGold (GemRB.GameGetPartyGold ()+SellSum) + GemRB.PlaySound(DEF_SOLD) UpdateStoreShoppingWindow () return diff --git a/gemrb/GUIScripts/bg2/GUICommonWindows.py b/gemrb/GUIScripts/bg2/GUICommonWindows.py index ef3514d..9524539 100644 --- a/gemrb/GUIScripts/bg2/GUICommonWindows.py +++ b/gemrb/GUIScripts/bg2/GUICommonWindows.py @@ -255,8 +255,7 @@ def GroupControls (): Button.SetVarAssoc ("Formation", i) Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, GUICommon.SelectFormation) Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, SetupFormation) - str = GemRB.GetString (4935) - Button.SetTooltip ("F%d - %s"%(8+i,str) ) + Button.SetTooltip (4935, 8+i) return def OpenActionsWindowControls (Window): diff --git a/gemrb/GUIScripts/ie_sounds.py b/gemrb/GUIScripts/ie_sounds.py new file mode 100644 index 0000000..b6e7bc1 --- /dev/null +++ b/gemrb/GUIScripts/ie_sounds.py @@ -0,0 +1,16 @@ +#predefined sound indices + +DEF_OPEN = 0 +DEF_CLOSE = 1 +DEF_HOPEN = 2 +DEF_HCLOSE = 3 +DEF_BUTTON1 = 4 +DEF_BUTTON2 = 5 +DEF_BUTTON3 = 6 +DEF_OPENFAIL = 7 +DEF_CLOSEFAIL = 8 +DEF_ITEM_GONE = 9 +DEF_SECRET = 10 +DEF_PICKLOCK = 11 +#reserved 12-24 +DEF_SOLD = 25 diff --git a/gemrb/override/bg1/defsound.2da b/gemrb/override/bg1/defsound.2da index c7e225d..240aceb 100644 --- a/gemrb/override/bg1/defsound.2da +++ b/gemrb/override/bg1/defsound.2da @@ -26,4 +26,4 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B - +SOLD ACT_03D diff --git a/gemrb/override/bg2/defsound.2da b/gemrb/override/bg2/defsound.2da index 9feadef..58e47b2 100644 --- a/gemrb/override/bg2/defsound.2da +++ b/gemrb/override/bg2/defsound.2da @@ -26,4 +26,5 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B +SOLD ACT_03D diff --git a/gemrb/override/how/defsound.2da b/gemrb/override/how/defsound.2da index c1a2e98..000ce3f 100644 --- a/gemrb/override/how/defsound.2da +++ b/gemrb/override/how/defsound.2da @@ -26,4 +26,4 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B - +SOLD ACT_03D diff --git a/gemrb/override/iwd/defsound.2da b/gemrb/override/iwd/defsound.2da index c1a2e98..000ce3f 100644 --- a/gemrb/override/iwd/defsound.2da +++ b/gemrb/override/iwd/defsound.2da @@ -26,4 +26,4 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B - +SOLD ACT_03D diff --git a/gemrb/override/iwd2/defsound.2da b/gemrb/override/iwd2/defsound.2da index c1a2e98..000ce3f 100644 --- a/gemrb/override/iwd2/defsound.2da +++ b/gemrb/override/iwd2/defsound.2da @@ -26,4 +26,4 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B - +SOLD ACT_03D diff --git a/gemrb/override/pst/defsound.2da b/gemrb/override/pst/defsound.2da index f2972ee..42f52d2 100644 --- a/gemrb/override/pst/defsound.2da +++ b/gemrb/override/pst/defsound.2da @@ -26,4 +26,4 @@ LIGHTNING2 AMB_E13B LIGHTNING3 AMB_E13F RAIN AMB_E11 SNOW AMB_E02B - +SOLD Z_COIN1 http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=c44886c093bb54ec880a690b53424b4c40be6d1e commit c44886c093bb54ec880a690b53424b4c40be6d1e Author: Avenger <ave...@so...> Date: Fri Aug 12 18:48:47 2011 +0200 GemRB.PlaySound can play defsound.2da entries diff --git a/gemrb/plugins/GUIScript/GUIScript.cpp b/gemrb/plugins/GUIScript/GUIScript.cpp index bd7ae0b..1efe431 100644 --- a/gemrb/plugins/GUIScript/GUIScript.cpp +++ b/gemrb/plugins/GUIScript/GUIScript.cpp @@ -3630,8 +3630,9 @@ static PyObject* GemRB_VerbalConstant(PyObject * /*self*/, PyObject* args) PyDoc_STRVAR( GemRB_PlaySound__doc, -"PlaySound(SoundResource, xpos, ypos, type)\n\n" -"Plays a Sound." ); +"PlaySound(SoundResource[, xpos, ypos, type])\n" +"PlaySound(DefSoundIndex)\n\n" +"Plays a Sound identified by resource reference or defsound.2da index.\n" ); static PyObject* GemRB_PlaySound(PyObject * /*self*/, PyObject* args) { @@ -3639,12 +3640,18 @@ static PyObject* GemRB_PlaySound(PyObject * /*self*/, PyObject* args) int xpos = 0; int ypos = 0; unsigned int flags = 1; //GEM_SND_RELATIVE + int index; - if (!PyArg_ParseTuple( args, "z|iii", &ResRef, &xpos, &ypos, &flags )) { - return AttributeError( GemRB_PlaySound__doc ); - } + if (PyArg_ParseTuple( args, "i", &index) ) { + core->PlaySound(index); + } else { + PyErr_Clear(); //clearing the exception + if (!PyArg_ParseTuple( args, "z|iii", &ResRef, &xpos, &ypos, &flags )) { + return AttributeError( GemRB_PlaySound__doc ); + } - core->GetAudioDrv()->Play( ResRef, xpos, ypos, flags ); + core->GetAudioDrv()->Play( ResRef, xpos, ypos, flags ); + } Py_INCREF( Py_None ); return Py_None; ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |