Skip to content

Commit

Permalink
Merge pull request #57 from StarCoreSE/tlb-moonbase
Browse files Browse the repository at this point in the history
init moonbase mod folder and moonbaselinkutility (not on workshop yet)
  • Loading branch information
InvalidArgument3 authored Nov 25, 2024
2 parents b0ef7f0 + 039b6db commit d64868d
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
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;
}
}
}
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()
{

}
}
}

0 comments on commit d64868d

Please sign in to comment.