MODULE: CustomDialogGui 1.9

Started by abstauber, Sun 14/12/2008 16:03:36

Previous topic - Next topic

abstauber

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

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

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

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: ags
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

@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 :)

AdamM

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.

abstauber

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.

AdamM

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

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

*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: ags
CDG.bg_img_transparency = -1;

abstauber

Thanks to Secret Fawful, here's a bugfix release. Semi-transparent GUI backgrounds now appear correctly in scrolling rooms.

Mehrdad

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.com/

abstauber

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.

Mehrdad

Thanks so much abstauber . It works Fine  ;-D
My official site: http://www.pershaland.com/

deadsuperhero

#94
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: ags

info.Surface.DrawImage(CDG.text_bg_xpos, ypos, CDG.text_bg, CDG.text_bg_transparency, 
     CDG.gui_width - CDG.text_bg_xpos - CDG.border_left +10, CDG_active_options_height[i]);


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:
The fediverse needs great indie game developers! Find me there!

Dave Gilbert

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

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

#97
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!

eri0o

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

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

SMF spam blocked by CleanTalk