Skip to content

[demo] Add the PortraitWindow  #1282

@m7600

Description

@m7600

I'm trying to add the PortraitWindow to the demo. I modified guiw.chu with DLTCEP (added a window and a control button). Here is what I added to MessageWindow.py:

	PortraitWindow = GemRB.LoadWindow(10, GUICommon.GetWindowPack(), WINDOW_RIGHT)
	PortraitWindow.AddAlias("PORTWIN")
	
	PortraitButton = MessageWindow.GetControl (24)

But when I run the demo, only the windows are visible, the player screen is completely black, as you can see in the attached screenshot. In the terminal, I get this error:

[Python/ERROR]: Traceback (most recent call last):
[Python/ERROR]:   File "/usr/local/share/gemrb/GUIScripts/GUICommonWindows.py", line 1721, in UpdatePortraitWindow
[Python/ERROR]:     Button.SetAction(lambda btn, val, pc=pcID: GemRB.GameControlLocateActor(pc), IE_ACT_MOUSE_ENTER);
[Python/ERROR]: AttributeError: 'NoneType' object has no attribute 'SetAction'

I'm obviously doing something wrong.

Here's a screenshot (I need to fine-tune the position of the portrait and the size of the column, it's a work in progress for now).

Screenshot from 2021-06-12 02-10-22

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions