Skip to content

Commit

Permalink
Allow users to set the discord and website links
Browse files Browse the repository at this point in the history
  • Loading branch information
EddieEldridge committed Dec 17, 2024
1 parent dca54b1 commit 5c22127
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions M2TWEOP Code/M2TWEOP GUI/dataG.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class dataG

// Discord Rich Presence
bool isDiscordRichPresenceEnabled = true;
string discordServerLink = "";
string websiteLink = "";

// Customization Options
string modTitle = "";
Expand Down
4 changes: 2 additions & 2 deletions M2TWEOP Code/M2TWEOP GUI/mainUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ namespace mainUI
}
if (ImGui::Button("Website", helpers::getScreen().centerXButton))
{
ShellExecuteA(NULL, "open", "https://youneuoy.github.io/M2TWEOP-library/ ", NULL, NULL, SW_SHOWNORMAL);
ShellExecuteA(NULL, "open", dataG::data.gameData.websiteLink, NULL, NULL, SW_SHOWNORMAL);
}
if (ImGui::Button("Discord", helpers::getScreen().centerXButton))
{
ShellExecuteA(NULL, "open", "https://discord.gg/Epqjm8u2WK", NULL, NULL, SW_SHOWNORMAL);
ShellExecuteA(NULL, "open", dataG::data.gameData.discordServerLink;, NULL, NULL, SW_SHOWNORMAL);
}
ImGui::End();

Expand Down
10 changes: 10 additions & 0 deletions M2TWEOP Code/M2TWEOP GUI/managerG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ namespace managerG
{
getJson(dataG::data.gameData.modTitle, "modTitle");
}
if (json.contains("discordServerLink"))
{
getJson(dataG::data.gameData.discordServerLink, "discordServerLink");
}
if (json.contains("websiteLink"))
{
getJson(dataG::data.gameData.websiteLink, "websiteLink");
}
if (json.contains("modVersion"))
{
getJson(dataG::data.gameData.modVersion, "modVersion");
Expand Down Expand Up @@ -245,6 +253,8 @@ namespace managerG
setJson("hideLauncher", dataG::data.modData.hideLauncherAtStart);
setJson("playBackgroundMusic", dataG::data.audio.bkgMusic.isMusicNeeded);
setJson("musicVolume", dataG::data.audio.bkgMusic.musicVolume);
setJson("websiteLink", dataG::data.gameData.websiteLink);
setJson("discordServerLink", dataG::data.gameData.discordServerLink);
setJson("modTitle", dataG::data.gameData.modTitle);
setJson("modVersion", dataG::data.gameData.modVersion);
setJson("runButtonColor", dataG::data.gameData.buttonColorString);
Expand Down
4 changes: 3 additions & 1 deletion M2TWEOP DataFiles/eopData/config/uiCfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"runButtonColor": "201, 169, 64, 150",
"runButtonHoverColor": "201, 169, 64, 250",
"launcherTheme": "default",
"modVersion": ""
"modVersion": "",
"discordServerLink": "https://discord.gg/Epqjm8u2WK",
"websiteLink": "https://youneuoy.github.io/M2TWEOP-library/"
}

0 comments on commit 5c22127

Please sign in to comment.