Here's my updated code. Doesn't crash: simply doesn't show the woodpanel graphic (sprite 2639) anywhere, at any any time.
Code: ags
Still stumped.
function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
ConversationIsOn=true;
dialog_left=11;
info.X = 0;
info.Y = 672;
info.Width = 1366;
info.Height = 96;
}
//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------
function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
ds.DrawImage(0, 672, 2639);
int i = 1, ypos = 0, xpos = dialog_left;
while (i <= info.DialogToRender.OptionCount)
{
if (info.DialogToRender.GetOptionState(i) == eOptionOn)
{
String str = info.DialogToRender.GetOptionText(i); //get glyph number from option text
int cur_img = str.AsInt; //current image is that number
ds.DrawImage(xpos, ypos, cur_img); //draw this glyph
xpos = xpos + 96; //xpos+=width of glyph
}
i++;
}
}
//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Render
//----------------------------------------------------------------------------------------------------------------------
function dialog_options_render(DialogOptionsRenderingInfo* info)
{
DrawDialogOptions(info.Surface, info);
}
//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Repeat Exec
//----------------------------------------------------------------------------------------------------------------------
function dialog_options_repexec(DialogOptionsRenderingInfo* info)
{
int i = 1, xpos = dialog_left;
while (i <= info.DialogToRender.OptionCount)
{
if (info.DialogToRender.GetOptionState(i) == eOptionOn)
{
if ( mouse.y >= info.Y
&& mouse.x >= xpos
&& mouse.x <= xpos+96)
{
info.ActiveOptionID = i;
//transplanted in from dialogue_options_mouse_click() to get rid of background/old buttons in real time
MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
ds.DrawImage(0, 672, 2639);
DrawDialogOptions(ds, info);
ds.Release();
return;
}
xpos += 96;
}
i++;
}
gFakeDialogOptions.Visible = false;
}
//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Mouse Click
//----------------------------------------------------------------------------------------------------------------------
function dialog_options_mouse_click(DialogOptionsRenderingInfo* info, MouseButton button)
{
if (info.ActiveOptionID > 0)
{
MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
ds.DrawImage(0, 672, 2639);
DrawDialogOptions(ds, info);
ds.Release();
gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
gFakeDialogOptions.Visible = true;
info.RunActiveOption();
}
}
Still stumped.