Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Fix for #282.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 28, 2020
1 parent a4b6f4a commit 41f5d41
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
26 changes: 13 additions & 13 deletions Runners/GameRunnerCore/Runner/PixelVision8Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,19 +433,19 @@ protected override void Update(GameTime gameTime)
}
else
{
if (controllerChip.GetKeyUp(Keys.D1))
ToggleLayers(2);
else if (controllerChip.GetKeyUp(Keys.D2))
ToggleLayers(3);
else if (controllerChip.GetKeyUp(Keys.D3))
ToggleLayers(4);
else if (controllerChip.GetKeyUp(Keys.D4))
ToggleLayers(5);
else if (controllerChip.GetKeyUp(Keys.D5))
ToggleLayers(6);
else if (controllerChip.GetKeyUp(Keys.D6))
ToggleLayers(7);
else if (controllerChip.GetKeyUp(Keys.D7)) ToggleLayers(Enum.GetNames(typeof(DrawMode)).Length);
// if (controllerChip.GetKeyUp(Keys.D1))
// ToggleLayers(2);
// else if (controllerChip.GetKeyUp(Keys.D2))
// ToggleLayers(3);
// else if (controllerChip.GetKeyUp(Keys.D3))
// ToggleLayers(4);
// else if (controllerChip.GetKeyUp(Keys.D4))
// ToggleLayers(5);
// else if (controllerChip.GetKeyUp(Keys.D5))
// ToggleLayers(6);
// else if (controllerChip.GetKeyUp(Keys.D6))
// ToggleLayers(7);
// else if (controllerChip.GetKeyUp(Keys.D7)) ToggleLayers(Enum.GetNames(typeof(DrawMode)).Length);
}

// Capture Script errors
Expand Down
26 changes: 13 additions & 13 deletions Runners/PixelVision8Core/Runner/PixelVision8Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,19 +433,19 @@ protected override void Update(GameTime gameTime)
}
else
{
if (controllerChip.GetKeyUp(Keys.D1))
ToggleLayers(2);
else if (controllerChip.GetKeyUp(Keys.D2))
ToggleLayers(3);
else if (controllerChip.GetKeyUp(Keys.D3))
ToggleLayers(4);
else if (controllerChip.GetKeyUp(Keys.D4))
ToggleLayers(5);
else if (controllerChip.GetKeyUp(Keys.D5))
ToggleLayers(6);
else if (controllerChip.GetKeyUp(Keys.D6))
ToggleLayers(7);
else if (controllerChip.GetKeyUp(Keys.D7)) ToggleLayers(Enum.GetNames(typeof(DrawMode)).Length);
// if (controllerChip.GetKeyUp(Keys.D1))
// ToggleLayers(2);
// else if (controllerChip.GetKeyUp(Keys.D2))
// ToggleLayers(3);
// else if (controllerChip.GetKeyUp(Keys.D3))
// ToggleLayers(4);
// else if (controllerChip.GetKeyUp(Keys.D4))
// ToggleLayers(5);
// else if (controllerChip.GetKeyUp(Keys.D5))
// ToggleLayers(6);
// else if (controllerChip.GetKeyUp(Keys.D6))
// ToggleLayers(7);
// else if (controllerChip.GetKeyUp(Keys.D7)) ToggleLayers(Enum.GetNames(typeof(DrawMode)).Length);
}

// Capture Script errors
Expand Down
4 changes: 2 additions & 2 deletions SDK/Editor/Services/LuaServicePlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public override void ConfigureScript(Script luaScript)
UserData.RegisterType<Image>();

// Experimental
luaScript.Globals["DebugLayers"] = new Action<bool>(runner.DebugLayers);
luaScript.Globals["ToggleLayers"] = new Action<int>(runner.ToggleLayers);
// luaScript.Globals["DebugLayers"] = new Action<bool>(runner.DebugLayers);
// luaScript.Globals["ToggleLayers"] = new Action<int>(runner.ToggleLayers);
luaScript.Globals["ResizeColorMemory"] = new Action<int, int>(ResizeColorMemory);

}
Expand Down
25 changes: 12 additions & 13 deletions SDK/Runner/GameRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using System.Globalization;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using PixelVision8.Engine;
using PixelVision8.Engine.Chips;
Expand Down Expand Up @@ -311,18 +310,18 @@ public virtual bool CropScreen(bool? value = null)
.cropScreen; //Convert.ToBoolean(workspaceService.ReadBiosData(BiosSettings.CropScreen.ToString(), "False") as string);
}

public void DebugLayers(bool value)
{
debugLayers = value;
}

public void ToggleLayers(int value)
{
if (!debugLayers) return;

// if (mode == RunnerMode.Play)
ActiveEngine.DisplayChip.layers = value - 1;
}
// public void DebugLayers(bool value)
// {
// debugLayers = value;
// }
//
// public void ToggleLayers(int value)
// {
// if (!debugLayers) return;
//
// // if (mode == RunnerMode.Play)
// ActiveEngine.DisplayChip.layers = value - 1;
// }

/// <summary>
/// Reset the currently running game.
Expand Down
4 changes: 2 additions & 2 deletions SDK/Runner/IRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public interface IRunner
bool Fullscreen(bool? value = null);
bool StretchScreen(bool? value = null);
bool CropScreen(bool? value = null);
void DebugLayers(bool value);
void ToggleLayers(int value);
// void DebugLayers(bool value);
// void ToggleLayers(int value);
void ResetGame();
IServiceLocator ServiceManager { get;}

Expand Down

0 comments on commit 41f5d41

Please sign in to comment.