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

Commit

Permalink
Stabilize v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
frothy-wifi committed Apr 9, 2024
1 parent 2493cb3 commit 920e03e
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 17 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# <p align=center>Changelog</p>
# v1.2.1
# v1.4.1 *[Patch]*
- Fix settings not saving
- Update `help` command
- Add manual update check command - `ckupdate`
- Refactor some code
## v1.4
- Added automatic update checking!
## v1.3
- Added control messages to confirm that your changes have been noticed by the mod
- Commandds
## v1.2.1
- Added a new logo
## v1.2
- Added message on HUD message reload
Expand Down
Binary file modified CHBuild/.vs/CHBuild/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file modified CHBuild/.vs/CHBuild/v17/.futdcache.v2
Binary file not shown.
Binary file modified CHBuild/.vs/CHBuild/v17/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion CHBuild/.vs/CHBuild/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"RelativeDocumentMoniker": "Program.cs",
"ToolTip": "C:\\Users\\froth\\OneDrive\\Desktop\\CYNHUD\\CHBuild\\Program.cs",
"RelativeToolTip": "Program.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA8AAAA5AQAA",
"ViewState": "AQIAAA0AAAAAAAAAAAAAAA8AAAAEAgAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-08T18:20:03.119Z",
"EditorCaption": ""
Expand Down
Binary file modified CHBuild/.vs/ProjectEvaluation/chbuild.metadata.v7.bin
Binary file not shown.
Binary file modified CHBuild/.vs/ProjectEvaluation/chbuild.projects.v7.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion CHBuild/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void Build(string version, bool isThunderstoreBuild=false)
string newFolderName = $"FrothyWiFi-CYNHUD-{version}";
Process process = new();
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = isThunderstoreBuild ? $@"Copy-Item -Path ""CYNHUD"" -Destination ""{newFolderName}"" -Recurse; Remove-Item -Path ""{newFolderName}\.gitignore"" -Force; Remove-Item -Path ""{newFolderName}\CHBuild"" -Force -Recurse; Remove-Item -Path {newFolderName}\.git -Force -Recurse; Compress-Archive -Path {newFolderName}\* -DestinationPath {newFolderName}.zip; Remove-Item -Path {newFolderName} -Force -Recurse" : $@"Copy-Item -Path ""CYNHUD"" -Destination ""{newFolderName}"" -Recurse; Remove-Item -Path ""{newFolderName}\.gitignore"" -Force; Remove-Item -Path ""{newFolderName}\CHBuild"" -Force -Recurse; Remove-Item -Path {newFolderName}\.git -Force -Recurse";
process.StartInfo.Arguments = isThunderstoreBuild ? $@"Copy-Item -Path ""CYNHUD"" -Destination ""{newFolderName}"" -Recurse; Remove-Item -Path ""{newFolderName}\.gitignore"" -Force; Remove-Item -Path ""{newFolderName}\CHBuild"" -Force -Recurse; Remove-Item -Path {newFolderName}\.git -Force -Recurse; Compress-Archive -Path {newFolderName}\* -DestinationPath {newFolderName}.zip; Remove-Item -Path {newFolderName} -Force -Recurse" : $@"Copy-Item -Path ""CYNHUD"" -Destination ""{newFolderName}"" -Recurse";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.Start();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CYNHUD",
"version_number": "1.3.0",
"version_number": "1.4.1",
"website_url": "https://github.com/frothy-wifi/CYNHUD",
"description": "Adds an easily customizable (through Mod Settings) message to your HUD and useful game commands.",
"dependencies": []
Expand Down
8 changes: 5 additions & 3 deletions mods/FrothyWiFi.CYNHUD/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
"Description": "Adds an easily customizable (through Mod Settings) message to your HUD and useful game commands.",
"LoadPriority": 2,
"RequiredOnClient": false,
"Version": "1.3.0",
"Version": "1.4.1",
"ConVars": [
{
"Name": "ch_hud_message",
"DefaultValue": "get snuck-up on",
"HelpString": "The message CYNHUD will display on your HUD."
"HelpString": "The message CYNHUD will display on your HUD.",
"Flags": 16777216
},
{
"Name": "ch_hud_message_pos",
"DefaultValue": "Middle",
"HelpString": "The position of the message CYNHUD will display on your HUD. (Bottom, Middle, Top)"
"HelpString": "The position of the message CYNHUD will display on your HUD. (Bottom, Middle, Top)",
"Flags": 16777216
}
],
"Scripts": [
Expand Down
49 changes: 40 additions & 9 deletions mods/FrothyWiFi.CYNHUD/mod/scripts/vscripts/cynhud.nut
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,52 @@ var rui = null;
string mapName = "";
string message = "";
string messagePos = "";
bool shouldReload = false;
string version = "1.4.0";
bool reloadRequest = false;
bool hasShownWelcomeTextAlready = false;

void function CynHud_CheckForUpdates() {
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response) {
string webVersion = response.body;
print(response.body);
if (webVersion[0] > version[0]) {
CynHud_WriteChatMessage("New update available: \x1b[113mv" + response.body + "\x1b[0m. Get it from \x1b[111mThunderstore\x1b[0m or \x1b[111mGitHub\x1b[0m.");
} else if (webVersion[2] > version[2]) {
CynHud_WriteChatMessage("New update available: \x1b[113mv" + response.body + "\x1b[0m. Get it from \x1b[111mThunderstore\x1b[0m or \x1b[111mGitHub\x1b[0m.");
} else if (webVersion[4] > version[4]) {
CynHud_WriteChatMessage("New patch available: \x1b[113mv" + response.body + "\x1b[0m. Get it from \x1b[111mThunderstore\x1b[0m or \x1b[111mGitHub\x1b[0m.");
} else {
CynHud_WriteChatMessage("No updates found. Have a good day!")
}
}
void functionref(HttpRequestFailure) onFailure = void function(HttpRequestFailure failure) {
CynHud_WriteChatMessage("\x1b[112mUpdate check failed:\x1b[0m code \x1b[113" + failure.errorCode.tostring() + ": " + failure.errorMessage + "\x1b[0m.");
}
if (NSHttpGet("https://frothywifi.cc/r2ns-ckupdate/cynhud.txt", {}, onSuccess, onFailure)) {
CynHud_WriteChatMessage("Checking for updates.");
} else {
CynHud_WriteChatMessage("\x1b[112mUpdate check failed:\x1b[0m Couldn't start the HTTP request. Do you have HTTP requests disabled in your launch options?");
}
}

ClClient_MessageStruct function CynHud_CommandFilter(ClClient_MessageStruct message) {
if (message.message == "$ch.help") {
message.shouldBlock = true;
Chat_GameWriteLine("\x1b[33m--== CYNHUD commands ==--\x1b[0m");
Chat_GameWriteLine("All CYNHUD commands \x1b[112mmust\x1b[0m be prefaced with \x1b[33m\"$ch.\"\x1b[0m.");
Chat_GameWriteLine("\x1b[33m$ch.help\x1b[0m - Show available commands.");
Chat_GameWriteLine("\x1b[33m$ch.reload\x1b[0m - Reload the HUD message manually.")
Chat_GameWriteLine("\x1b[33m$ch.uid\x1b[0m - Show your user ID. CYNHUD also uses this to greet you.");
Chat_GameWriteLine("All CYNHUD commands \x1b[112mmust\x1b[0m be prefaced with \x1b[33m\"$ch.\"\x1b[0m, for example \x1b[33m$ch.uid\x1b[0m.");
Chat_GameWriteLine("\x1b[33mhelp\x1b[0m - Show available commands.");
Chat_GameWriteLine("\x1b[33mreload\x1b[0m - Reload the HUD message manually.")
Chat_GameWriteLine("\x1b[33muid\x1b[0m - Show your user ID. CYNHUD also uses this to greet you.");
Chat_GameWriteLine("\x1b[33mckupdate\x1b[0m - Check for CYNHUD updates.");
} else if (message.message == "$ch.reload") {
message.shouldBlock = true;
shouldReload = true;
reloadRequest = true;
} else if (message.message == "$ch.uid") {
message.shouldBlock = true;
CynHud_WriteChatMessage("You are Pilot \x1b[111m" + NSGetLocalPlayerUID() + "\x1b[0m.");
} else if (message.message == "$ch.ckupdate") {
message.shouldBlock = true;
CynHud_CheckForUpdates();
}
return message;
}
Expand Down Expand Up @@ -60,11 +89,12 @@ void function CynHud_DoMessage() {
while (mapName == GetMapName()) {
WaitFrame();
if (!hasShownWelcomeTextAlready && mapName != "mp_lobby") {
CynHud_WriteChatMessage("Welcome back, \x1b[111m" + NSGetLocalPlayerUID() + "\x1b[0m. Run $ch.help for a list of commands.");
thread CynHud_CheckForUpdates();
CynHud_WriteChatMessage("Welcome back, \x1b[111m" + NSGetLocalPlayerUID() + "\x1b[0m. Run \x1b[33m$ch.help\x1b[0m for a list of commands.");
hasShownWelcomeTextAlready = true;
}
if (shouldReload) {
shouldReload = false;
if (reloadRequest) {
reloadRequest = false;
RuiDestroy(rui);
CynHud_WriteChatMessage("Manual reload request recieved; reloading HUD message.");
CynHud_DoMessage();
Expand All @@ -90,6 +120,7 @@ void function CynHud_WriteChatMessage(string message) {

void function CynHud_Init() {
AddCallback_OnReceivedSayTextMessage(CynHud_CommandFilter);
CynHud_CheckForUpdates();
thread CynHud_DoMessage();
}
#endif

0 comments on commit 920e03e

Please sign in to comment.