[Scummvm-git-logs] scummvm master -> 993e1e9fb2043a8b965fad827ab037bd1b23c27f
sev-
noreply at scummvm.org
Sat Jun 8 00:05:15 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
993e1e9fb2 DIRECTOR: DT: Moved more color constants to settings
Commit: 993e1e9fb2043a8b965fad827ab037bd1b23c27f
https://github.com/scummvm/scummvm/commit/993e1e9fb2043a8b965fad827ab037bd1b23c27f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-06-08T02:04:47+02:00
Commit Message:
DIRECTOR: DT: Moved more color constants to settings
Changed paths:
engines/director/debugger/debugtools.cpp
engines/director/debugger/dt-internal.h
engines/director/debugger/dt-logger.cpp
diff --git a/engines/director/debugger/debugtools.cpp b/engines/director/debugger/debugtools.cpp
index 7e4e15d034e..744c1816693 100644
--- a/engines/director/debugger/debugtools.cpp
+++ b/engines/director/debugger/debugtools.cpp
@@ -204,16 +204,12 @@ void showImage(const ImGuiImage &image, const char *name, float thumbnailSize) {
void displayVariable(const Common::String &name, bool changed) {
ImU32 var_color = ImGui::GetColorU32(_state->_colors._var_ref);
-
- const ImU32 disp_color_disabled = ImGui::GetColorU32(ImVec4(0.9f, 0.08f, 0.0f, 0.0f));
- const ImU32 disp_color_enabled = ImGui::GetColorU32(ImVec4(0.9f, 0.08f, 0.0f, 1.0f));
- const ImU32 disp_color_hover = ImGui::GetColorU32(ImVec4(0.42f, 0.17f, 0.13f, 1.0f));
ImU32 color;
- color = disp_color_disabled;
+ color = ImGui::GetColorU32(_state->_colors._bp_color_disabled);
if (_state->_variables.contains(name))
- color = disp_color_enabled;
+ color = ImGui::GetColorU32(_state->_colors._bp_color_enabled);
ImDrawList *dl = ImGui::GetWindowDrawList();
ImVec2 pos = ImGui::GetCursorScreenPos();
@@ -222,20 +218,20 @@ void displayVariable(const Common::String &name, bool changed) {
ImGui::InvisibleButton("Line", ImVec2(textSize.x + eyeSize.x, textSize.y));
if (ImGui::IsItemClicked(0)) {
- if (color == disp_color_enabled) {
+ if (color == ImGui::GetColorU32(_state->_colors._bp_color_enabled)) {
_state->_variables.erase(name);
- color = disp_color_disabled;
+ color = ImGui::GetColorU32(_state->_colors._bp_color_disabled);
} else {
_state->_variables[name] = true;
- color = disp_color_enabled;
+ color = ImGui::GetColorU32(_state->_colors._bp_color_enabled);
}
}
if (changed)
var_color = ImGui::GetColorU32(_state->_colors._var_ref_changed);
- if (color == disp_color_disabled && ImGui::IsItemHovered()) {
- color = disp_color_hover;
+ if (color == ImGui::GetColorU32(_state->_colors._bp_color_disabled) && ImGui::IsItemHovered()) {
+ color = ImGui::GetColorU32(_state->_colors._bp_color_hover);
}
dl->AddText(pos, color, "\ue8f4 "); // visibility
@@ -293,7 +289,8 @@ static void showSettings() {
ImGui::ColorEdit4("Breakpoint disabled", &_state->_colors._bp_color_disabled.x);
ImGui::ColorEdit4("Breakpoint enabled", &_state->_colors._bp_color_enabled.x);
ImGui::ColorEdit4("Breakpoint hover", &_state->_colors._bp_color_hover.x);
- ImGui::SeparatorText("Lingo highlighting");
+
+ ImGui::SeparatorText("Lingo syntax");
ImGui::ColorEdit4("Line", &_state->_colors._line_color.x);
ImGui::ColorEdit4("Call", &_state->_colors._call_color.x);
ImGui::ColorEdit4("Builtin", &_state->_colors._builtin_color.x);
@@ -303,10 +300,21 @@ static void showSettings() {
ImGui::ColorEdit4("Type", &_state->_colors._type_color.x);
ImGui::ColorEdit4("Keyword", &_state->_colors._keyword_color.x);
ImGui::ColorEdit4("The entity", &_state->_colors._the_color.x);
+
ImGui::SeparatorText("References");
ImGui::ColorEdit4("Script", &_state->_colors._script_ref.x);
ImGui::ColorEdit4("Variable", &_state->_colors._var_ref.x);
ImGui::ColorEdit4("Variable changed", &_state->_colors._var_ref_changed.x);
+
+ ImGui::SeparatorText("Logger");
+ ImGui::ColorEdit4("Error", &_state->_colors._logger_error.x);
+ ImGui::ColorEdit4("Error Button", &_state->_colors._logger_error_b.x);
+ ImGui::ColorEdit4("Warning", &_state->_colors._logger_warning.x);
+ ImGui::ColorEdit4("Warning Button", &_state->_colors._logger_warning_b.x);
+ ImGui::ColorEdit4("Info", &_state->_colors._logger_info.x);
+ ImGui::ColorEdit4("Info Button", &_state->_colors._logger_info_b.x);
+ ImGui::ColorEdit4("Debug", &_state->_colors._logger_debug.x);
+ ImGui::ColorEdit4("Debug Button", &_state->_colors._logger_debug_b.x);
}
ImGui::End();
}
diff --git a/engines/director/debugger/dt-internal.h b/engines/director/debugger/dt-internal.h
index 3d5c85dce2a..7b5afd613b6 100644
--- a/engines/director/debugger/dt-internal.h
+++ b/engines/director/debugger/dt-internal.h
@@ -137,6 +137,16 @@ typedef struct ImGuiState {
ImVec4 _script_ref = ImColor(IM_COL32(0x7f, 0x7f, 0xff, 0xfff));
ImVec4 _var_ref = ImColor(IM_COL32(0xe6, 0xe6, 0x00, 0xff));
ImVec4 _var_ref_changed = ImColor(IM_COL32(0xFF, 0x00, 0x00, 0xFF));
+
+ ImVec4 _logger_error_b = ImVec4(1.f, 0.f, 0.f, 1.f);
+ ImVec4 _logger_warning_b = ImVec4(1.f, 1.f, 0.f, 1.f);
+ ImVec4 _logger_info_b = ImVec4(1.f, 1.f, 1.f, 1.f);
+ ImVec4 _logger_debug_b = ImVec4(0.8f, 0.8f, 0.8f, 1.f);
+
+ ImVec4 _logger_error = ImVec4(1.0f, 0.4f, 0.4f, 1.0f);
+ ImVec4 _logger_warning = ImVec4(1.0f, 1.0f, 0.4f, 1.0f);
+ ImVec4 _logger_info = ImVec4(1.0f, 0.8f, 0.6f, 1.0f);
+ ImVec4 _logger_debug = ImVec4(0.8f, 0.8f, 0.8f, 1.0f);
} _colors;
struct {
diff --git a/engines/director/debugger/dt-logger.cpp b/engines/director/debugger/dt-logger.cpp
index 18b9e04b73b..95ec8331edc 100644
--- a/engines/director/debugger/dt-logger.cpp
+++ b/engines/director/debugger/dt-logger.cpp
@@ -141,28 +141,28 @@ void ImGuiLogger::draw(const char *title, bool *p_open) {
ImGui::SameLine();
// Error
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 0.f, 0.f, 1.f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_error_b);
toggleButton("\ue160", &_showError);
ImGui::PopStyleColor();
ImGui::SetItemTooltip("Show Errors");
ImGui::SameLine();
// Warning
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 0.f, 1.f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_warning_b);
toggleButton("\ue002", &_showWarn);
ImGui::PopStyleColor();
ImGui::SetItemTooltip("Show Warnings");
ImGui::SameLine();
// Info
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_info_b);
toggleButton("\ue88e", &_showInfo);
ImGui::PopStyleColor();
ImGui::SetItemTooltip("Show Info");
ImGui::SameLine();
// Debug
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8f, 0.8f, 0.8f, 1.f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_debug_b);
toggleButton("\ue868", &_showdebug);
ImGui::PopStyleColor();
ImGui::SetItemTooltip("Show Debug");
@@ -207,18 +207,18 @@ void ImGuiLogger::draw(const char *title, bool *p_open) {
bool pop_color = false;
if (isError) {
item += 7;
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_error);
pop_color = true;
} else if (isWarn) {
item += 6;
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 0.4f, 1.0f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_warning);
pop_color = true;
} else if (isDebug) {
item += 7;
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8f, 0.8f, 0.8f, 1.0f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_debug);
pop_color = true;
} else if (strncmp(item, "> ", 2) == 0) {
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.8f, 0.6f, 1.0f));
+ ImGui::PushStyleColor(ImGuiCol_Text, _state->_colors._logger_info);
pop_color = true;
}
ImGui::TextUnformatted(item);
More information about the Scummvm-git-logs
mailing list