Fix docs and a mouse bug
This commit is contained in:
parent
e37b4af9fb
commit
27c1e7a0c4
@ -24,13 +24,21 @@ namespace Cyber.Controls {
|
|||||||
|
|
||||||
private bool CursorLocked = true;
|
private bool CursorLocked = true;
|
||||||
private bool RequestedLockState = true;
|
private bool RequestedLockState = true;
|
||||||
private bool Requested = false;
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Request a new lock state. The cursor will be locked in case there
|
||||||
|
/// isn't another reason to have it in a different state (like the
|
||||||
|
/// <see cref="DebugConsole"/> being up).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="locked">If set to <c>true</c>, cursor might bse
|
||||||
|
/// locked.</param>
|
||||||
public void RequestLockState(bool locked) {
|
public void RequestLockState(bool locked) {
|
||||||
RequestedLockState = locked;
|
RequestedLockState = locked;
|
||||||
Requested = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is the cursor currently locked?
|
||||||
|
/// </summary>
|
||||||
public bool Locked() {
|
public bool Locked() {
|
||||||
return Term.IsVisible() || RequestedLockState;
|
return Term.IsVisible() || RequestedLockState;
|
||||||
}
|
}
|
||||||
@ -43,10 +51,9 @@ namespace Cyber.Controls {
|
|||||||
if (Term.IsVisible()) {
|
if (Term.IsVisible()) {
|
||||||
CursorLocked = false;
|
CursorLocked = false;
|
||||||
UpdateCursor();
|
UpdateCursor();
|
||||||
} else if (Requested) {
|
} else {
|
||||||
CursorLocked = RequestedLockState;
|
CursorLocked = RequestedLockState;
|
||||||
UpdateCursor();
|
UpdateCursor();
|
||||||
Requested = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user