impr: Better auto updater, added support for updating nightlies

This commit is contained in:
WerWolv
2025-08-08 21:25:52 +02:00
parent 9698232f69
commit 82ceb2e11f
7 changed files with 220 additions and 144 deletions

View File

@@ -821,6 +821,7 @@ EXPORT_MODULE namespace hex {
struct TitleBarButton {
std::string icon;
ImGuiCustomCol color;
UnlocalizedString unlocalizedTooltip;
ClickCallback callback;
};
@@ -1007,11 +1008,13 @@ EXPORT_MODULE namespace hex {
/**
* @brief Adds a new title bar button
* @param icon The icon to use for the button
* @param color The color of the icon
* @param unlocalizedTooltip The unlocalized tooltip to use for the button
* @param function The function to call when the button is clicked
*/
void addTitleBarButton(
const std::string &icon,
ImGuiCustomCol color,
const UnlocalizedString &unlocalizedTooltip,
const impl::ClickCallback &function
);

View File

@@ -1071,8 +1071,8 @@ namespace hex {
impl::s_sidebarItems->push_back({ icon, function, enabledCallback });
}
void addTitleBarButton(const std::string &icon, const UnlocalizedString &unlocalizedTooltip, const impl::ClickCallback &function) {
impl::s_titlebarButtons->push_back({ icon, unlocalizedTooltip, function });
void addTitleBarButton(const std::string &icon, ImGuiCustomCol color, const UnlocalizedString &unlocalizedTooltip, const impl::ClickCallback &function) {
impl::s_titlebarButtons->push_back({ icon, color, unlocalizedTooltip, function });
}
void addWelcomeScreenQuickSettingsToggle(const std::string &icon, const UnlocalizedString &unlocalizedTooltip, bool defaultState, const impl::ToggleCallback &function) {

View File

@@ -941,7 +941,7 @@ namespace hex {
std::string updateTypeString;
switch (updateType) {
case UpdateType::Stable:
updateTypeString = "latest";
updateTypeString = "stable";
break;
case UpdateType::Nightly:
updateTypeString = "nightly";