From 039b6dbf181ad8fe9bcc60359344bf2eccf95f07 Mon Sep 17 00:00:00 2001 From: InvalidArgument3 Date: Sun, 24 Nov 2024 18:57:34 -0600 Subject: [PATCH] init moonbaselinkutility --- .../playerhud.cs.DISABLED | 59 ++++++++++++++++++ .../Scripts/AdminBugReporterUtility/script.cs | 60 +++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 [Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/playerhud.cs.DISABLED create mode 100644 [Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/script.cs diff --git a/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/playerhud.cs.DISABLED b/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/playerhud.cs.DISABLED new file mode 100644 index 0000000..163c027 --- /dev/null +++ b/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/playerhud.cs.DISABLED @@ -0,0 +1,59 @@ +using Sandbox.Game; +using Sandbox.ModAPI; +using System; +using VRage.Game; +using VRage.Game.Components; + +namespace playerHUD +{ + [MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)] + public class playerhud : MySessionComponentBase + { + bool shown = false; + bool waiting = false; + DateTime startTime; + + public override void Init(MyObjectBuilder_SessionComponent sessionComponent) + { + } + + public override void BeforeStart() + { + MyVisualScriptLogicProvider.PlayerSpawned += PlayerSpawned; + MyVisualScriptLogicProvider.RemoveQuestlogDetails(); + MyVisualScriptLogicProvider.SetQuestlog(false); + shown = false; + waiting = false; + } + + private void PlayerSpawned(long playerId) + { + + if (!shown && !waiting) + { + MyVisualScriptLogicProvider.SetQuestlog(true, "Keybinds"); + MyVisualScriptLogicProvider.AddQuestlogObjective("SHIFT + F3 = Commands", false, true); + MyVisualScriptLogicProvider.AddQuestlogObjective("SHIFT+F2 = Infodoc", false, true); + MyVisualScriptLogicProvider.AddQuestlogObjective("CTRL + F2 = Report Bug", false, true); + waiting = true; + startTime = DateTime.Now; + } + } + + public override void UpdateAfterSimulation() + { + if (waiting && DateTime.Now - startTime >= TimeSpan.FromSeconds(10)) + { + MyVisualScriptLogicProvider.RemoveQuestlogDetails(); + MyVisualScriptLogicProvider.SetQuestlog(false); + waiting = false; + shown = false; + } + } + + protected override void UnloadData() + { + MyVisualScriptLogicProvider.PlayerSpawned -= PlayerSpawned; + } + } +} diff --git a/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/script.cs b/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/script.cs new file mode 100644 index 0000000..598705d --- /dev/null +++ b/[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/script.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using Sandbox.Definitions; +using Sandbox.Game; +using Sandbox.ModAPI; +using SpaceEngineers.Game.ModAPI; +using VRage.Game; +using VRage.Game.Components; +using VRage.Game.ModAPI; +using VRage.Input; +using VRageMath; + + +namespace invalid.BugReporter +{ + [MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)] + public class RoSSLinkUtility : MySessionComponentBase + { + public override void UpdateAfterSimulation() + { + if (MyAPIGateway.Utilities.IsDedicated) + { + return; + } + + if (MyAPIGateway.Input.IsKeyPress(MyKeys.LeftShift) && MyAPIGateway.Input.IsNewKeyPressed(MyKeys.F2) && ValidInput()) //hey dumbass, use this before the url. fucking keen https://steamcommunity.com/linkfilter/?url={url} + { + + MyVisualScriptLogicProvider.OpenSteamOverlay("https://steamcommunity.com/linkfilter/?url=https://docs.google.com/document/d/1yoYMmdiJyq1cGgzp_p1_wY0rccdv4dPZmjhj5eS_53U/"); + + } + + + } + + public override void Init(MyObjectBuilder_SessionComponent sessionComponent) + { + + MyAPIGateway.Utilities.ShowMessage("Server", "Press Shift + F2 to open the Moonbase Infodoc" ); + + } + + + + private bool ValidInput() + { + if (MyAPIGateway.Session.CameraController != null && !MyAPIGateway.Gui.ChatEntryVisible && !MyAPIGateway.Gui.IsCursorVisible + && MyAPIGateway.Gui.GetCurrentScreen == MyTerminalPageEnum.None) + { + return true; + } + return false; + } + + protected override void UnloadData() + { + + } + } +}