Custom dialogue issue with dimensions

Started by bx83, Fri 05/06/2020 08:40:56

Previous topic - Next topic

bx83

I've recently sort to edit my code to give the options a left indent of 11px.

Here's the code:
Code: ags
//----------------------------------------------------------------------------------------------------------------------
// DIALOGUE
//----------------------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------------------
// Dialogue Options Get Dimensions
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
	ConversationIsOn=true;
	//sprtFloatingText.Delete();
	
// Create a 1366x96 dialog options area at (0,704)
  dialog_left=11;

  info.X = dialog_left;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
	int i = 1, ypos = 0, xpos = 0;  
  ds.Clear(COLOR_TRANSPARENT);
  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 = 0;
  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();
        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)
{
	//ConversationIsOn=true;
	
  if (info.ActiveOptionID > 0)
  {
    MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
    DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
    DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}


// END DIALOG FUNCTIONS


I expect all options to be drawn with an initial 11px indent. However, once I choose an option, it defaults to 0px indent; then when speech is over, it flips constantly between 11px and 0px indent.

Video:

https://bluekeystudios.com/img/conversation_error.mov

How can I get it to have an 11px indent at all times, including when selecting an option (ie. selection isn't always off by 11px if I click near the border)?
I think it's something in dialog_options_repexec() doing this weird overdrawing, but not sure. I've tried a few things, nothing works.

Bonus question: I'm thinking of having a large background image to frame the conversation icons -- where do I put the drawing code, once in dialog_options_render()?

Khris

#1
I'm guessing the dialog_options_repexec needs  xpos  to start at 11 since it compares that to mouse.x, which isn't relative to the GUI's origin.
Also you should probably do  #define DIALOG_OFFSET_X 11 at the top of that script and use  DIALOG_OFFSET_X  inside instead of hard-coding it to 11.

bx83

Works now - I think...
I was going to use a define, but dialog_left is good enough.

Code: ags
//----------------------------------------------------------------------------------------------------------------------
// Dialogue Options Get Dimensions
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
	ConversationIsOn=true;
	
	// Create a 1366x96 dialog options area at (0,704)
	dialog_left=11;

  info.X = 0;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
	int i = 1, ypos = 0, xpos = dialog_left;	//0;  
  ds.Clear(COLOR_TRANSPARENT);
  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)//+dialog_left)
      {
        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();
        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();
    DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}

bx83

#3
As for drawing a background image, over which I draw the glyphs already there....

I have this code:
Code: ags
	MyBackgroundSpriteForFakeGUI = DynamicSprite.Create(1366, 96, false);
	DrawingSurface* button_bg = MyBackgroundSpriteForFakeGUI.GetDrawingSurface();
	button_bg.DrawImage(0, 672, 2639);
	button_bg.Release();

...Which I've tried putting in the functions (before any other code) dialog_options_repexec(), dialog_options_render(), and DrawDialogOptions(), and nothing seems to work.

I'm trying to put this image:

Behind the button images you see on the screen.

In all situations, nothing is drawn to screen, just the option images you see in the video.

bx83

I’ve changed the above code to work ds for dynamic sprite and used the same MyFakeGUI etc, removed all ds.clear(), and changed the dimension and sprite to maybe show up on the screen somewhere; then, I put it in all functions. Still nothing; yes to option icons, no to ‘wood finish’ picture.

Snarky

You're probably declaring MyBackgroundSpriteForFakeGUI inside a function? That means it goes out of scope and gets deleted as soon as you exit the function.

bx83

MyBackgroundSpriteForFakeGUI Is a global variable, and I’m not using it anymore. The line you see now is just ds.DrawImage(0,672,WOODPANEL)

Snarky

Well, whatever dynamic sprite you're actually using in the current version of the code, then.

Crimson Wizard

Quote from: Snarky on Fri 05/06/2020 14:40:00
You're probably declaring MyBackgroundSpriteForFakeGUI inside a function? That means it goes out of scope and gets deleted as soon as you exit the function.

If dynamic sprite is deleted, and assigned to a GUI at the same time, then the engine will likely crash.

bx83

Here's my updated code. Doesn't crash: simply doesn't show the woodpanel graphic (sprite 2639) anywhere, at any any time.

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

Crimson Wizard

#10
You create a new MyDynamicSpriteForTheFakeGUI sprite every time a mouse is clicked, and every tick while a cursor is in some location, which is very inefficient, but besides that there's a mistake:
in dialog_options_mouse_click you create new sprite and assign it to gFakeDialogOptions.BackgroundGraphic, but in dialog_options_repexec you don't assign a new sprite anywhere.

Now, I have to admit I am surprised this does not crash, as previous sprite is supposed to be deleted when you replace MyDynamicSpriteForTheFakeGUI.

The proper approach would be to create dynamic sprite only once when dialog options first show up, and then redraw on same sprite without recreating it.

bx83

Okay I've tried this:

Code: ags
function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
	ConversationIsOn=true;
	
	// Create a 1366x96 dialog options area at (0,704)
	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)
{
	MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
  DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
	ds.DrawImage(0, 672, 2639);
	
	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
	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 doesn't work - doesn't show up sprite 2639 anywhere, at any time, even for an instant. Could you point out the lines which don't have to be there? I'm trying but the stupid is strong in me today.

Crimson Wizard

#12
There are few things that seem strange to me in this code. For example, DrawDialogOptions is called with the dialog option's own surface in dialog_options_render(), but it's also called with your dynamic sprite everywhere else. So it's like you are drawing same thing on two different surfaces.

Maybe I missed something in previous discussion.

Is this what you are trying to do right now?
QuoteBonus question: I'm thinking of having a large background image to frame the conversation icons -- where do I put the drawing code, once in dialog_options_render()?

bx83

Yes - I’m trying to draw the woodpanel graphic above (4th post), and then the option icons on top of that.

Crimson Wizard

Quote from: bx83 on Sat 06/06/2020 02:18:10
Yes - I’m trying to draw the woodpanel graphic above (4th post), and then the option icons on top of that.

But the woodpanel has to be drawn only once, and never changed, correct? If so, then you need to draw it only 1 time, in dialog_options_get_dimensions (this is where you decide the size of options surface), and assigned to GUI gFakeDialogOptions.

bx83

I think I've followed your instructions; still doesn't show sprite 2639.


Code: ags
function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
  ConversationIsOn=true;
	
  dialog_left=11;

  info.X = 0;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
	 
  MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
  DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
  ds.DrawImage(0, 672, 2639);
  ds.Release();
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
  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
        DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
	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)
  {
    DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
    DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}

bx83

Alright - code is working :)
Here it is, though no doubt doing some things twice when it only has to do them once:

Code: ags
function dialog_options_get_dimensions(DialogOptionsRenderingInfo* info)
{
	ConversationIsOn=true;
	
	
	dialog_left=11;

  info.X = 0;
  info.Y = 672;
  info.Width = 1366;
  info.Height = 96;
	
	MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
  DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
	ds.DrawImage(0, 0, 2639);
	ds.Release();
	
	gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
  gFakeDialogOptions.Visible = true;
}

//----------------------------------------------------------------------------------------------------------------------
// Draw Dialog Options
//----------------------------------------------------------------------------------------------------------------------

function DrawDialogOptions(DrawingSurface* ds, DialogOptionsRenderingInfo* info)
{
	int i = 1, ypos = 0, xpos = dialog_left;  
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
			gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
			gFakeDialogOptions.Visible = true;
			
      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)
{

	gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
  gFakeDialogOptions.Visible = true;
	
	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;
        

        DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
        
				
				DrawDialogOptions(ds, info);
        ds.Release();
        
        return;
      }
      xpos += 96;
    }
    i++;
  }
}

//----------------------------------------------------------------------------------------------------------------------
// Dialog Options Mouse Click
//----------------------------------------------------------------------------------------------------------------------

function dialog_options_mouse_click(DialogOptionsRenderingInfo* info, MouseButton button)
{
  if (info.ActiveOptionID > 0)
  {

    DrawingSurface* ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();

		DrawDialogOptions(ds, info);
    ds.Release();

    gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
    gFakeDialogOptions.Visible = true;
    info.RunActiveOption();
  }
}

Crimson Wizard

#17
Quote from: bx83 on Sat 06/06/2020 09:05:23
Here it is, though no doubt doing some things twice when it only has to do them once:

Yes, it repeats same thing few times.

There's no need to redraw anything in dialog_options_mouse_click and dialog_options_repexec. IDK how that works, because you're redrawing options on background GUI.
Also no need to do this DrawDialogOptions:
Quote
gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
gFakeDialogOptions.Visible = true;

SMF spam blocked by CleanTalk