Lua - convert to the Client library to the service injection system

This commit is contained in:
adelikat 2015-01-01 20:58:57 +00:00
parent bcfdc755bb
commit a7c91ddcdd
1 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using LuaInterface;
using BizHawk.Emulation.Common;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
@ -10,6 +11,9 @@ namespace BizHawk.Client.EmuHawk
[Description("A library for manipulating the EmuHawk client UI")]
public sealed class EmuHawkLuaLibrary : LuaLibraryBase
{
[RequiredService]
public IEmulator Emulator { get; set; }
private readonly Dictionary<int, string> _filterMappings = new Dictionary<int, string>
{
{ 0, "None" },
@ -53,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
)]
public static int BufferHeight()
{
var height = Global.Emulator.VideoProvider.BufferHeight;
var height = Emulator.VideoProvider.BufferHeight;
var point = new System.Drawing.Point(0, height);
return GlobalWin.DisplayManager.TransformPoint(point).Y - BorderHeight();
@ -65,7 +69,7 @@ namespace BizHawk.Client.EmuHawk
)]
public static int BufferWidth()
{
var width = Global.Emulator.VideoProvider.BufferWidth;
var width = Emulator.VideoProvider.BufferWidth;
var point = new System.Drawing.Point(width, 0);
return GlobalWin.DisplayManager.TransformPoint(point).X - BorderWidth();