Well, I finally got something that works. I'm sure there's a better solution but I think this one simple and you know, if it works better not to touch it.
Here's what I did:
I used the Custom dialog options rendering template to render the dialog options how I wanted and also I made another GUI with the buttons for the dialog; in my case it was a REWIND button to go to the previous dialog and a STOP button to end the dialog. I specified the placement of the buttons within the dialog_options_repexec function to create the mouse over and click button effects but also to set the active dialog with info.ActiveOptionID. Then I created two dialog options that are not shown or said, one to go-to previous and the other one to stop dialog (I did this cause even that I managed to call the GUI button to do the Dialog.Stop, it wasn't possible to add any dialog that way).
I think that for starters like me this is an easy way to do it. I hope it helps.
Code: ags
Here's what I did:
I used the Custom dialog options rendering template to render the dialog options how I wanted and also I made another GUI with the buttons for the dialog; in my case it was a REWIND button to go to the previous dialog and a STOP button to end the dialog. I specified the placement of the buttons within the dialog_options_repexec function to create the mouse over and click button effects but also to set the active dialog with info.ActiveOptionID. Then I created two dialog options that are not shown or said, one to go-to previous and the other one to stop dialog (I did this cause even that I managed to call the GUI button to do the Dialog.Stop, it wasn't possible to add any dialog that way).
I think that for starters like me this is an easy way to do it. I hope it helps.
int dlg_color_main = 44917;
int dlg_color_select = 57307;
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.X = 3;
info.Y = 105;
info.Width = 274;
info.Height = 75;
info.HasAlphaChannel = true;
}
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
gDialogBUTTONS.Visible = true;
info.Surface.DrawImage(0, 0, 414);
int ypos = 7;
for (int vdialognumber = 1; vdialognumber <= info.DialogToRender.OptionCount; vdialognumber++)
{
if (info.DialogToRender.GetOptionState(vdialognumber) == eOptionOn)
{
if (info.ActiveOptionID == vdialognumber)
{
info.Surface.DrawingColor = dlg_color_select;
}
else info.Surface.DrawingColor = dlg_color_main;
info.Surface.DrawStringWrapped(9, ypos, 269, eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(vdialognumber));
ypos += GetTextHeight(info.DialogToRender.GetOptionText(vdialognumber), eFontFont0, info.Width - 10) - 5;
}
}
}
function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
info.ActiveOptionID = 0;
if (mouse.y < info.Y || mouse.y >= info.Y + info.Height)
{
return;
}
int ypos = -3;
int xpos = 0;
for (int vdialognumber = 1; vdialognumber <= info.DialogToRender.OptionCount; vdialognumber++)
{
if (info.DialogToRender.GetOptionState(vdialognumber) == eOptionOn)
{
ypos += GetTextHeight(info.DialogToRender.GetOptionText(vdialognumber), eFontFont0, info.Width) - 5;
if ((mouse.y - info.Y) >= ypos && (mouse.x - info.X) >= 8 && mouse.x < info.Width - 20)
{
info.ActiveOptionID = vdialognumber;
}
}
}
//ACTIVATE DIALOG OPTION & MOUSE OVER AND CLICK EFFECTS
if (mouse.x <= 301 && mouse.x >= 279 && mouse.y <= 135 && mouse.y >= 123)
{
info.ActiveOptionID = 9;
if (mouse.IsButtonDown(eMouseLeft) == true)
{
bDialogREW.NormalGraphic = 413;
bDialogSTOP.NormalGraphic = 415;
}
else if (mouse.IsButtonDown(eMouseLeft) == false)
{
bDialogREW.NormalGraphic = 412;
bDialogSTOP.NormalGraphic = 415;
}
}
else if (mouse.x <= 315 && mouse.x >= 303 && mouse.y <= 135 && mouse.y >= 123)
{
info.ActiveOptionID = 10;
if (mouse.IsButtonDown(eMouseLeft) == true)
{
bDialogSTOP.NormalGraphic = 417;
bDialogREW.NormalGraphic = 411;
}
else if (mouse.IsButtonDown(eMouseLeft) == false)
{
bDialogSTOP.NormalGraphic = 416;
bDialogREW.NormalGraphic = 411;
}
}
else
{
bDialogSTOP.NormalGraphic = 415;
bDialogREW.NormalGraphic = 411;
}
}
function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
if (info.ActiveOptionID > 0 && mouse.IsButtonDown(eMouseLeft))
{
info.RunActiveOption();
}
}
function dialog_options_close(DialogOptionsRenderingInfo *info)
{
gDialogBUTTONS.Visible = false;
bDialogSTOP.NormalGraphic = 415;
bDialogREW.NormalGraphic = 411;
}