on trigger btn toggle menu

This commit is contained in:
ethan merchant 2024-11-04 05:11:34 -05:00
parent ab53957e80
commit 9fa2884bfe
3 changed files with 26 additions and 2 deletions

View file

@ -59,6 +59,20 @@ static class Arts
if (Mono.menu) if (Mono.menu)
{ {
meshes["Tape"].Draw(mat_mono, Matrix.Identity); meshes["Tape"].Draw(mat_mono, Matrix.Identity);
meshes["uiPlay"].Draw(
mat_unlit,
Matrix.TR(
V.XYZ(0, 0, Mono.SD_Z + 0.5f + 0.1f),
Quat.FromAngles(90, 0, 0)
)
);
meshes["uiCursor"].Draw(
mat_unlit,
Matrix.TR(
V.XYZ(0, 0, Mono.SD_Z + 0.5f + 0.2f),
Quat.FromAngles(90, 0, 0)
)
);
} }
// snake // snake

View file

@ -42,10 +42,15 @@ static class Mono
public static void Frame() public static void Frame()
{ {
if (Rig.btn_trigger.delta == +1)
{
menu = !menu;
}
// flatscreen dev controls // flatscreen dev controls
if (Device.Name == "Simulator") if (Device.Name == "Simulator")
{ {
if (Input.Key(Key.MouseLeft).IsActive()) if (Input.Key(Key.MouseCenter).IsActive())
{ {
float sx = Maths.s_scalar(Input.Mouse.pos.x / 640); float sx = Maths.s_scalar(Input.Mouse.pos.x / 640);
float ssx = Maths.smooth_start(sx); float ssx = Maths.smooth_start(sx);

View file

@ -6,6 +6,8 @@ static class Rig
{ {
public static Pose head = Pose.Identity; public static Pose head = Pose.Identity;
public static DeltaBool btn_trigger = new(false);
public static Vec3 fullstick = Vec3.Up; public static Vec3 fullstick = Vec3.Up;
public static Pose r_con_stick = Pose.Identity; public static Pose r_con_stick = Pose.Identity;
@ -23,19 +25,22 @@ static class Rig
// flatscreen dev controls // flatscreen dev controls
if (Device.Name == "Simulator") if (Device.Name == "Simulator")
{ {
btn_trigger.Step(Input.Key(Key.MouseLeft).IsActive());
if (Input.Key(Key.A).IsJustActive()) new_dir = new(-1, 0, 0); if (Input.Key(Key.A).IsJustActive()) new_dir = new(-1, 0, 0);
if (Input.Key(Key.S).IsJustActive()) new_dir = new(+1, 0, 0); if (Input.Key(Key.S).IsJustActive()) new_dir = new(+1, 0, 0);
if (Input.Key(Key.W).IsJustActive()) new_dir = new(0, 0, -1); if (Input.Key(Key.W).IsJustActive()) new_dir = new(0, 0, -1);
if (Input.Key(Key.R).IsJustActive()) new_dir = new(0, 0, +1); if (Input.Key(Key.R).IsJustActive()) new_dir = new(0, 0, +1);
if (Input.Key(Key.Shift).IsJustActive()) new_dir = new(0, -1, 0); if (Input.Key(Key.Shift).IsJustActive()) new_dir = new(0, -1, 0);
if (Input.Key(Key.Space).IsJustActive()) new_dir = new(0, +1, 0); if (Input.Key(Key.Space).IsJustActive()) new_dir = new(0, +1, 0);
fullstick = new_dir.ToVec3; fullstick = new_dir.ToVec3;
} }
else else
{ {
Hand r_hand = Input.Hand(Handed.Right); Hand r_hand = Input.Hand(Handed.Right);
Controller r_con = Input.Controller(Handed.Right); Controller r_con = Input.Controller(Handed.Right);
btn_trigger.Step(r_con.trigger > 0.5f);
bool con_tracked = r_con.trackedPos > TrackState.Lost; bool con_tracked = r_con.trackedPos > TrackState.Lost;
Input.HandVisible(Handed.Max, !con_tracked); Input.HandVisible(Handed.Max, !con_tracked);
if (con_tracked) if (con_tracked)