Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Stabilized v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Brock Graton committed Apr 5, 2024
1 parent 997f7c8 commit c3052eb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "CYNHUD",
"version_number": "1.0.0",
"website_url": "https://github.com/frothy-wifi/CYNHUD",
"description": "Adds an easily customizable message to your HUD, with the default message as a Cyn reference.",
"description": "Adds an easily customizable (through Mod Settings) message to your HUD, with the default message as a Cyn reference.",
"dependencies": []
}
6 changes: 3 additions & 3 deletions mods/FrothyWiFi.CYNHUD/mod.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"Name": "FrothyWiFi.CYNHUD",
"Description": "Adds an easily customizable message to your HUD, with the default message as a Cyn reference.",
"Description": "Adds an easily customizable (through Mod Settings) message to your HUD, with the default message as a Cyn reference.",
"LoadPriority": 2,
"RequiredOnClient": false,
"Version": "1.0.0",
"Version": "1.1.0",
"ConVars": [
{
"Name": "ch_hud_message",
"DefaultValue": "get snuck-up on"
},
{
"Name": "ch_hud_message_pos",
"DefaultValue": "Bottom-right"
"DefaultValue": "Middle"
}
],
"Scripts": [
Expand Down
33 changes: 18 additions & 15 deletions mods/FrothyWiFi.CYNHUD/mod/scripts/vscripts/cynhud.nut
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// TODO: Fix the message position logic
// TODO: Fix the message position logic /// IN PROGRESS
global function CynHud_Init;

#if CLIENT
Expand All @@ -9,19 +9,20 @@ void function CynHud_Init() {
var rui = null;
string mapName = "";
string message = "";
// string messagePos = "";
string messagePos = "";

void function CynHud_ConfigureRui() {
RuiSetInt(rui, "maxLines", 1);
RuiSetInt(rui, "lineNum", 1);
// if (messagePos == "Bottom-right") {
// RuiSetFloat2(rui, "msgPos", <0.825, 0.92, 0.0>);
// } else if (messagePos == "Middle-right") {
// RuiSetFloat2(rui, "msgPos", <0.825, 0.46, 0.0>);
// } else if (messagePos == "Top-right") {
// RuiSetFloat2(rui, "msgPos", <0.825, -0.92, 0.0>);
// }
RuiSetFloat2(rui, "msgPos", <0.825, 0.92, 0.0>);
if (messagePos == "Bottom") {
RuiSetFloat2(rui, "msgPos", <0.825, 0.92, 0.0>);
} else if (messagePos == "Middle") {
RuiSetFloat2(rui, "msgPos", <0.825, 0.46, 0.0>);
} else if (messagePos == "Top") {
RuiSetFloat2(rui, "msgPos", <0.825, 0.0, 0.0>);
} else {
RuiSetFloat2(rui, "msgPos", <0.825, 0.46, 0.0>);
}
RuiSetString(rui, "msgText", message);
RuiSetFloat(rui, "msgFontSize", 25.0);
RuiSetFloat(rui, "msgAlpha", 0.5);
Expand All @@ -35,8 +36,10 @@ void function CynHud_DoMessage() {
mapName = GetMapName();
rui = RuiCreate($"ui/cockpit_console_text_top_left.rpak", clGlobal.topoCockpitHudPermanent, RUI_DRAW_COCKPIT, 0);
message = GetConVarString("ch_hud_message");
// messagePos = GetConVarString("ch_hud_message_pos");
messagePos = GetConVarString("ch_hud_message_pos");

WaitFrame();

CynHud_ConfigureRui();

while (mapName == GetMapName()) {
Expand All @@ -45,10 +48,10 @@ void function CynHud_DoMessage() {
RuiDestroy(rui);
CynHud_DoMessage();
}
// if (GetConVarString("ch_hud_message_pos") != messagePos) {
// RuiDestroy(rui);
// CynHud_DoMessage();
// }
if (GetConVarString("ch_hud_message_pos") != messagePos) {
RuiDestroy(rui);
CynHud_DoMessage();
}
}
RuiDestroy(rui);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ void function CynHud_AddModSettings() {
AddModTitle("CYNHUD");
AddModCategory("Configuration");
AddConVarSetting("ch_hud_message", "HUD Message (case-insensitive)");
// AddConVarSettingEnum("ch_hud_message_pos", "HUD Message Position on Screen", ["Bottom-right", "Middle-right", "Top-right"]);
AddConVarSetting("ch_hud_message_pos", "HUD Message Position on Screen (Bottom, Middle, Top)");
}
#endif

0 comments on commit c3052eb

Please sign in to comment.