sys: Final cleanup to get rid of everything builtin in the main application

This commit is contained in:
WerWolv
2022-02-02 00:36:09 +01:00
parent f76e65a58d
commit 876dbe8179
24 changed files with 818 additions and 783 deletions

View File

@@ -8,7 +8,9 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <fontawesome_font.h>
#include <codicons_font.h>
namespace hex::plugin::windows {
@@ -24,6 +26,29 @@ namespace hex::plugin::windows {
return a.QuadPart - b.QuadPart;
}
void addTitleBarButtons() {
#if defined(DEBUG)
ContentRegistry::Interface::addTitleBarButton(ICON_VS_DEBUG, "hex.windows.title_bar_button.debug_build", []{
if (ImGui::GetIO().KeyCtrl) {
// Explicitly trigger a segfault by writing to an invalid memory location
// Used for debugging crashes
*reinterpret_cast<u8 *>(0x10) = 0x10;
} else if (ImGui::GetIO().KeyShift) {
// Explicitly trigger an abort by throwing an uncaught exception
// Used for debugging exception errors
throw std::runtime_error("Debug Error");
} else {
hex::openWebpage("https://imhex.werwolv.net/debug");
}
});
#endif
ContentRegistry::Interface::addTitleBarButton(ICON_VS_SMILEY, "hex.windows.title_bar_button.feedback", []{
hex::openWebpage("mailto://hey@werwolv.net");
});
}
void addFooterItems() {
ContentRegistry::Interface::addFooterItem([] {

View File

@@ -5,6 +5,9 @@ namespace hex::plugin::windows {
void registerLanguageEnUS() {
ContentRegistry::Language::addLocalizations("en-US", {
{ "hex.windows.title_bar_button.feedback", "Leave Feedback" },
{ "hex.windows.title_bar_button.debug_build", "Debug build"},
{ "hex.windows.view.tty_console.name", "TTY Console" },
{ "hex.windows.view.tty_console.config", "Configuration"},
{ "hex.windows.view.tty_console.port", "Port" },

View File

@@ -5,6 +5,9 @@ namespace hex::plugin::windows {
void registerLanguageZhCN() {
ContentRegistry::Language::addLocalizations("zh-CN", {
{ "hex.windows.title_bar_button.feedback", "反馈" },
{ "hex.windows.title_bar_button.debug_build", "调试构建"},
{ "hex.windows.view.tty_console.name", "TTY控制台" },
{ "hex.windows.view.tty_console.config", "配置"},
{ "hex.windows.view.tty_console.port", "端口" },

View File

@@ -10,6 +10,7 @@ namespace hex::plugin::windows {
void registerLanguageZhCN();
void addFooterItems();
void addTitleBarButtons();
void registerSettings();
}
@@ -23,5 +24,6 @@ IMHEX_PLUGIN_SETUP("Windows", "WerWolv", "Windows-only features") {
registerLanguageZhCN();
addFooterItems();
addTitleBarButtons();
registerSettings();
}