mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 17:43:08 -05:00
Android: don't bother compiling hotkeys code.
This commit is contained in:
parent
a5df8cdbec
commit
7ff1575eff
8 changed files with 23 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
|
||||
#if !ANDROID
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using ClassicalSharp.Hotkeys;
|
||||
|
@ -187,3 +188,4 @@ namespace ClassicalSharp.Gui {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,4 +1,5 @@
|
|||
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
|
||||
#if !ANDROID
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using ClassicalSharp.Hotkeys;
|
||||
|
@ -56,3 +57,4 @@ namespace ClassicalSharp.Gui {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -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",
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,7 +21,6 @@ namespace ClassicalSharp.Network {
|
|||
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
|
||||
}
|
||||
}
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue