Skip to content

Commit

Permalink
feat: new ui
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMcAvoy committed Jan 1, 2025
1 parent c8929b9 commit b833dc2
Show file tree
Hide file tree
Showing 9 changed files with 28,288 additions and 169 deletions.
2 changes: 2 additions & 0 deletions CarbonLauncher/CarbonLauncher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
<ClCompile Include="src\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\font\IconsFontAwesome6.h" />
<ClInclude Include="include\font\IconsFontAwesome6.h_fa-solid-900.ttf.h" />
<ClInclude Include="include\guimanager.h" />
<ClInclude Include="include\discordmanager.h" />
<ClInclude Include="include\gamemanager.h" />
Expand Down
1,416 changes: 1,416 additions & 0 deletions CarbonLauncher/include/font/IconsFontAwesome6.h

Large diffs are not rendered by default.

26,643 changes: 26,643 additions & 0 deletions CarbonLauncher/include/font/IconsFontAwesome6.h_fa-solid-900.ttf.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CarbonLauncher/include/gamemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Carbon {
// Starts the game and waits for it to be running
// This function will block until the game is running
// This function spawns a new thread to actually start the game process
void StartGame();
void LaunchGame();

// Stops the game forcefully
void KillGame();
Expand Down
7 changes: 7 additions & 0 deletions CarbonLauncher/include/guimanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ namespace Carbon {

GLFWwindow* window;
std::function<void()> renderCallback;

enum class Tab {
MyMods,
Discover,
Console,
Settings,
} tab{ Tab::MyMods };
};
}; // namespace Carbon

Expand Down
13 changes: 8 additions & 5 deletions CarbonLauncher/src/discordmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,23 @@ DiscordManager::DiscordManager() {
activity.SetDetails("https://github.com/ScrappySM/CarbonLauncher!");
activity.SetState("In the launcher!");

activity.GetAssets().SetLargeImage("carbonlauncher");
activity.GetAssets().SetLargeImage("icon");
activity.GetAssets().SetLargeText("Carbon Launcher");
activity.GetAssets().SetSmallImage("carbonlauncher");
activity.GetAssets().SetSmallText("Carbon Launcher");
/*activity.GetAssets().SetSmallImage("icon");
activity.GetAssets().SetSmallText("Carbon Launcher");*/

activity.SetType(discord::ActivityType::Playing);

activity.SetSupportedPlatforms((uint32_t)discord::ActivitySupportedPlatformFlags::Desktop);

this->core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {
if (result != discord::Result::Ok) {
spdlog::error("Failed to update Discord RPC (error: {})", (int)result);
}
});

activity.GetAssets().SetLargeImage("icon");
activity.GetAssets().SetLargeText("Carbon Launcher");

this->UpdateActivity();
}


Expand Down
17 changes: 1 addition & 16 deletions CarbonLauncher/src/gamemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void GameManager::InjectModule(const std::string& modulePath) {
spdlog::info("Injected module `{}`", modulePath);
}

void GameManager::StartGame() {
void GameManager::LaunchGame() {
this->gameStartedTime = std::nullopt;
this->gameRunning = false;
this->pid = 0;
Expand Down Expand Up @@ -282,21 +282,6 @@ bool GameManager::IsModuleLoaded(const std::string& moduleName) const {
}

int GameManager::GetLoadedCustomModules() const {
/*spdlog::critical("Finished waiting for injection");
int count = 0;
for (auto& file : std::filesystem::recursive_directory_iterator(Utils::GetCurrentModuleDir() + "mods")) {
if (file.is_regular_file() && file.path().extension() == ".dll") {
if (this->IsModuleLoaded(file.path().filename().string())) {
count++;
}
}
}
spdlog::critical("{} custom modules loaded", count);
return count;*/

while (!this->loadedCustomModules.has_value()) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
Expand Down
Loading

0 comments on commit b833dc2

Please sign in to comment.