-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from StarCoreSE/tlb-moonbase
init moonbase mod folder and moonbaselinkutility (not on workshop yet)
- Loading branch information
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...onbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/playerhud.cs.DISABLED
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
[Folder]MoonbaseMods/MoonbaseLinkUtility/Data/Scripts/AdminBugReporterUtility/script.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
{ | ||
|
||
} | ||
} | ||
} |