forked from SomeCrazyGuy/Starfield-Console-Replacer
-
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.
Replace help tab with about tab, add about page draw callback
- Loading branch information
1 parent
607590b
commit 52c88a4
Showing
5 changed files
with
74 additions
and
35 deletions.
There are no files selected for viewing
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,38 @@ | ||
#include "main.h" | ||
#include "about_tab.h" | ||
#include "callback.h" | ||
|
||
static const auto SimpleDraw = GetBetterAPI()->SimpleDraw; | ||
|
||
extern void draw_about_tab() { | ||
uint32_t num_about; | ||
const auto handles = CallbackGetHandles(CALLBACKTYPE_ABOUT, &num_about); | ||
|
||
static const auto to_string = [](const void* handles, uint32_t index, char* fmt, uint32_t fmt_size) noexcept -> const char* { | ||
const RegistrationHandle* hs = (const RegistrationHandle*)handles; | ||
return CallbackGetName(hs[index]); | ||
}; | ||
|
||
static uint32_t selected = UINT32_MAX; | ||
SimpleDraw->HBoxLeft(0, 12.f); | ||
SimpleDraw->SelectionList(&selected, handles, num_about, to_string); | ||
SimpleDraw->HBoxRight(); | ||
if (selected < num_about) { | ||
const auto cb = CallbackGetCallback(CALLBACKTYPE_ABOUT, handles[selected]); | ||
ASSERT(cb.about_callback != NULL); | ||
cb.about_callback(ImGui::GetCurrentContext()); | ||
} | ||
SimpleDraw->HBoxEnd(); | ||
} | ||
|
||
extern void AboutTabCallback(void*) { | ||
char max_path[_MAX_PATH]; | ||
SimpleDraw->Text("BetterConsole Version %s", BETTERCONSOLE_VERSION); | ||
SimpleDraw->Text("Build ID: %s - %s", __DATE__, __TIME__); | ||
ImGui::SeparatorText("Help and Support"); | ||
SimpleDraw->LinkButton("BetterConsole on Nexusmods", "https://www.nexusmods.com/starfield/mods/3683"); | ||
SimpleDraw->LinkButton("Constellation by V2 (Discord)", "https://discord.gg/v2-s-collections-1076179431195955290"); | ||
SimpleDraw->LinkButton("Linuxversion on Reddit", "https://www.reddit.com/user/linuxversion/"); | ||
SimpleDraw->LinkButton("Open Log File", GetPathInDllDir(max_path, "BetterConsoleLog.txt")); | ||
SimpleDraw->LinkButton("Open Config File", GetPathInDllDir(max_path, "BetterConsoleConfig.txt")); | ||
} |
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,4 @@ | ||
#pragma once | ||
|
||
extern void draw_about_tab(); | ||
extern void AboutTabCallback(void*); |
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