aim button works

This commit is contained in:
in0finite 2019-07-23 18:02:51 +02:00
parent 4045311d59
commit 0afbaa9d4e
3 changed files with 20 additions and 5 deletions

View file

@ -288,7 +288,8 @@ namespace SanAndreasUnity.Behaviours.Peds.States
// ignore mouse buttons when touch is enabled
CustomInput.Instance.SetButton("LeftClick", false);
CustomInput.Instance.SetButton("RightClick", false);
if (!CustomInput.Instance.HasButton("RightClick"))
CustomInput.Instance.SetButton("RightClick", false);
CustomInput.Instance.SetButtonDown("LeftClick", false);
CustomInput.Instance.SetButtonDown("RightClick", false);
@ -315,9 +316,9 @@ namespace SanAndreasUnity.Behaviours.Peds.States
// preserve input for: walk, sprint, aim
bool isWalkOn = customInput.GetButton("Walk");
bool isSprintOn = customInput.GetButton("Sprint");
bool isAimOn = customInput.GetButton("RightClick");
bool isWalkOn = customInput.GetButtonNoDefaultInput("Walk");
bool isSprintOn = customInput.GetButtonNoDefaultInput("Sprint");
bool isAimOn = customInput.GetButtonNoDefaultInput("RightClick");
customInput.ResetAllInput();

View file

@ -48,6 +48,20 @@ namespace SanAndreasUnity.Utilities
return Input.GetButton(name);
}
public bool GetButtonNoDefaultInput(string name){
if (!this.IsActive)
return false;
bool value = false;
buttons.TryGetValue (name, out value);
return value;
}
public bool HasButton(string name){
if (!this.IsActive)
return false;
return buttons.ContainsKey (name);
}
public bool GetButtonDown(string name){
if (!this.IsActive)
return Input.GetButtonDown(name);

View file

@ -27,7 +27,7 @@
- Chat
- Android: HUD must run before other UI scripts ; add perms for read/write access to storage ; forbid screen rotation ; vibrate when ped is damaged ; disable left and right mouse click ; vehicle touch input: forward, backward, handbrake, left & right ; weapon switching buttons ; states to implement hud: fly, ; circular button for movement ; buttons which don't work: aim, sprint, walk ; lock cursor when testing finishes ;
- Android: HUD must run before other UI scripts ; add perms for read/write access to storage ; forbid screen rotation ; vibrate when ped is damaged ; disable left and right mouse click ; vehicle touch input: forward, backward, handbrake, left & right ; weapon switching buttons ; states to implement hud: fly, ; circular button for movement ; buttons which don't work: aim ; lock cursor when testing finishes ;
- Play sounds: horn ; empty weapon slot ; ped damage ; footsteps in run and sprint states ;