Lua stuffs

This commit is contained in:
2012-10-16 20:55:13 +02:00
parent 9df0077257
commit a6391527ec
6 changed files with 45 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
+3
View File
@@ -57,6 +57,9 @@ namespace DepthsBelow
/// </summary>
protected override void Initialize()
{
// TEST LUA
new Lua();
// TODO: Add your initialization logic here
Camera = new Camera(this);
Squad = new List<Soldier>();
@@ -73,6 +73,13 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="lua51">
<HintPath>..\..\LuaInterface\lua51.dll</HintPath>
</Reference>
<Reference Include="LuaInterface, Version=2.0.0.16708, Culture=neutral, processorArchitecture=x86">
<HintPath>..\..\LuaInterface\LuaInterface.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
@@ -123,6 +130,7 @@
<ItemGroup>
<Compile Include="Camera.cs" />
<Compile Include="Interface.cs" />
<Compile Include="Lua.cs" />
<Compile Include="Shot.cs" />
<Compile Include="Component\Shooting.cs" />
<Compile Include="GUIManager.cs" />
@@ -191,6 +199,7 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="DepthsBelow_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup />
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
namespace DepthsBelow
{
class Lua
{
public Lua()
{
LuaInterface.Lua lua = new LuaInterface.Lua();
lua.RegisterFunction("GetKeyboardState", null, typeof(DepthsBelow.Lua).GetMethod("GetKeyboardState"));
object[] ret = lua.DoString("return GetKeyboardState()");
Console.WriteLine(((KeyboardState)ret[0]).ToString());
}
public KeyboardState GetKeyboardState()
{
return Keyboard.GetState();
}
}
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.