There is a new version of the forums ready for testing. Please post here if you're willing to help test! We could also use the help of coders!

Author Topic: MODULE: CustomDialogGui 1.9  (Read 41144 times)

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • Best Innovation Award Winner 2021, for contributions to the ready-to-use UI designs and elements that mimic the most iconic designs we all know and love, most notably Tumbleweed Verbs and 9-verb MI Style UI, as well as additional UI helper modules such as CustomDialogGUI and ButtonHelper.
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.8 - AGS 3.5 Support
« Reply #120 on: 10 May 2022, 22:44 »
I've just pushed a new commit to the repo.
https://github.com/dkrey/ags_customdialog/blob/main/CustomDialogGui.asc

This fixes the issue at least for me. The problem was that the module needs parse all dialog options in advance to calculate the max gui width, before calculating the height of the individual dialog options.

*keeping fingers crossed*

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.8 - AGS 3.5 Support
« Reply #121 on: 11 May 2022, 21:46 »
This seems to (thus far) work! Thank you so much!

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • Best Innovation Award Winner 2021, for contributions to the ready-to-use UI designs and elements that mimic the most iconic designs we all know and love, most notably Tumbleweed Verbs and 9-verb MI Style UI, as well as additional UI helper modules such as CustomDialogGUI and ButtonHelper.
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.8.1 - AGS 3.5+ Support
« Reply #122 on: 13 May 2022, 21:04 »
yay, this was a tough nut to crack - I'm glad that it works now.

@eri0o:
About the +2 which I added to the borders. For some strange reasons, this extra space is needed or else I get some unwanted line wraps. For example the text  "option 1" fits in the row, but "option 2" will be wrapped -  maybe because I don't use a fixed width font? Adding two extra pixels gets rid of the problem - in a somewhat dirty way.

Anyway - I could spot any other bugs for the moment, so I've just published a new minor release.  And I still can't believe that the initial release is from 2008 :=
For a certain Ben304 game which never got released.

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.8.1 - AGS 3.5+ Support
« Reply #123 on: 13 May 2022, 22:18 »
There is a longstanding bug in AGS (it was pointed out as least as early as 2005) where the value returned by GetTextWidth is not the same as that used for line wrapping. Adding 1 is usually enough of a workaround, but if you're working with Text Overlays, TextWindow Controls, or certain functions, you may need to take additional padding values into account as well. If you read that thread, CW explains the ins and outs of it.
« Last Edit: 13 May 2022, 22:21 by Snarky »

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • Best Innovation Award Winner 2021, for contributions to the ready-to-use UI designs and elements that mimic the most iconic designs we all know and love, most notably Tumbleweed Verbs and 9-verb MI Style UI, as well as additional UI helper modules such as CustomDialogGUI and ButtonHelper.
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.8.1 - AGS 3.5+ Support
« Reply #124 on: 15 May 2022, 21:29 »
Ah okay - thanks for pointing me in that direction. At least now I know the reason behind adding 2 px :)

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • Best Innovation Award Winner 2021, for contributions to the ready-to-use UI designs and elements that mimic the most iconic designs we all know and love, most notably Tumbleweed Verbs and 9-verb MI Style UI, as well as additional UI helper modules such as CustomDialogGUI and ButtonHelper.
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.9
« Reply #125 on: 19 May 2022, 20:04 »
I had to publish a new version, because I forgot to remove a debugging fragment. So if you use 1.8.1 please upgrade to 1.9.
I also added the option to set a color for chosen dialog options.

Background on the debugging part:
I tried to see if resetting the scollstate works so I change the player's lightling level

Code: [Select]
  if (CDG.reset_scrollstate) {
    player.SetLightLevel(50);
//and so on...
So of course this has to be removed
« Last Edit: 19 May 2022, 20:05 by abstauber »

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.9
« Reply #126 on: 19 May 2022, 20:42 »
So I should just remove all instances of player.SetLightLevel?

(I ask because I added some extra code to set the position of the box based on the player position so it's not easy for me to just copy/paste the existing code)

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • Best Innovation Award Winner 2021, for contributions to the ready-to-use UI designs and elements that mimic the most iconic designs we all know and love, most notably Tumbleweed Verbs and 9-verb MI Style UI, as well as additional UI helper modules such as CustomDialogGUI and ButtonHelper.
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CustomDialogGui 1.9
« Reply #127 on: 19 May 2022, 20:51 »
So I should just remove all instances of player.SetLightLevel?
yup, that should do the trick.