Jump to content
Sign in to follow this  

0.8.3 event handling broken?

Recommended Posts

I've been trying to get GemRB 0.8.3 working on a Debian 8 system, it seems to "mostly work", but character customization is weirdly broken.


I'm using BG2+TOB with a small number of mods. AFAICT the only mods that should affect the GUI are the widescreen mod and 10pp.


After getting my custom portraits re-named properly I'm able to get them to show up in the lists, but clicking on a portrait in either list does not update the portrait display or enable the "Done" button. It does update the color of the displayed filename that I clicked on, so I'm fairly sure that it is recognizing mouse input on some level.


I think I've tracked the problem down to the IE_GUI_TEXTAREA_ON_CHANGE event handler set in GUIRECCommon.py (lines 239 and 249 in the current GIT version).


I added a few "print" statements to GUIRECCommon.py to see what was happening. It appears that the PortraitList1.SetEvent() call is being made in OpenCustomPortraitWindow(), but the LargeCustomPortrait() function is never called. I've tried various combinations of mouse & keyboard input on the portrait list widget.


I'm having a similar problem with custom scripts (none of my custom .bs scripts show up on the list), but it may be unrelated.


I've tried with both the 0.8.3 source tarball and the latest code from github (as of a few hours ago) with identical results.


I'm assuming that this would be in the FAQ/FAP or TODO pages if custom scripts & portraits were broken for everybody, so I'm guessing something is wrong with my build and/or environment. Does anybody have any suggestions as to what may be going wrong?


I have't included the output logs since gemrb didn't log any errors and AFAICT the only output related to the problem is from the "print" statments that I added. I can post the full output if you think that would help.


Technical info:

OS: Debian 8.1

Compiler: gcc/g++ 4.9

Python version: 2.7.9

Game: Baldur's Gate 2 + TOB (not EE) installed from original CDs

Mods: widescreen, 10pp, G3 tweak pack, G3 fix pack, ascension, hidden kits, spell50, tactics, underrepresented items, banterpack, item upgrades

Share this post

Link to post

No, likely everyone has this issue, it's just the these features are rarely used. Thanks for the detailed report!


For scripts, we currently load only those mentioned in SCRPDESC.2da. If you add yours to it, they'll show up.

For the portraits, I have no idea off the top of my head. There is a known regression that causes glitches in another window in a similar scenario, but just quickly peeking, I wouldn't say this is the same thing.


I can look into it next week.

Share this post

Link to post

It looks like it may have been a simple typo in GUIRECCommon.py. Changing the event type constant passed to SetEvent from IE_GUI_TEXTAREA_ON_CHANGE to IE_GUI_TEXTAREA_ON_SELECT solves the custom portrait problem for me :)


Incase the above is unclear, here's a diff showing exactly what I changed to get it working:

--- ../gemrb-0.8.3/gemrb/GUIScripts/GUIRECCommon.py    2015-07-24 16:23:18.000000000 -0300
+++ gemrb/GUIScripts/GUIRECCommon.py    2015-07-31 14:45:34.000000000 -0300
@@ -235,14 +235,14 @@
    # Portrait List Large
    PortraitList1 = SubSubCustomizeWindow.GetControl (2)
    RowCount1 = PortraitList1.ListResources (CHR_PORTRAITS, 0)
-    PortraitList1.SetEvent (IE_GUI_TEXTAREA_ON_CHANGE, LargeCustomPortrait)
+    PortraitList1.SetEvent (IE_GUI_TEXTAREA_ON_SELECT, LargeCustomPortrait)
    GemRB.SetVar ("Row1", RowCount1)
    PortraitList1.SetVarAssoc ("Row1",RowCount1)

    # Portrait List Small
    PortraitList2 = SubSubCustomizeWindow.GetControl (3)
    RowCount2 = PortraitList2.ListResources (CHR_PORTRAITS, 1)
-    PortraitList2.SetEvent (IE_GUI_TEXTAREA_ON_CHANGE, SmallCustomPortrait)
+    PortraitList2.SetEvent (IE_GUI_TEXTAREA_ON_SELECT, SmallCustomPortrait)
    GemRB.SetVar ("Row2", RowCount2)
    PortraitList2.SetVarAssoc ("Row2",RowCount2)

Share this post

Link to post

cool, thanks. Another regression from the text rewrite - there was no IE_GUI_TEXTAREA_ON_SELECT event before.

Share this post

Link to post

The script customisation window now lists all scripts in the dir.

Share this post

Link to post
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...