gemrb / gemrb

GemRB is a portable open-source implementation of Bioware’s Infinity Engine.

Home Page:https://gemrb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Perfectionist's hell

burner1024 opened this issue · comments

Bug description

Misaligned buttons in main menu.

Steps to reproduce

  1. Start BG2.
  2. Click on Quit/Options. Watch the button borders.

Expected behavior

Aligned! Buttons! Aligned!

Screenshots

Open the attached files in full screen mode, and flip between them fast.
menu.zip

GemRB version (check as many as you know apply)

  • master as of this issue
  • 0.9.2
  • 0.9.1
  • 0.9.0

Video Driver (check as many as you know apply)

  • SDL1.2
  • SDL2 built with USE_OPENGL_BACKEND
  • SDL2 without USE_OPENGL_BACKEND

I looked in GUIscripts, but didn't find any coordinates.

we have some functions to do this sort of alignment in the CharGen. You can do something similar here.

def PositionCharGenWin(window, offset = 0):
global CharGenWindow
CGFrame = CharGenWindow.GetFrame()
WFrame = window.GetFrame()
window.SetPos(CGFrame['x'], offset + CGFrame['y'] + (CGFrame['h'] - WFrame['h']))

That seems to be for the position of the window itself, not buttons within the window?

The problem is that the window is not aligned with the one below it. Buttons are almost always baked into the CHU background.

I think something else is going on here.
Here's comparison of the main screen, original and GemRB. Different screenshot resolution, but same game resolution, fullscreen view should align them perfectly.
As far as I understand, there are no overlaid windows here, just the one main window.
3 buttons are off.

cmp.zip

right, the problem I thought you were describing we fixed in #433 using the technique I described.

But you can see for yourself in NI that the "buttons" are baked into the CHU background. The background is GUIVERB.MOS

image

As far as I understand, there are no overlaid windows here, just the one main window.

No, that is not correct. You can see for yourself in NI or look in the Start2.py script.

Yes, I saw the CHUs and #433, and Start2.py.

GUIVERB.MOS is the 2-button overlay:
Captura desde 2024-02-17 01-02-34
It gets loaded in Exit procedure ("Are you sure you want to exit?"):

def ExitPress():
#quit subwindow
QuitWindow = GemRB.LoadWindow (3, "START")

The screenshots I shared in the previous message are the main 6-button screen, START.MOS:
Captura desde 2024-02-17 01-03-11

def OnLoad():
StartWindow = GemRB.LoadWindow (0, "START")

If it were positioning, the issues would've been present on the whole top, side, bottom like here.
But in this case the misalignment is present in diagonally opposite buttons:
1

I don't see how this can be happening due to bad window positioning with these MOS files in any combination. Unless I grossly misunderstand how it all works.

Do I understand correctly that there should be like a 1px gap? We don't modify the MOS, so the only way that could happen is with something being overlaid on top.

And that something can clearly be the buttons themselves, without an extra window, since they have their own background.

The 3 affected buttons should be 1-2px to the left.
If you open these in fullscreen and flip between them, you can easily see the buttons shifting.

Sure, but that doesn't change my point, it's the buttons (as in CHU elements) that are mispositioned. Since the GUI was hardcoded in the original, there may have been some manual moving done, but like Brad pointed out, we can as easily move the buttons ourselves.

There's nothing in the CHU that would provide any extra positional offsets.

Yeah, turns out buttons are also windows, and can be moved individually.

Is there supposed to be no intellisense on this or something's wrong with my environment?

Captura desde 2024-02-17 14-28-38

Buttons are most definitely not windows.
I don't know how intellisense does its completion, so can't comment on that.