forked from Mirrors/openclonk
first working version of the gamepad controls
parent
4e5ed174ac
commit
90ace028b8
|
@ -22,7 +22,7 @@ public func ControlUseStart(object clonk, int x, int y)
|
|||
AddEffect("ShovelDust",clonk,1,1,this);
|
||||
}
|
||||
else
|
||||
CancelUse();
|
||||
clonk->CancelUse();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public func ControlUseHolding(object clonk, int x, int y)
|
|||
// something happened - don't try to dig anymore
|
||||
if(clonk->GetAction() != "Dig")
|
||||
{
|
||||
CancelUse();
|
||||
clonk->CancelUse();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public func Aim(int ctrl, int x, int y, int repeat, int release)
|
|||
{
|
||||
if (ctrl == CON_AimAnalog)
|
||||
{
|
||||
// TODO
|
||||
Message("%d,%d",this,x,y);
|
||||
}
|
||||
// stop
|
||||
else if (release)
|
||||
|
|
|
@ -528,7 +528,7 @@ public func ObjectCommand(string command, object target, int tx, int ty, object
|
|||
else SetCommand(command,target,tx,ty,target2);
|
||||
}
|
||||
|
||||
private func CancelUse()
|
||||
public func CancelUse()
|
||||
{
|
||||
if (!using) return;
|
||||
|
||||
|
@ -556,7 +556,10 @@ private func StartUseControl(int ctrl, control, int x, int y, object obj)
|
|||
// first call UseStart. If unhandled, call Use (mousecontrol)
|
||||
var handled = obj->Call(Format("~%sUseStart%s",control,estr),this,x,y);
|
||||
if (!handled)
|
||||
{
|
||||
handled = obj->Call(Format("~%sUse%s",control,estr),this,x,y);
|
||||
noholdingcallbacks = handled;
|
||||
}
|
||||
if (!handled)
|
||||
{
|
||||
using = nil;
|
||||
|
@ -637,7 +640,7 @@ private func HoldingUseControl(int ctrl, control, int x, int y, object obj)
|
|||
mey = mlasty;
|
||||
}
|
||||
|
||||
Message("%d,%d",this,mex,mey);
|
||||
//Message("%d,%d",this,mex,mey);
|
||||
|
||||
var handled = obj->Call(Format("~%sUse%sHolding",control,estr),this,mex,mey);
|
||||
|
||||
|
|
|
@ -463,8 +463,8 @@
|
|||
[ControlSet]
|
||||
Name=WASD_Mouse
|
||||
Keyboard=1
|
||||
Mouse=0
|
||||
Gamepad=1
|
||||
Mouse=1
|
||||
Gamepad=0
|
||||
|
||||
[Assignment]
|
||||
Key=GameMouse1Move
|
||||
|
@ -692,163 +692,6 @@
|
|||
Key=Mouse1Wheel1Down
|
||||
Priority=100
|
||||
Control=ZoomOut
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Left
|
||||
Priority=50
|
||||
Control=Left
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Right
|
||||
Priority=50
|
||||
Control=Right
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down
|
||||
Priority=50
|
||||
Control=Down
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Up
|
||||
Priority=50
|
||||
Control=Up
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Left
|
||||
Priority=70
|
||||
Control=AimLeft
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Right
|
||||
Priority=70
|
||||
Control=AimRight
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down
|
||||
Priority=70
|
||||
Control=AimDown
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Up
|
||||
Priority=70
|
||||
Control=AimUp
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Up
|
||||
Priority=10
|
||||
Control=Jump
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Left
|
||||
Priority=100
|
||||
Control=MenuLeft
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Right
|
||||
Priority=100
|
||||
Control=MenuRight
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down
|
||||
Priority=100
|
||||
Control=MenuDown
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Up
|
||||
Priority=100
|
||||
Control=MenuUp
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Control=MenuOK
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1B
|
||||
Control=MenuCancel
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=45
|
||||
Control=PushEnter
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=40
|
||||
Control=GrabNext
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=35
|
||||
Control=Ungrab
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=30
|
||||
Control=Grab
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=25
|
||||
Control=Exit
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C
|
||||
Priority=20
|
||||
Control=Enter
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1B
|
||||
Control=NextCrew
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1H
|
||||
Control=PlayerMenu
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1E
|
||||
Control=NextItem
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1F
|
||||
Control=NextAltItem
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1A
|
||||
Priority=100
|
||||
Control=UseDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1A
|
||||
Priority=50
|
||||
Control=ThrowDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down,Joy1A
|
||||
Priority=150
|
||||
Control=Drop
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C,Joy1A
|
||||
Control=ThrowDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1D
|
||||
Priority=100
|
||||
Control=UseAltDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1D
|
||||
Priority=50
|
||||
Control=ThrowAltDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down,Joy1D
|
||||
Priority=150
|
||||
Control=DropAlt
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C,Joy1D
|
||||
Control=ThrowAltDelayed
|
||||
|
||||
# Would be cool to be able to "inherit" from WASD_Mouse and
|
||||
# just overwrite the entries that change
|
||||
|
@ -1120,6 +963,7 @@
|
|||
Mouse=0
|
||||
Gamepad=1
|
||||
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Left
|
||||
Priority=50
|
||||
|
@ -1242,36 +1086,38 @@
|
|||
[Assignment]
|
||||
Key=Joy1A
|
||||
Priority=100
|
||||
Control=Use
|
||||
Control=UseDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1A
|
||||
Priority=50
|
||||
Control=Throw
|
||||
Control=ThrowDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down,Joy1A
|
||||
Priority=150
|
||||
Control=Drop
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C,Joy1A
|
||||
Control=Throw
|
||||
Control=ThrowDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1D
|
||||
Priority=100
|
||||
Control=UseAlt
|
||||
Control=UseAltDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1D
|
||||
Priority=50
|
||||
Control=ThrowAlt
|
||||
Control=ThrowAltDelayed
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1Down,Joy1D
|
||||
Priority=150
|
||||
Control=DropAlt
|
||||
|
||||
[Assignment]
|
||||
Key=Joy1C,Joy1D
|
||||
Control=ThrowAlt
|
||||
Control=ThrowAltDelayed
|
||||
|
||||
|
|
Loading…
Reference in New Issue