Jibble

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 41589 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!
Hey thanks :)

I just checked the scrolling option in low and highres. It scrolls fine here - can you give more some more details on your GUI (like fixed or autoposition, icons or text) ?

Just as a side note: the highlighting is very experimental. In order to refresh the GUI surface so the highlight gets visible, I have to set the active dialog option to 1.

This means if you click really fast on the arrows or quickly hover it and then click, it's possible that the first dialog option gets accidently chosen.

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!
Okay, time to get out of the beta state: here's 1.6.

The most important change is a bugfix, to correctly draw non-square icons. There's also experimental support for highlighted scroll arrows, but I don't recommend using them until AGS fully supports it.

Enjoy :)

Knox

  • Storm Behind The Badge
The link for 1.6 is in the first post, right (or am I a huge retard)?  :P
--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Hey abstauber..just wanted to let you know I have a grievance with your module. Normally I'd just script this type of thing myself but I am working with general_knox and considering I'm on the clock here there's no need to reinvent the wheel when between the two of you the groundwork, foundation, and a fair amount of the structure of the building have already been set in place.

In the header file you have the following lines:

Code: [Select]
int CDG_active_options[];
int CDG_active_options_height[];
int CDG_active_options_width[];
int CDG_active_options_sprite[];
int CDG_active_options_hisprite[];
int CDG_active_options_per_row[];
String CDG_active_options_text[];

This unnecessarily duplicates the arrays in every single subsequent script, which if you have a lot of scripts (especially if there are a lot of rooms) this can create a very significant consumption of memory. Can you define the arrays in the script file and put an import in the header instead?

Also, a lesser issue here..why is there no import of the CDG instance?

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!
@General_Knox: Yep :)

@monkeh'
I'll drop you a pm in order to get some c-tutoring

Edit: Done! Thanks to you, v1.6.1 is now online :)
« Last Edit: 11 Mar 2010, 19:10 by abstauber »

After installing the module I got an error saying 'eFontNormal' was undefined. I only have fonts with enums like eFontFont0 and eFontFont1.

Is eFontNormal a default name, and if so, is the reason I don't have it because I started working on my game way back in AGS 2.7?

EDIT: It must not be that, the 'Custom dialog options rendering' article in the help files states it was written for AGS 3.1, and it mentions 'eFontFont0' in its example script.
« Last Edit: 10 Jun 2010, 16:42 by AdamM »

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!
No worries :D

You can safely rename eFontNormal to eFontFont0. It's just the name of the default font being used to draw text.


Simple use search and replace in CustomDialogGui.asc and get rid of the 'wrong' name.

No, I meant, why is it eFontNormal in the first place? All the other default variables compile with no error messages, so where did eFontNormal come from?

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!
Oh I see, you've got a point here.

For the demo game I thought it's a good idea to give  fonts names like eFontSpace and also eFontNormal.

But I see that is  a bit awkward if you import the module in one of your own projects.
Yeah, maybe I should change that.

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!
*Bump* New version with 32-bit alpha channel support.

Just set bg_img_transparency to "-1" in order to preserve the background sprite's alpha channel.

Code: [Select]
CDG.bg_img_transparency = -1;
« Last Edit: 11 Jun 2011, 17:50 by abstaubE3 »

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!
Thanks to Secret Fawful, here's a bugfix release. Semi-transparent GUI backgrounds now appear correctly in scrolling rooms.

Hi sorry for up old topic
It seems there is some problem with new version of AGS 3.4.0.8 .Is any update for this module?
My official site: http://www.pershaland.ir/

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!
Believe it or not, I finally added 3.4.x support. Many thanks to Ben and Dave for waking me up :)
http://shatten.sonores.de/wp-content/uploads/2017/01/CustomDialogGui_17.zip

Sorry Mehrdad for keep you waiting for such a long time. If this proves to be stable, I'll update the first post and call it an official release.
« Last Edit: 26 Jan 2017, 15:00 by abstauber »

Re: MODULE: CustomDialogGui 1.7 - AGS 3.4 Support
« Reply #93 on: 27 Jan 2017, 15:26 »
Thanks so much abstauber . It works Fine  ;-D
My official site: http://www.pershaland.ir/

deadsuperhero

  • Card-Carrying Satanist
    • I can help with backgrounds
    • I can help with characters
    • I can help with making music
    • I can help with scripting
Re: MODULE: CustomDialogGui 1.7 - AGS 3.4 Support
« Reply #94 on: 16 Jan 2021, 20:39 »
This is a really great module, and I've managed to get pretty far with it in a very short amount of time. I was trying to write my own custom dialog rendering for the past week, and it was much more difficult than I imagined.

Two minor questions:
1. is it possible to set a sprite background for dialog options on eIconMode? I'd kind of like to have icons for dialog options, but also wrap the corresponding image and text with some kind of background to make it look like a button. I guess it might be possible to hack the existing script to draw sprites around each dialog option, similar to how the entire dialog UI allows for a sprite border to be drawn around itself...

After a bit of hacking, it is technically possible, though I'm still debugging how best to do this. Right now, I'm using a static sprite image, but would love to eventually shift over to drawing borders to account for longer dialog options. I added this in the section for Icon GUI Vertical Mode, just before rendering the wrapped string:

Code: Adventure Game Studio
  1. info.Surface.DrawImage(CDG.text_bg_xpos, ypos, CDG.text_bg, CDG.text_bg_transparency,
  2.      CDG.gui_width - CDG.text_bg_xpos - CDG.border_left +10, CDG_active_options_height[i]);
  3.  

It's absolutely a hack, and I still need to come up with ways to properly address spacing between the buttons...but, it's a start.



2. Is there a value I can set to define the width of dialog options? Currently it's slightly short on the UI, resulting in a bunch of text squished together.


Here's a quick screenshot of what I mean:



Sort of, I just ended up hard-coding a little bit of extra space in the drawing function for each option. Very hacky on my part, but it mostly works now:
« Last Edit: 16 Jan 2021, 23:33 by DeadSuperHero »
The fediverse needs great indie game developers! Find me there!

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.7 - AGS 3.4 Support
« Reply #95 on: 18 Jan 2022, 17:29 »
Hello! Apologies for the necro-posting. Abstauber doesn't seem to post much here anymore and the link to this module no longer works. Is the latest version archived anywhere?

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.7 - AGS 3.4 Support
« Reply #96 on: 18 Jan 2022, 19:39 »
Hey, sorry for being gone. Apparently I've missed a few posts, at least I didn't get the notification from last year and I even got some PMs  8-0
But at least I got a notification now - so yes the link from post #92 works for me. I'm keeping my fingers crossed that this module still works with recent versions of AGS. As you might tell, I haven't looked at the code for quite some time.

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.7 - AGS 3.4 Support
« Reply #97 on: 18 Jan 2022, 19:41 »
The version I have doesn't work with AGS 3.6.0.13, but the commands are easily updated. Just a quick search and replace fixes it. If you want to know what I did, lemme know.

Edit: What I did was do a search and replace for the following:

Replace System.ViewportWidth with Screen.Width
Replace System.ViewportHeight with Screen.Height
Replace GetViewportX() with Game.Camera.X
Replace GetViewportY() with Game.Camera.Y

There was also a compilation error because the command "ignoreScaling" no longer works with objects. My custom dialog window won't need to scale, so I didn't bother trying to fix it and instead just commented that bit out. :D It works fine.

edit2: Also, hi Abstauber!
« Last Edit: 18 Jan 2022, 19:45 by Dave Gilbert »

eri0o

Re: MODULE: CustomDialogGui 1.7 - AGS 3.4 Support
« Reply #98 on: 19 Jan 2022, 09:06 »
Google Chrome blocks http downloads from https pages I think. I think right click, "save link as..." still works. I recently had the same problem downloading some old games from the AGS Games DB.

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.7 - AGS 3.4 Support
« Reply #99 on: 30 Apr 2022, 22:35 »
Well since some of you still find this module useful, here's v1.8 along with a refreshed demo.

// 1.8    Added: AGS 3.5 support
//        Removed workaround for pushed down arrows
//        Bumped min. version to 3.4

https://github.com/dkrey/ags_customdialog
https://github.com/dkrey/ags_customdialog/releases/download/1.8/CustomDialogGui_1.8.zip
https://github.com/dkrey/ags_customdialog/releases/download/1.8/customdialoggui_demo.1.8.zip