From d391d275ef431a8db9f42afa98715bc9aae7bcab Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 1 Nov 2013 15:43:15 +0000 Subject: [PATCH] Move Movie lua library to client.common, and some refactoring necessary to do so --- .../BizHawk.Client.Common.csproj | 1 + .../lua}/EmuLuaLibrary.Movie.cs | 13 +++---------- .../BizHawk.MultiClient.csproj | 1 - BizHawk.MultiClient/MainForm.cs | 13 ------------- BizHawk.MultiClient/tools/TAStudio.cs | 19 ++----------------- 5 files changed, 6 insertions(+), 41 deletions(-) rename {BizHawk.MultiClient/tools/Lua/Libraries => BizHawk.Client.Common/lua}/EmuLuaLibrary.Movie.cs (85%) diff --git a/BizHawk.Client.Common/BizHawk.Client.Common.csproj b/BizHawk.Client.Common/BizHawk.Client.Common.csproj index 398019161d..4a21b7b745 100644 --- a/BizHawk.Client.Common/BizHawk.Client.Common.csproj +++ b/BizHawk.Client.Common/BizHawk.Client.Common.csproj @@ -106,6 +106,7 @@ + diff --git a/BizHawk.MultiClient/tools/Lua/Libraries/EmuLuaLibrary.Movie.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs similarity index 85% rename from BizHawk.MultiClient/tools/Lua/Libraries/EmuLuaLibrary.Movie.cs rename to BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs index 5fc9d440cb..09168d82d5 100644 --- a/BizHawk.MultiClient/tools/Lua/Libraries/EmuLuaLibrary.Movie.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs @@ -1,7 +1,6 @@ using LuaInterface; -using BizHawk.Client.Common; -namespace BizHawk.MultiClient +namespace BizHawk.Client.Common { public class MovieLuaLibrary : LuaLibraryBase { @@ -111,14 +110,8 @@ namespace BizHawk.MultiClient public static void movie_setreadonly(object lua_input) { - if (lua_input.ToString().ToUpper() == "TRUE" || lua_input.ToString() == "1") - { - GlobalWinF.MainForm.SetReadOnly(true); - } - else - { - GlobalWinF.MainForm.SetReadOnly(false); - } + Global.ReadOnly = (lua_input.ToString().ToUpper() == "TRUE" + || lua_input.ToString() == "1"); } public static void movie_setrerecordcounting(object lua_input) diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 851e3a5d70..f01e425f2a 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -450,7 +450,6 @@ - diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 23cf5b8b90..9e7be9836a 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -3471,19 +3471,6 @@ namespace BizHawk.MultiClient } - public void SetReadOnly(bool read_only) - { - Global.ReadOnly = read_only; - if (Global.ReadOnly) - { - GlobalWinF.OSD.AddMessage("Movie read-only mode"); - } - else - { - GlobalWinF.OSD.AddMessage("Movie read+write mode"); - } - } - public void LoadTAStudio() { if (!TAStudio1.IsHandleCreated || TAStudio1.IsDisposed) diff --git a/BizHawk.MultiClient/tools/TAStudio.cs b/BizHawk.MultiClient/tools/TAStudio.cs index 82ff771225..4025279a56 100644 --- a/BizHawk.MultiClient/tools/TAStudio.cs +++ b/BizHawk.MultiClient/tools/TAStudio.cs @@ -82,21 +82,6 @@ namespace BizHawk.MultiClient } } - //public string GetMnemonic() - //{ - // StringBuilder str = new StringBuilder("|"); //TODO: Control Command virtual pad - - // //TODO: remove this hack with a nes controls pad - // if (Global.Emulator.SystemId == "NES") - // { - // str.Append("0|"); - // } - - // for (int x = 0; x < Pads.Count; x++) - // str.Append(Pads[x].GetMnemonic()); - // return str.ToString(); - //} - private void TASView_QueryItemBkColor(int index, int column, ref Color color) { if (index == 0 && Global.MovieSession.Movie.StateFirstIndex == 0) @@ -288,7 +273,7 @@ namespace BizHawk.MultiClient { if (ReadOnlyCheckBox.Checked) { - GlobalWinF.MainForm.SetReadOnly(true); + Global.ReadOnly = true; ReadOnlyCheckBox.BackColor = SystemColors.Control; if (Global.MovieSession.Movie.IsActive) @@ -299,7 +284,7 @@ namespace BizHawk.MultiClient } else { - GlobalWinF.MainForm.SetReadOnly(false); + Global.ReadOnly = false; ReadOnlyCheckBox.BackColor = Color.LightCoral; if (Global.MovieSession.Movie.IsActive) {