Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics menu UI #2566

Open
dmgreeny opened this issue Dec 10, 2024 · 8 comments
Open

Graphics menu UI #2566

dmgreeny opened this issue Dec 10, 2024 · 8 comments
Labels
GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker

Comments

@dmgreeny
Copy link
Collaborator

Untitled
So in Graphics menu I noticed 2 issues

  1. Strange dot above (-) symbol
  2. I remember that this text was on the right side and mirrored the other one on how far it should be from the edge, here it moved to the left which doesnt look good
@dmgreeny dmgreeny added Minor Severity: Minor < Major < Critical < Blocker GUI For graphical user interface labels Dec 10, 2024
@DevGeniusCode
Copy link

DevGeniusCode commented Dec 13, 2024

  1. Strange dot above (-) symbol

After researching the subject, I came up with the following findings:

There is an issue where a strange dot appears above the "-" symbol in certain text, especially when the text contains the letter "f" followed by a space. The extra pixels from the letter "f" seem to be transferred to the following space, causing an incorrect rendering of the text.

This issue specifically occurs when using the following configuration:

  • STATUS = ENABLED+WRAP_CENTERED
  • WINDOWTYPE = STATICTEXT (This issue sometimes occurs when combined with this)
  • Only with the letter "f" and does not affect other letters (at least in English).

Problem Behavior:

  • The text Toggle On/Off - Off to improve performance is rendered incorrectly, appearing as:
    Toggle On/Off '- Off 'to improve performance
  • The letter "f" appears to split, with extra pixels being placed after the space following it and displayed as an apostrophe.

Steps Taken:

  • I tested different control types, including CHECKBOX and various window types, and the issue persists in all cases.
  • I tried adding specific handling for the letter "f" in the thyme rendering process using the Render2DSentenceClass::Build_Sentence_Not_Centered function, Similar to the treatment of the & character.
    , but this did not resolve the issue.

Suspected Cause:

It seems that the issue is related to how the engine handles spacing after the letter "f". The rendering engine appears to incorrectly split the pixels of the letter "f" and position them after the space, rather than rendering the character as a whole. This behavior is especially noticeable when the ENABLED+WRAP_CENTERED configuration is used.

Suggested Fix:

  • An adjustment to the spacing calculation for the letter "f" could potentially solve this, ensuring that the pixels do not overflow into the space.
  • Further investigation is needed to understand how the engine handles text wrapping and the calculation of character widths, particularly when used in combination with the STATICTEXT window type and the ENABLED+WRAP_CENTERED status.

@DevGeniusCode
Copy link

DevGeniusCode commented Dec 13, 2024

Regarding the second issue you mentioned:

"I remember that this text was on the right side and mirrored the other one on how far it should be from the edge, here it moved to the left which doesn't look good."

I searched for screenshots online but couldn't find any examples where this text was aligned to the right. Technically, it is possible to move the text, but this won't help if the sentence length changes, for example, when translated into another language.
The issue arises because the text is displayed starting from the point defined from the left, not the right. There is no built-in support for right alignment, which could be very useful for languages like Arabic.

However, I did notice that for the PUSHBUTTON control/style, there is center alignment. This infrastructure could potentially be used to write code that adds support for right alignment.

In any case, if we want to "bypass" this issue and align it to the right, we would need to redefine the x point at line 5132, and also at line 5423 in the file Patch104pZH\GameFilesEdited\Window\Menus\OptionsMenu.wnd.

@dmgreeny
Copy link
Collaborator Author

Regarding the second issue you mentioned:

"I remember that this text was on the right side and mirrored the other one on how far it should be from the edge, here it moved to the left which doesn't look good."

I searched for screenshots online but couldn't find any examples where this text was aligned to the right. Technically, it is possible to move the text, but this won't help if the sentence length changes, for example, when translated into another language. The issue arises because the text is displayed starting from the point defined from the left, not the right. There is no built-in support for right alignment, which could be very useful for languages like Arabic.

However, I did notice that for the PUSHBUTTON control/style, there is center alignment. This infrastructure could potentially be used to write code that adds support for right alignment.

In any case, if we want to "bypass" this issue and align it to the right, we would need to redefine the x point at line 5132, and also at line 5423 in the file Patch104pZH\GameFilesEdited\Window\Menus\OptionsMenu.wnd.

Thank you for your great responses. It probably was in some version of the game from early 2000. I will check the biggest line for all localization for this instance and make adjustments by it, so that it would look good for all other languages but didnt cross the line.

@DevGeniusCode
Copy link

DevGeniusCode commented Dec 13, 2024

Thank you for your great responses. It probably was in some version of the game from early 2000. I will check the biggest line for all localization for this instance and make adjustments by it, so that it would look good for all other languages but didnt cross the line.

I'm currently working on centering the text using the field:
STATICTEXTDATA = CENTERED: 1;

I realized that centering the text around its start and end points can effectively address the issue of varying text lengths, making it look balanced regardless of the language. This might be a good solution to ensure alignment without crossing boundaries.

I want to improve a little more around here and I'll upload it.

image

@dmgreeny
Copy link
Collaborator Author

Thank you for your great responses. It probably was in some version of the game from early 2000. I will check the biggest line for all localization for this instance and make adjustments by it, so that it would look good for all other languages but didnt cross the line.

I'm currently working on centering the text using the field: STATICTEXTDATA = CENTERED: 1;

I realized that centering the text around its start and end points can effectively address the issue of varying text lengths, making it look balanced regardless of the language. This might be a good solution to ensure alignment without crossing boundaries.

I want to improve a little more around here and I'll upload it.

image

You're a real wizard. Looks great.

@DevGeniusCode
Copy link

You're a real wizard. Looks great.

Thank you! I'm new to the community. Are there any guidelines for redesigning elements?
How much freedom do I have in terms of redesigning, and how closely should I stick to the original design?
Or is the focus mainly on fixing symmetry issues?

@dmgreeny
Copy link
Collaborator Author

You're a real wizard. Looks great.

Thank you! I'm new to the community. Are there any guidelines for redesigning elements? How much freedom do I have in terms of redesigning, and how closely should I stick to the original design? Or is the focus mainly on fixing symmetry issues?

Well, Im a text editor and also new to the project. So if you want to have correct information, please contact @xezon on discord.

@xezon
Copy link
Collaborator

xezon commented Dec 13, 2024

How much freedom do I have in terms of redesigning, and how closely should I stick to the original design?

Regarding the overall menu, we have Discussion topic here where some notes were dumped:

How far we can go with polishing the menus depends on how far we can push it and classic players still like it.

Considering the success of the Control Bar Pro Addon, I expect there is some freedom, but generally it is wise to stay close to the original.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker
Projects
None yet
Development

No branches or pull requests

3 participants