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 41604 times)

eri0o

Re: MODULE: CustomDialogGui 1.8 - AGS 3.5 Support
« Reply #100 on: 03 May 2022, 13:47 »
Thanks for the update! It's a really useful module!

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 #101 on: 03 May 2022, 21:04 »
Very cool! I've been having a few niggly issues with this module so hopefully someone can help.

I have border images and a background image. Both the border and the background have a transparent color. The border displays just fine, but it looks like the background and the borders are overlapping (the spots where the transparent color gets darker). Normally I'd expect the borders to be drawn right on the outside of the background, but the bottom and right borders are being drawn *on* the background (or vice versa), and the background is extending further to the right and down than it should. Any ideas what is happening here?



I am using an autosized width and height with an anchor point of "top left."

My goal is for the background to be one continuous transparent color, with no overlapping (which creates those weird black spots).

Thanks!

-Dave
« Last Edit: 03 May 2022, 21:42 by Dave Gilbert »

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 #102 on: 04 May 2022, 10:27 »
Actually I've never tested the module with semi transparent borders yet :-[

I'll try to recreate the issue and hopefully this problem also arises in 320x200 .

@eri0o: Thanks :)
« Last Edit: 04 May 2022, 10:38 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.8 - AGS 3.5 Support
« Reply #103 on: 04 May 2022, 12:41 »
I could probably remove the transparent bits of the borders so the background fills up the whole thing, but any ideas why the background is extending *beyond* the borders? I feel like that shouldn’t happen.

I have a deadline of mid-June to get this done so if you don’t think you’ll have time before then I will try to find a workaround.

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 #104 on: 04 May 2022, 12:47 »
Actually, while I’ve got you, there is a second issue I’m having that’s been giving me some confusion.

I’m using the auto height and width, so the size of the dialog box is supposed to change depending on the number of options within the box. Sometimes the size is correct, and other times it is not.

Here's a video of what I am encountering (ignore the placeholder walk cycles and audio watermark!):


In this example, I perform these steps to reproduce the problem each time:
1 - talk to the old lady. Dialog box is displayed correctly.
2 - exit the dialog without selecting anything
3 - talk to the other character
4 - exit the dialog without selecting anything
5 - talk to the old lady again
6 - Dialog box is displayed INCORRECTLY.
7 - exit the dialog without selecting anything
8 - Talk to the old lady again.
9 - Dialog box is displayed correctly.

In this instance, there is only a small amount of blank space at the bottom on the window, but in other instances the blank area is much larger. There doesn't seem to be a rhyme or reason to it that I can see.

Any ideas on why this might be happening?

Thanks and hope all is well!

-Dave
« Last Edit: 04 May 2022, 13:04 by Dave Gilbert »

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 #105 on: 05 May 2022, 12:30 »
This looks like a variable isn't properly reset.
My daughter's birthday party will be tomorrow, so after I that I'll look into these issues.

Don't worry, I won't vanish without noticing ;)

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 #106 on: 05 May 2022, 20:15 »
Partial success!
I was able to fix the transparency issue. But I'm having trouble replicating the issue with the bottom border.



Could you give me some details on the dialog itself?

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 #107 on: 05 May 2022, 21:27 »
Thanks so much! Regarding replicating the issue, I can see the issue with the bottom border in the animated image your post! You can see the background color extends beyond the border to the right and down. Is that by design?

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 #108 on: 05 May 2022, 21:53 »
No that was on purpose and represents a fake drop shadow. With the bug present you would see differences in the lighting of borders.

That's the source for my transparency test


Here's a closeup - this should be accurate now.



What I meant was the "white space" below the last dialog option in your video. I'm having two dialogs with three visible options and I don't get any blank options or wrong heights.
« Last Edit: 05 May 2022, 22:01 by abstauber »

eri0o

Re: MODULE: CustomDialogGui 1.8 - AGS 3.5 Support
« Reply #109 on: 05 May 2022, 22:18 »
The dialog height of the last line, notice the space below, in the closeup, is different from the gif shown, if both are the same dialog, maybe this is the issue?

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 #110 on: 06 May 2022, 00:22 »
Oh I see! So that "dropshadow" is part of the border graphic and unrelated to the problem I'm having?

As for the blank space underneath the dialog, as I said sometimes it's just one extra space, other times several. I can't think of anything special or specific to my dialogs, although I do use some custom functions to remove and add dialog options. That could be related.

Here are the functions I created. Perhaps one of these is not playing nice with your module? Probably threeDialog() or setupDialog() if I had to guess. If you want a sample of one of my dialog scripts, let me know.

Quote
function setupDialog(this Dialog*)  // This tells the game what dialog is currently being run, called at the Dialog startup entry point
{
  game.show_single_dialog_option=1;
  currentDialog=this.ID;
}

function myOptionOn(int option) // turns a dialog option on
{

  dialog[currentDialog].SetOptionState(option, eOptionOn);
 
}

function myOptionOff(int option,  bool forever) //turns dialog option off
{

  if (forever==false)
    dialog[currentDialog].SetOptionState(option, eOptionOff);
  else
    dialog[currentDialog].SetOptionState(option, eOptionOffForever);
}

function oneDialog(int option) //remove all dialogs, then add a single one which plays right away.
{
    game.show_single_dialog_option=0;

  int x=1;
 dialog[currentDialog].SetOptionState(option, eOptionOn);
  while (x<=dialog[currentDialog].OptionCount)
  {
    if (x != option) dialog[currentDialog].SetOptionState(x, eOptionOff);
    x++;
  }
}

function threeDialog(int option1, int option2, int option3) //remove all dialogs, then add three to be displayed
{

    game.show_single_dialog_option=1;

  int x=1;
  while (x<=dialog[currentDialog].OptionCount)
  {
    dialog[currentDialog].SetOptionState(x, eOptionOff);
    x++;
  }
 
  dialog[currentDialog].SetOptionState(option1, eOptionOn);
  dialog[currentDialog].SetOptionState(option2, eOptionOn);
  dialog[currentDialog].SetOptionState(option3, eOptionOn);
}

« Last Edit: 06 May 2022, 00:31 by Dave Gilbert »

eri0o

Re: MODULE: CustomDialogGui 1.8 - AGS 3.5 Support
« Reply #111 on: 06 May 2022, 00:49 »
@abstauber

I noticed the width used is different in the functions  in the code here:
https://github.com/dkrey/ags_customdialog/blob/main/CustomDialogGui.asc#L237-L239


My guess is since the GetHeight uses a different width, it predicts a line break, but since the actual width used has 2 more pixels, they are enough for the line break to not happen and thus you keep the height assuming that line break.

I may have misunderstood, but this is the first guess I would use to explore this.

@Dave, can you remove the +2 in these lines and see if it solves?

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 #112 on: 06 May 2022, 16:59 »
I saw only one +2 in those lines. I removed it and the bug still happens.

edit: I also downloaded the updated version of the script to test the transparency issue, and that also still remains. The problem of the background sticking out one pixel beyond the border to the right and bottom is also still there.

Here is a link to the image files I'm using, if that helps. I am also using the autosize for height and width, using these parameters:

Code: [Select]
  this.border_top      = 15;
  this.border_bottom   = 5;
  this.border_left     = 30;
  this.border_right    = 30;
  this.border_visible  = true;
  this.border_color    = -1;

  // Background
  // set bg_img_transparency to -1 if you're using 32-bit graphics and
  // want to preserve the alpha channel 
  this.bg_img                = 6503;
  this.bg_img_scaling        = 0;
  this.bg_img_transparency   = -1;
  this.bg_color              = -1;

 
  // optional autosize, overrides your width and height setting
  // also overrides the position of your scrolling - arrows
  this.autosize_height       = true;
  this.autosize_width        = true;
  this.autosize_minheight    = 10;
  this.autosize_maxheight    = 1500;
  this.autosize_minwidth     = 300;
  this.autosize_maxwidth     = 900;
« Last Edit: 06 May 2022, 18:56 by Dave Gilbert »

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 - AGS 3.5 Support
« Reply #113 on: 06 May 2022, 19:24 »
Is it possible you imported the sprites for the bottom and right borders without preserving the alpha channel? Seems like that might cause it to appear like that in-game.

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 #114 on: 06 May 2022, 19:28 »
I imported them all at the same time and the top ones work fine, so that's doubtful. I imported them again just as a sanity check, and the bug remains. It definitely looks like the background is being painted underneath the border, and it extends one pixel beyond it to the right and bottom.


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 #115 on: 06 May 2022, 19:58 »
Wait! I set the background image scaling to 0 instead of 1. Now it works!



The extra line problem still remains, but at least the border looks correct now!

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 - AGS 3.5 Support
« Reply #116 on: 07 May 2022, 07:22 »
It still doesn't look quite right to me. The green border has a gap on the lower left side and a near-gap on the upper right side (right above/below the cut-off corner), and a "bright dot" where it looks like it's being drawn double for a couple of pixels on the lower right side. But maybe that's intentional, or at least baked into the sprite assets? But there's also a transparent horizontal line across the top, between the border and the text.
« Last Edit: 07 May 2022, 07:23 by Snarky »

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 #117 on: 07 May 2022, 14:03 »
It still doesn't look quite right to me. The green border has a gap on the lower left side and a near-gap on the upper right side (right above/below the cut-off corner), and a "bright dot" where it looks like it's being drawn double for a couple of pixels on the lower right side. But maybe that's intentional, or at least baked into the sprite assets? But there's also a transparent horizontal line across the top, between the border and the text.

The transparent horizontal line was due to an extra transparent pixel at the bottom of the top border graphics. Since the background image extended one pixel beyond where it was supposed to, I hadn't noticed. :D

The holes in the border corners are part of the images, but the stray dark/bright bits at the bottom right are definitely not.

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 #118 on: 08 May 2022, 19:01 »
I still dare to say, that the rendering of the gui itself is now fixed.

But I am now finally able to replicate the issue - although only with line wrapping dialog options.
Maybe if I fix this, it also fixes your issue.

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 #119 on: 10 May 2022, 16:46 »
Yay! Thanks, Dirk. Ready to test when ready. :D