Implement welcome screen and enhance session management in EditorManager

- Added a welcome screen that can be accessed from the View menu, improving user experience for new users.
- Enhanced session management by allowing the reuse of empty sessions when loading ROMs, reducing unnecessary session creation.
- Improved the session table layout for better readability and added a custom overworld feature flag for each session.
- Updated the DrawWelcomeScreen method for better visual integration and added a glow effect to the decorative line.
This commit is contained in:
scawful
2025-09-26 20:42:48 -04:00
parent d49d87852d
commit 1057a3f037
8 changed files with 384 additions and 120 deletions

View File

@@ -216,9 +216,32 @@ bool ClickableText(const std::string& text) {
bool hovered = ImGui::IsItemHovered();
bool clicked = ImGui::IsItemClicked();
// Render text with appropriate color
ImVec4 color = hovered ? ImGui::GetStyleColorVec4(ImGuiCol_Text)
: ImGui::GetStyleColorVec4(ImGuiCol_TextLink);
// Render text with high-contrast appropriate color
ImVec4 link_color = ImGui::GetStyleColorVec4(ImGuiCol_TextLink);
ImVec4 bg_color = ImGui::GetStyleColorVec4(ImGuiCol_WindowBg);
// Ensure good contrast against background
float contrast_factor = (bg_color.x + bg_color.y + bg_color.z) < 1.5f ? 1.0f : 0.3f;
ImVec4 color;
if (hovered) {
// Brighter color on hover for better visibility
color = ImVec4(
std::min(1.0f, link_color.x + 0.3f),
std::min(1.0f, link_color.y + 0.3f),
std::min(1.0f, link_color.z + 0.3f),
1.0f
);
} else {
// Ensure link color has good contrast
color = ImVec4(
std::max(contrast_factor, link_color.x),
std::max(contrast_factor, link_color.y),
std::max(contrast_factor, link_color.z),
1.0f
);
}
ImGui::GetWindowDrawList()->AddText(
pos, ImGui::ColorConvertFloat4ToU32(color), text.c_str());