The International Simutrans Forum

 

Author Topic: Refactoring of Display settings dialog class  (Read 629 times)

0 Members and 1 Guest are viewing this topic.

Offline shingoushori

  • *
  • Posts: 18
  • Languages: JP
Refactoring of Display settings dialog class
« on: September 14, 2019, 12:24:25 PM »
Hello everyone !
Let me propose the Refactoring of Display settings dialog class.
That is, Introducing enumeration into the button array of Display settings dialog class, for the benefit of easy modification.

Currently, buttons are managed with static id.
Therefore, there may be a conflict ids when merging the simutrans main repository with custom patch maintenance after being rejected by the forum, that's so heartbreaking.

And, this can be minimize size of buttons array.
Currently COLORS_MAX_BUTTONS is 26, This can be 18 with this refactoring. The array memory corresponding to this size difference are unused, I think.

Sorry if I have misunderstood.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4607
  • Languages: EN, DE, AT
Re: Refactoring of Display settings dialog class
« Reply #1 on: September 15, 2019, 11:27:32 AM »
Good idea!

My only complaint is style: in the source code, such constants are uppercase. Please use something like IDBTN_SCROLL_INVERSE.

Offline shingoushori

  • *
  • Posts: 18
  • Languages: JP
Re: Refactoring of Display settings dialog class
« Reply #2 on: September 16, 2019, 08:14:58 AM »
thanks for response!
My only complaint is style: in the source code, such constants are uppercase. Please use something like IDBTN_SCROLL_INVERSE.
I tried it, I hope it's done well.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Refactoring of Display settings dialog class
« Reply #3 on: October 02, 2019, 03:01:59 AM »
I think this dialog needs a deeper overhaul with tabs like the other settings. WIth a large theme, its height goes below my screen and there are of course no scrollbars ...

Anyway, in in r8831.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1237
    • Simutrans-BLOG
  • Languages: ES
Re: Refactoring of Display settings dialog class
« Reply #4 on: October 02, 2019, 11:50:19 AM »
I think this dialog needs a deeper overhaul with tabs like the other settings. WIth a large theme, its height goes below my screen and there are of course no scrollbars ...

Anyway, in in r8831.
That would definitely be great, and well imagine my poor resolution of "1024x600", I can not see the settings well even with the standard theme.  :o

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Refactoring of Display settings dialog class
« Reply #5 on: October 15, 2019, 12:20:14 AM »
Well, please try again the latest nightly above r8845.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1237
    • Simutrans-BLOG
  • Languages: ES
Re: Refactoring of Display settings dialog class
« Reply #6 on: October 15, 2019, 01:31:29 AM »
Well, please try again the latest nightly above r8845.
Wow wow, I really am very happy to see this gra improvement!, Now we who have small screens can play better!.  ;D ;D ;D ;D


One detail: I'm not sure if the window is now rescalable, but if so, it would be a good idea to add a "Auto rescaled" button like the one on the mini map, since as you can see in the image, it is impossible for my rescaling the window, since it is over the limits of my screen.
« Last Edit: October 15, 2019, 02:08:18 AM by Yona-TYT »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Refactoring of Display settings dialog class
« Reply #7 on: October 15, 2019, 07:34:29 AM »
I cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1237
    • Simutrans-BLOG
  • Languages: ES
Re: Refactoring of Display settings dialog class
« Reply #8 on: October 15, 2019, 08:21:37 AM »
I cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846
Thank you very much, this is a great help! .  ;D

I would like to mention (I apologize for not opening a new thread), there are other windows that have the same problem since they are scalable and sometimes you can go beyond the limits of the screen.

The highest priority in my humble opinion are: "Menssage Center", "Scenario Details" and the "Finance" window.

Regards !.  ;)

Offline Leartin at

  • Devotee
  • *
  • Posts: 1278
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Refactoring of Display settings dialog class
« Reply #9 on: October 15, 2019, 11:34:04 AM »
I cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846
Don't all dialogs now remember their size?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Refactoring of Display settings dialog class
« Reply #10 on: October 15, 2019, 11:47:45 AM »
No, unfourtunately it became even more chaotic sizewise. See my other post.