Client LuaCsForBarotrauma
BarotraumaShared/SharedSource/PlayerInput.cs
1
using
System.Collections.Generic;
2
3
namespace
Barotrauma
4
{
5
class
Key
6
{
7
private
bool
hit, hitQueue;
8
private
bool
held, heldQueue;
9
10
11
private
InputType
inputType;
12
13
public
Key
(
InputType
inputType)
14
{
15
this.inputType = inputType;
16
}
17
#if CLIENT
18
private
KeyOrMouse
binding
19
{
20
get
{
return
GameSettings.CurrentConfig.KeyMap.Bindings[inputType]; }
21
}
22
23
private
static
bool
AllowOnGUI(
InputType
input)
24
{
25
switch
(input)
26
{
27
case
InputType
.Attack:
28
case
InputType
.Shoot:
29
return
GUI.MouseOn ==
null
;
30
default
:
31
return
true
;
32
}
33
}
34
35
public
KeyOrMouse
State
36
{
37
get
{
return
binding; }
38
}
39
40
public
void
SetState
()
41
{
42
hit = binding.
IsHit
() && AllowOnGUI(inputType);
43
if
(hit) hitQueue =
true
;
44
45
held = binding.
IsDown
() && AllowOnGUI(inputType);
46
if
(held) heldQueue =
true
;
47
}
48
#endif
49
50
public
bool
Hit
51
{
52
get
53
{
54
return
hit;
55
}
56
set
57
{
58
hit = value;
59
}
60
}
61
62
public
bool
Held
63
{
64
get
65
{
66
return
held;
67
}
68
set
69
{
70
held = value;
71
}
72
}
73
74
75
public
void
SetState
(
bool
hit,
bool
held)
76
{
77
if
(hit) hitQueue =
true
;
78
if
(held) heldQueue =
true
;
79
}
80
81
public
bool
DequeueHit
()
82
{
83
bool
value = hitQueue;
84
hitQueue =
false
;
85
return
value;
86
}
87
88
public
bool
DequeueHeld
()
89
{
90
bool
value = heldQueue;
91
heldQueue =
false
;
92
return
value;
93
}
94
95
public
bool
GetHeldQueue
96
{
97
get
{
return
heldQueue; }
98
}
99
100
public
bool
GetHitQueue
101
{
102
get
{
return
hitQueue; }
103
}
104
105
public
void
Reset
()
106
{
107
hit =
false
;
108
held =
false
;
109
}
110
111
public
void
ResetHit
()
112
{
113
hit =
false
;
114
//stateQueue = false;
115
}
116
117
public
void
ResetHeld
()
118
{
119
held =
false
;
120
//stateQueue = false;
121
}
122
}
123
}
Barotrauma.Key
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:6
Barotrauma.Key.ResetHit
void ResetHit()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:111
Barotrauma.Key.DequeueHit
bool DequeueHit()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:81
Barotrauma.Key.GetHitQueue
bool GetHitQueue
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:101
Barotrauma.Key.SetState
void SetState(bool hit, bool held)
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:75
Barotrauma.Key.GetHeldQueue
bool GetHeldQueue
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:96
Barotrauma.Key.State
KeyOrMouse State
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:36
Barotrauma.Key.Key
Key(InputType inputType)
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:13
Barotrauma.Key.Reset
void Reset()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:105
Barotrauma.Key.Hit
bool Hit
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:51
Barotrauma.Key.ResetHeld
void ResetHeld()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:117
Barotrauma.Key.SetState
void SetState()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:40
Barotrauma.Key.DequeueHeld
bool DequeueHeld()
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:88
Barotrauma.Key.Held
bool Held
Definition:
BarotraumaShared/SharedSource/PlayerInput.cs:63
Barotrauma.KeyOrMouse
Definition:
BarotraumaClient/ClientSource/PlayerInput.cs:24
Barotrauma.KeyOrMouse.IsDown
bool IsDown()
Definition:
BarotraumaClient/ClientSource/PlayerInput.cs:55
Barotrauma.KeyOrMouse.IsHit
bool IsHit()
Definition:
BarotraumaClient/ClientSource/PlayerInput.cs:81
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma.InputType
InputType
Definition:
InputType.cs:4
Barotrauma
BarotraumaShared
SharedSource
PlayerInput.cs
Generated by
1.9.1