Android: don't bother compiling hotkeys code.

This commit is contained in:
UnknownShadow200 2016-09-15 12:15:58 +10:00
parent a5df8cdbec
commit 7ff1575eff
8 changed files with 23 additions and 7 deletions

View file

@ -1,4 +1,5 @@
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
#if !ANDROID
using System;
using System.Drawing;
using ClassicalSharp.Hotkeys;
@ -186,4 +187,5 @@ namespace ClassicalSharp.Gui {
((ButtonWidget)widget).SetText( text );
}
}
}
}
#endif

View file

@ -1,4 +1,5 @@
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
#if !ANDROID
using System;
using System.Drawing;
using ClassicalSharp.Hotkeys;
@ -55,4 +56,5 @@ namespace ClassicalSharp.Gui {
return hotkeys.Hotkeys.Find( h => h.BaseKey == hKey && h.Flags == flags );
}
}
}
}
#endif

View file

@ -43,8 +43,12 @@ namespace ClassicalSharp.Gui {
(g, w) => g.Gui.SetNewScreen( new SaveLevelScreen( g ) ) ),
Make( -1, 0, "Select texture pack",
(g, w) => g.Gui.SetNewScreen( new TexturePackScreen( g ) ) ),
#if !ANDROID
Make( -1, 50, "Hotkeys",
(g, w) => g.Gui.SetNewScreen( new HotkeyListScreen( g ) ) ),
#else
null,
#endif
// Other
ButtonWidget.Create( game, 5, 5, 120, 40, "Quit game",

View file

@ -63,7 +63,7 @@
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE;USE_DX</DefineConstants>
<DefineConstants>TRACE;USE_DX;</DefineConstants>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<StartAction>Project</StartAction>
</PropertyGroup>

View file

@ -10,7 +10,10 @@ namespace ClassicalSharp {
public sealed class InputHandler {
#if !ANDROID
public HotkeyList Hotkeys;
#endif
Game game;
bool[] buttonsDown = new bool[3];
PickingHandler picking;
@ -18,9 +21,12 @@ namespace ClassicalSharp {
this.game = game;
RegisterInputHandlers();
Keys = new KeyMap();
picking = new PickingHandler( game, this );
#if !ANDROID
Hotkeys = new HotkeyList();
Hotkeys.LoadSavedHotkeys();
picking = new PickingHandler( game, this );
#endif
}
void RegisterInputHandlers() {

View file

@ -1,4 +1,5 @@
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
#if !ANDROID
using System;
using System.Collections.Generic;
using OpenTK.Input;
@ -131,3 +132,4 @@ namespace ClassicalSharp.Hotkeys {
public string Text; // contents to copy directly into the input bar
}
}
#endif

View file

@ -20,8 +20,7 @@ namespace ClassicalSharp.Network {
public override void SendPlayerClick( MouseButton button, bool buttonDown, byte targetId, PickedPos pos ) {
cpe.SendPlayerClick( button, buttonDown, targetId, pos );
}
#region Helpers
internal void CheckName( byte id, ref string displayName, ref string skinName ) {
displayName = Utils.RemoveEndPlus( displayName );
@ -104,6 +103,5 @@ namespace ClassicalSharp.Network {
player.SetLocation( update, interpolate );
}
}
#endregion
}
}

View file

@ -95,6 +95,7 @@ namespace ClassicalSharp.Network.Protocols {
int keyCode = reader.ReadInt32();
byte keyMods = reader.ReadUInt8();
#if !ANDROID
if( keyCode < 0 || keyCode > 255 ) return;
Key key = LwjglToKey.Map[keyCode];
if( key == Key.Unknown ) return;
@ -108,6 +109,7 @@ namespace ClassicalSharp.Network.Protocols {
} else { // more input needed by user
game.InputHandler.Hotkeys.AddHotkey( key, keyMods, action, true );
}
#endif
}
void HandleExtAddPlayerName() {