forked from StarCoreSE/Orrery-Combat-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
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 StarCoreSE#145 from InvalidArgument3/morehudandter…
…minal terminal option for barrel indicator and attempt at richhud
- Loading branch information
Showing
8 changed files
with
180 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
... Framework - Heart Module/Data/Scripts/HeartModule/ResourceSystem/WeaponResourceSystem.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
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
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 |
---|---|---|
|
@@ -56,4 +56,5 @@ public override void PerWeaponUpdate(SorterWeaponLogic weapon) | |
//Window?.UpdateWeaponText(weapon); | ||
} | ||
} | ||
|
||
} |
86 changes: 86 additions & 0 deletions
86
...t Framework - Heart Module/Data/Scripts/HeartModule/UserInterface/ResourceStatusWindow.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,86 @@ | ||
using RichHudFramework.Client; | ||
using RichHudFramework.UI; | ||
using RichHudFramework.UI.Client; | ||
using VRage.Game.Components; | ||
using VRageMath; | ||
|
||
namespace Heart_Module.Data.Scripts.HeartModule.UserInterface | ||
{ | ||
|
||
[MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)] | ||
internal class ResourceIndicator : MySessionComponentBase | ||
{ | ||
private bool _hasInitedHud = false; | ||
private ResourceStatusWindow _window; | ||
|
||
public override void UpdateAfterSimulation() | ||
{ | ||
base.UpdateAfterSimulation(); | ||
|
||
if (!RichHudClient.Registered) | ||
return; | ||
|
||
if (!_hasInitedHud) | ||
InitHud(); | ||
|
||
try | ||
{ | ||
// Here you would fetch the current resource count and update the window. | ||
// For demonstration purposes, let's assume a method GetResourceCount() returns an int. | ||
int resourceCount = GetResourceCount(); // You need to implement this method. | ||
_window.UpdateResourceInfo($"Resources: {resourceCount}"); | ||
} | ||
catch { /* Handle any exceptions appropriately */ } | ||
} | ||
|
||
private void InitHud() | ||
{ | ||
_window = new ResourceStatusWindow(HudMain.HighDpiRoot) | ||
{ | ||
Visible = true, | ||
}; | ||
|
||
_hasInitedHud = true; | ||
} | ||
|
||
private int GetResourceCount() | ||
{ | ||
// Implement logic to retrieve the current resource count | ||
return 0; // Placeholder return | ||
} | ||
} | ||
|
||
internal class ResourceStatusWindow : WindowBase | ||
{ | ||
private Label _resourceInfo; | ||
|
||
public ResourceStatusWindow(HudParentBase parent) : base(parent) | ||
{ | ||
_resourceInfo = new Label(body) | ||
{ | ||
ParentAlignment = ParentAlignments.Top | ParentAlignments.InnerH | ParentAlignments.InnerV, | ||
Text = "Resource Status: Initializing...", | ||
AutoResize = false, | ||
DimAlignment = DimAlignments.Both, | ||
}; | ||
|
||
// Window styling | ||
BodyColor = new Color(41, 54, 62, 150); | ||
BorderColor = new Color(58, 68, 77); | ||
|
||
header.Format = new GlyphFormat(Vector4.One, TextAlignment.Center); | ||
header.Height = 30f; | ||
|
||
HeaderText = "Resource Status"; | ||
Size = new Vector2(250f, 150f); | ||
// Adjust Offset here to align it with the ReloadWindow but a bit to the left | ||
Offset = new Vector2(580, 464); | ||
} | ||
|
||
public void UpdateResourceInfo(string infoText) | ||
{ | ||
_resourceInfo.Text = infoText; | ||
} | ||
} | ||
|
||
} |
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
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
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
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