From cba68551d0b4c99ba1c87f1b154aa3fc87b56102 Mon Sep 17 00:00:00 2001 From: brandman211 Date: Mon, 26 Mar 2012 14:48:05 +0000 Subject: [PATCH] -Removed LuaVarArgs from gui_text. I think this function is pointless and over complicates things; let me know if you agree based on this example. -Fixed DrawMessages, which was setting y = x, making the y parameter of gui.text useless. --- BizHawk.MultiClient/LuaImplementation.cs | 15 ++++----------- BizHawk.MultiClient/RenderPanel.cs | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/BizHawk.MultiClient/LuaImplementation.cs b/BizHawk.MultiClient/LuaImplementation.cs index a4e0c8da09..b74fd6dbb0 100644 --- a/BizHawk.MultiClient/LuaImplementation.cs +++ b/BizHawk.MultiClient/LuaImplementation.cs @@ -349,17 +349,10 @@ namespace BizHawk.MultiClient //---------------------------------------------------- public void gui_text(object luaX, object luaY, object luaStr, object anchor = null) { - gui_text_implementation(LuaVarArgs(luaX, luaY, luaStr, anchor)); - } - - private void gui_text_implementation(object[] parameters) - { - int anchor; - if (parameters.Length == 3) - anchor = 0; - else - anchor = LuaInt(parameters[3]); - Global.RenderPanel.AddGUIText(parameters[2].ToString(), LuaInt(parameters[0]), LuaInt(parameters[1]), false, anchor); + int a = 0; + if (anchor != null) + a = LuaInt(anchor); + Global.RenderPanel.AddGUIText(luaStr.ToString(), LuaInt(luaX), LuaInt(luaY), false, a); } public void gui_alert(object luaX, object luaY, object luaStr) diff --git a/BizHawk.MultiClient/RenderPanel.cs b/BizHawk.MultiClient/RenderPanel.cs index d8aec94dae..11cae46478 100644 --- a/BizHawk.MultiClient/RenderPanel.cs +++ b/BizHawk.MultiClient/RenderPanel.cs @@ -506,7 +506,7 @@ namespace BizHawk.MultiClient for (int x = 0; x < GUITextList.Count; x++) { int posx = GetX(GUITextList[x].X, GUITextList[x].Anchor); - int posy = GetX(GUITextList[x].X, GUITextList[x].Anchor); + int posy = GetY(GUITextList[x].Y, GUITextList[x].Anchor); MessageFont.DrawString(null, GUITextList[x].Message, posx + 2, posy + 2, Color.Black);