2015-09-29 02:36:24 +02:00
|
|
|
#include "settings.h"
|
2016-06-12 23:24:33 +02:00
|
|
|
#include "editor/studio_app.h"
|
2016-05-22 12:40:42 +02:00
|
|
|
#include "editor/world_editor.h"
|
|
|
|
#include "engine/engine.h"
|
2016-05-10 08:24:31 +02:00
|
|
|
#include "engine/fs/os_file.h"
|
|
|
|
#include "engine/log.h"
|
2016-04-22 18:34:34 +02:00
|
|
|
#include "engine/debug/debug.h"
|
2015-12-23 19:52:09 +01:00
|
|
|
#include "imgui/imgui.h"
|
2015-10-25 13:07:53 +01:00
|
|
|
#include "platform_interface.h"
|
2015-09-29 02:36:24 +02:00
|
|
|
#include "utils.h"
|
|
|
|
#include <cstdio>
|
|
|
|
#include <lua.hpp>
|
2016-05-24 21:14:34 +02:00
|
|
|
#include <SDL.h>
|
2015-09-29 02:36:24 +02:00
|
|
|
|
|
|
|
|
2017-05-23 19:57:11 +02:00
|
|
|
namespace Lumix
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2016-03-05 22:58:55 +01:00
|
|
|
static const char DEFAULT_SETTINGS_PATH[] = "studio_default.ini";
|
2015-09-29 02:36:24 +02:00
|
|
|
static const char SETTINGS_PATH[] = "studio.ini";
|
|
|
|
|
|
|
|
|
2016-06-07 22:49:16 +02:00
|
|
|
static void loadStyle(lua_State* L)
|
|
|
|
{
|
|
|
|
if (lua_getglobal(L, "style") == LUA_TTABLE)
|
|
|
|
{
|
|
|
|
auto& style = ImGui::GetStyle();
|
2017-08-27 23:17:47 +02:00
|
|
|
for (int i = 0; i < ImGuiCol_COUNT; ++i)
|
|
|
|
{
|
2017-10-19 00:20:37 +02:00
|
|
|
const char* name = ImGui::GetStyleColorName(i);
|
2017-08-27 23:17:47 +02:00
|
|
|
if (lua_getfield(L, -1, name) == LUA_TTABLE)
|
|
|
|
{
|
|
|
|
if (lua_rawgeti(L, -1, 1) == LUA_TNUMBER) style.Colors[i].x = (float)lua_tonumber(L, -1);
|
|
|
|
if (lua_rawgeti(L, -2, 2) == LUA_TNUMBER) style.Colors[i].y = (float)lua_tonumber(L, -1);
|
|
|
|
if (lua_rawgeti(L, -3, 3) == LUA_TNUMBER) style.Colors[i].z = (float)lua_tonumber(L, -1);
|
|
|
|
if (lua_rawgeti(L, -4, 4) == LUA_TNUMBER) style.Colors[i].w = (float)lua_tonumber(L, -1);
|
|
|
|
lua_pop(L, 4);
|
|
|
|
}
|
2016-06-07 22:49:16 +02:00
|
|
|
lua_pop(L, 1);
|
2017-08-27 23:17:47 +02:00
|
|
|
}
|
2016-06-07 22:49:16 +02:00
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-05-23 19:57:11 +02:00
|
|
|
static void saveStyle(FS::OsFile& file)
|
2016-06-07 22:49:16 +02:00
|
|
|
{
|
|
|
|
auto& style = ImGui::GetStyle();
|
|
|
|
file << "style = {";
|
2017-08-27 23:17:47 +02:00
|
|
|
for (int i = 0; i < ImGuiCol_COUNT; ++i)
|
|
|
|
{
|
2017-10-19 00:20:37 +02:00
|
|
|
file << ImGui::GetStyleColorName(i) << " = {" << style.Colors[i].x
|
2017-08-27 23:17:47 +02:00
|
|
|
<< ", " << style.Colors[i].y
|
|
|
|
<< ", " << style.Colors[i].z
|
|
|
|
<< ", " << style.Colors[i].w << "},\n";
|
|
|
|
}
|
2016-06-07 22:49:16 +02:00
|
|
|
file << "}\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-23 19:15:50 +01:00
|
|
|
static void shortcutInput(int& shortcut)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2017-05-23 19:57:11 +02:00
|
|
|
StaticString<50> popup_name("");
|
|
|
|
popup_name << (i64)&shortcut;
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2017-11-23 18:50:27 +01:00
|
|
|
StaticString<50> button_label(SDL_GetKeyName((SDL_Keycode)shortcut));
|
2017-05-23 19:57:11 +02:00
|
|
|
button_label << "###" << (i64)&shortcut;
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2016-06-12 12:04:41 +02:00
|
|
|
if (ImGui::Button(button_label, ImVec2(65, 0))) shortcut = -1;
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2015-12-23 19:15:50 +01:00
|
|
|
auto& io = ImGui::GetIO();
|
2016-05-24 21:14:34 +02:00
|
|
|
int key_count;
|
|
|
|
auto* state = SDL_GetKeyboardState(&key_count);
|
2015-10-01 02:07:22 +02:00
|
|
|
if (ImGui::IsItemHovered())
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2016-05-24 21:14:34 +02:00
|
|
|
for (int i = 0; i < key_count; ++i)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2016-05-24 21:14:34 +02:00
|
|
|
if (state[i])
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2017-11-23 18:50:27 +01:00
|
|
|
shortcut = SDL_GetKeyFromScancode((SDL_Scancode)i);
|
2015-10-01 02:07:22 +02:00
|
|
|
break;
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int getIntegerField(lua_State* L, const char* name, int default_value)
|
|
|
|
{
|
|
|
|
int value = default_value;
|
|
|
|
if (lua_getfield(L, -1, name) == LUA_TNUMBER)
|
|
|
|
{
|
|
|
|
value = (int)lua_tointeger(L, -1);
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-14 21:56:06 +01:00
|
|
|
static float getFloat(lua_State* L, const char* name, float default_value)
|
|
|
|
{
|
|
|
|
float value = default_value;
|
|
|
|
if (lua_getglobal(L, name) == LUA_TNUMBER)
|
|
|
|
{
|
|
|
|
value = (float)lua_tonumber(L, -1);
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-29 02:36:24 +02:00
|
|
|
static bool getBoolean(lua_State* L, const char* name, bool default_value)
|
|
|
|
{
|
|
|
|
bool value = default_value;
|
|
|
|
if (lua_getglobal(L, name) == LUA_TBOOLEAN)
|
|
|
|
{
|
|
|
|
value = lua_toboolean(L, -1) != 0;
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-29 20:48:26 +02:00
|
|
|
static int getInteger(lua_State* L, const char* name, int default_value)
|
|
|
|
{
|
|
|
|
int value = default_value;
|
|
|
|
if (lua_getglobal(L, name) == LUA_TNUMBER)
|
|
|
|
{
|
|
|
|
value = (int)lua_tointeger(L, -1);
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
Settings::Settings(StudioApp& app)
|
|
|
|
: m_app(app)
|
2017-08-20 00:16:42 +02:00
|
|
|
, m_is_open(false)
|
2016-06-15 15:28:07 +02:00
|
|
|
, m_editor(nullptr)
|
|
|
|
, m_is_maximized(true)
|
2017-09-28 14:45:20 +02:00
|
|
|
, m_is_entity_list_open(false)
|
|
|
|
, m_is_entity_template_list_open(false)
|
|
|
|
, m_is_asset_browser_open(false)
|
|
|
|
, m_is_log_open(false)
|
|
|
|
, m_is_profiler_open(false)
|
|
|
|
, m_is_properties_open(false)
|
2016-06-15 15:28:07 +02:00
|
|
|
, m_is_crash_reporting_enabled(true)
|
|
|
|
, m_force_no_crash_report(false)
|
2017-09-23 22:15:11 +02:00
|
|
|
, m_mouse_sensitivity(80.0f, 80.0f)
|
|
|
|
, m_font_size(13)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2016-05-22 12:40:42 +02:00
|
|
|
m_data_dir[0] = '\0';
|
2015-09-29 02:36:24 +02:00
|
|
|
m_filter[0] = 0;
|
|
|
|
m_window.x = m_window.y = 0;
|
|
|
|
m_window.w = m_window.h = -1;
|
2015-12-19 20:42:50 +01:00
|
|
|
|
|
|
|
m_state = luaL_newstate();
|
|
|
|
luaL_openlibs(m_state);
|
|
|
|
lua_newtable(m_state);
|
|
|
|
lua_setglobal(m_state, "custom");
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-19 20:42:50 +01:00
|
|
|
Settings::~Settings()
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2015-12-19 20:42:50 +01:00
|
|
|
lua_close(m_state);
|
|
|
|
}
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2015-12-19 20:42:50 +01:00
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
bool Settings::load()
|
2015-12-19 20:42:50 +01:00
|
|
|
{
|
|
|
|
auto L = m_state;
|
2016-03-05 22:58:55 +01:00
|
|
|
bool has_settings = PlatformInterface::fileExists(SETTINGS_PATH);
|
|
|
|
bool errors = luaL_loadfile(L, has_settings ? SETTINGS_PATH : DEFAULT_SETTINGS_PATH) != LUA_OK;
|
2016-03-29 16:58:58 +02:00
|
|
|
errors = errors || lua_pcall(L, 0, 0, 0) != LUA_OK;
|
2015-09-29 02:36:24 +02:00
|
|
|
if (errors)
|
|
|
|
{
|
2017-05-23 19:57:11 +02:00
|
|
|
g_log_error.log("Editor") << SETTINGS_PATH << ": " << lua_tostring(L, -1);
|
2015-09-29 02:36:24 +02:00
|
|
|
lua_pop(L, 1);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lua_getglobal(L, "window") == LUA_TTABLE)
|
|
|
|
{
|
|
|
|
m_window.x = getIntegerField(L, "x", 0);
|
|
|
|
m_window.y = getIntegerField(L, "y", 0);
|
|
|
|
m_window.w = getIntegerField(L, "w", -1);
|
|
|
|
m_window.h = getIntegerField(L, "h", -1);
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
2016-06-07 22:49:16 +02:00
|
|
|
loadStyle(L);
|
|
|
|
|
2015-09-29 02:36:24 +02:00
|
|
|
m_is_maximized = getBoolean(L, "maximized", true);
|
|
|
|
|
2017-08-20 00:16:42 +02:00
|
|
|
m_is_open = getBoolean(L, "settings_opened", false);
|
2017-09-28 14:45:20 +02:00
|
|
|
m_is_asset_browser_open = getBoolean(L, "asset_browser_opened", false);
|
2017-08-20 00:16:42 +02:00
|
|
|
m_asset_browser_left_column_width = getFloat(L, "asset_browser_left_column_width", false);
|
2017-09-28 14:45:20 +02:00
|
|
|
m_is_entity_list_open = getBoolean(L, "entity_list_opened", false);
|
|
|
|
m_is_entity_template_list_open = getBoolean(L, "entity_template_list_opened", false);
|
|
|
|
m_is_log_open = getBoolean(L, "log_opened", false);
|
|
|
|
m_is_profiler_open = getBoolean(L, "profiler_opened", false);
|
|
|
|
m_is_properties_open = getBoolean(L, "properties_opened", false);
|
2015-10-09 22:03:06 +02:00
|
|
|
m_is_crash_reporting_enabled = getBoolean(L, "error_reporting_enabled", true);
|
2017-05-23 19:57:11 +02:00
|
|
|
enableCrashReporting(m_is_crash_reporting_enabled && !m_force_no_crash_report);
|
2017-09-23 22:15:11 +02:00
|
|
|
m_mouse_sensitivity.x = getFloat(L, "mouse_sensitivity_x", 200.0f);
|
|
|
|
m_mouse_sensitivity.y = getFloat(L, "mouse_sensitivity_y", 200.0f);
|
|
|
|
m_font_size = getInteger(L, "font_size", 13);
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2016-05-31 13:22:40 +02:00
|
|
|
if (!m_editor->getEngine().getPatchFileDevice())
|
|
|
|
{
|
2017-05-23 19:57:11 +02:00
|
|
|
if (lua_getglobal(L, "data_dir") == LUA_TSTRING) copyString(m_data_dir, lua_tostring(L, -1));
|
2016-05-31 13:22:40 +02:00
|
|
|
lua_pop(L, 1);
|
|
|
|
m_editor->getEngine().setPatchPath(m_data_dir);
|
|
|
|
}
|
2016-05-22 12:40:42 +02:00
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
auto& actions = m_app.getActions();
|
2015-09-29 02:36:24 +02:00
|
|
|
if (lua_getglobal(L, "actions") == LUA_TTABLE)
|
|
|
|
{
|
2016-06-12 23:24:33 +02:00
|
|
|
for (int i = 0; i < actions.size(); ++i)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2015-10-01 02:07:22 +02:00
|
|
|
if (lua_getfield(L, -1, actions[i]->name) == LUA_TTABLE)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2017-05-23 19:57:11 +02:00
|
|
|
for (int j = 0; j < lengthOf(actions[i]->shortcut); ++j)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
|
|
|
if (lua_rawgeti(L, -1, 1 + j) == LUA_TNUMBER)
|
|
|
|
{
|
2015-10-01 02:07:22 +02:00
|
|
|
actions[i]->shortcut[j] = (int)lua_tointeger(L, -1);
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
}
|
2016-06-12 23:24:33 +02:00
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
|
|
|
m_app.getToolbarActions().clear();
|
|
|
|
if (lua_getglobal(L, "toolbar") == LUA_TTABLE)
|
|
|
|
{
|
|
|
|
int len = (int)lua_rawlen(L, -1);
|
|
|
|
for (int i = 0; i < len; ++i)
|
|
|
|
{
|
|
|
|
if (lua_rawgeti(L, -1, i + 1) == LUA_TSTRING)
|
|
|
|
{
|
|
|
|
const char* action_name = lua_tostring(L, -1);
|
2016-11-16 12:32:04 +01:00
|
|
|
Action* action = m_app.getAction(action_name);
|
|
|
|
if(action) m_app.getToolbarActions().push(action);
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lua_pop(L, 1);
|
2016-01-01 20:31:34 +01:00
|
|
|
|
2016-01-01 20:59:20 +01:00
|
|
|
ImGui::LoadDock(L);
|
2015-09-29 02:36:24 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-19 20:42:50 +01:00
|
|
|
void Settings::setValue(const char* name, bool value)
|
2015-12-11 20:48:47 +01:00
|
|
|
{
|
2015-12-19 20:42:50 +01:00
|
|
|
lua_getglobal(m_state, "custom");
|
|
|
|
lua_pushboolean(m_state, value);
|
|
|
|
lua_setfield(m_state, -2, name);
|
2016-01-31 23:30:18 +01:00
|
|
|
lua_pop(m_state, 1);
|
2015-12-11 20:48:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-19 20:42:50 +01:00
|
|
|
void Settings::setValue(const char* name, int value)
|
|
|
|
{
|
|
|
|
lua_getglobal(m_state, "custom");
|
|
|
|
lua_pushinteger(m_state, value);
|
|
|
|
lua_setfield(m_state, -2, name);
|
2016-01-31 23:30:18 +01:00
|
|
|
lua_pop(m_state, 1);
|
2015-12-19 20:42:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-19 20:58:15 +01:00
|
|
|
int Settings::getValue(const char* name, int default_value) const
|
2015-12-19 20:42:50 +01:00
|
|
|
{
|
|
|
|
lua_getglobal(m_state, "custom");
|
2015-12-19 20:58:15 +01:00
|
|
|
int v = getIntegerField(m_state, name, default_value);
|
2015-12-19 20:42:50 +01:00
|
|
|
lua_pop(m_state, 1);
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-19 20:58:15 +01:00
|
|
|
bool Settings::getValue(const char* name, bool default_value) const
|
2015-12-19 20:42:50 +01:00
|
|
|
{
|
2015-12-19 20:58:15 +01:00
|
|
|
bool v = default_value;
|
2015-12-19 20:42:50 +01:00
|
|
|
lua_getglobal(m_state, "custom");
|
2015-12-19 20:58:15 +01:00
|
|
|
if (lua_getfield(m_state, -1, name) == LUA_TBOOLEAN)
|
2015-12-19 20:42:50 +01:00
|
|
|
{
|
|
|
|
v = lua_toboolean(m_state, -1) != 0;
|
|
|
|
}
|
2016-01-24 18:14:37 +01:00
|
|
|
lua_pop(m_state, 2);
|
2015-12-19 20:42:50 +01:00
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
bool Settings::save()
|
2015-12-19 20:42:50 +01:00
|
|
|
{
|
2016-06-12 23:24:33 +02:00
|
|
|
auto& actions = m_app.getActions();
|
2017-05-23 19:57:11 +02:00
|
|
|
FS::OsFile file;
|
2017-09-28 13:56:10 +02:00
|
|
|
auto& allocator = m_app.getWorldEditor().getAllocator();
|
2017-10-31 14:15:09 +01:00
|
|
|
if (!file.open(SETTINGS_PATH, FS::Mode::CREATE_AND_WRITE)) return false;
|
2015-12-11 20:48:47 +01:00
|
|
|
|
|
|
|
file << "window = { x = " << m_window.x
|
|
|
|
<< ", y = " << m_window.y
|
|
|
|
<< ", w = " << m_window.w
|
|
|
|
<< ", h = " << m_window.h << " }\n";
|
|
|
|
|
|
|
|
file << "maximized = " << (m_is_maximized ? "true" : "false") << "\n";
|
|
|
|
|
|
|
|
auto writeBool = [&file](const char* name, bool value) {
|
|
|
|
file << name << " = " << (value ? "true\n" : "false\n");
|
2015-09-29 02:36:24 +02:00
|
|
|
};
|
|
|
|
|
2017-08-20 00:16:42 +02:00
|
|
|
writeBool("settings_opened", m_is_open);
|
2017-09-28 14:45:20 +02:00
|
|
|
writeBool("asset_browser_opened", m_is_asset_browser_open);
|
|
|
|
writeBool("entity_list_opened", m_is_entity_list_open);
|
|
|
|
writeBool("entity_template_list_opened", m_is_entity_template_list_open);
|
|
|
|
writeBool("log_opened", m_is_log_open);
|
|
|
|
writeBool("profiler_opened", m_is_profiler_open);
|
|
|
|
writeBool("properties_opened", m_is_properties_open);
|
2015-10-09 22:03:06 +02:00
|
|
|
writeBool("error_reporting_enabled", m_is_crash_reporting_enabled);
|
2017-09-23 22:15:11 +02:00
|
|
|
file << "mouse_sensitivity_x = " << m_mouse_sensitivity.x << "\n";
|
|
|
|
file << "mouse_sensitivity_y = " << m_mouse_sensitivity.y << "\n";
|
|
|
|
file << "font_size = " << m_font_size << "\n";
|
2017-08-20 00:16:42 +02:00
|
|
|
file << "asset_browser_left_column_width = " << m_asset_browser_left_column_width << "\n";
|
2016-05-22 12:40:42 +02:00
|
|
|
|
2016-06-07 22:49:16 +02:00
|
|
|
saveStyle(file);
|
|
|
|
|
2016-05-22 12:40:42 +02:00
|
|
|
file << "data_dir = \"";
|
|
|
|
const char* c = m_data_dir;
|
|
|
|
while (*c)
|
|
|
|
{
|
|
|
|
if (*c == '\\') file << "\\\\";
|
|
|
|
else file << *c;
|
|
|
|
++c;
|
|
|
|
}
|
|
|
|
file << "\"\n";
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2015-12-19 20:58:15 +01:00
|
|
|
file << "custom = {\n";
|
2015-12-19 20:42:50 +01:00
|
|
|
lua_getglobal(m_state, "custom");
|
|
|
|
lua_pushnil(m_state);
|
2015-12-19 20:58:15 +01:00
|
|
|
bool first = true;
|
2015-12-19 20:42:50 +01:00
|
|
|
while (lua_next(m_state, -2))
|
|
|
|
{
|
2015-12-19 20:58:15 +01:00
|
|
|
if (!first) file << ",\n";
|
2015-12-19 20:42:50 +01:00
|
|
|
const char* name = lua_tostring(m_state, -2);
|
|
|
|
switch (lua_type(m_state, -1))
|
|
|
|
{
|
|
|
|
case LUA_TBOOLEAN:
|
|
|
|
file << name << " = " << (lua_toboolean(m_state, -1) != 0 ? "true" : "false");
|
|
|
|
break;
|
|
|
|
case LUA_TNUMBER:
|
|
|
|
file << name << " = " << (int)lua_tonumber(m_state, -1);
|
|
|
|
break;
|
2015-12-19 20:58:15 +01:00
|
|
|
default:
|
|
|
|
ASSERT(false);
|
|
|
|
break;
|
2015-12-19 20:42:50 +01:00
|
|
|
}
|
|
|
|
lua_pop(m_state, 1);
|
2015-12-19 20:58:15 +01:00
|
|
|
first = false;
|
2015-12-19 20:42:50 +01:00
|
|
|
}
|
|
|
|
lua_pop(m_state, 1);
|
|
|
|
file << "}\n";
|
|
|
|
|
2015-12-11 20:48:47 +01:00
|
|
|
file << "actions = {\n";
|
2016-06-12 23:24:33 +02:00
|
|
|
for (int i = 0; i < actions.size(); ++i)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2015-12-23 19:15:50 +01:00
|
|
|
file << "\t" << actions[i]->name << " = {"
|
2015-12-11 20:48:47 +01:00
|
|
|
<< actions[i]->shortcut[0] << ", "
|
2015-12-23 19:15:50 +01:00
|
|
|
<< actions[i]->shortcut[1] << ", "
|
2016-06-12 23:24:33 +02:00
|
|
|
<< actions[i]->shortcut[2] << "},\n";
|
|
|
|
}
|
|
|
|
file << "}\n";
|
|
|
|
|
|
|
|
file << "toolbar = {\n";
|
|
|
|
for (auto* action : m_app.getToolbarActions())
|
|
|
|
{
|
|
|
|
file << "\t\"" << action->name << "\",\n";
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
2015-12-11 20:48:47 +01:00
|
|
|
file << "}\n";
|
2016-01-01 20:31:34 +01:00
|
|
|
|
2016-01-01 20:59:20 +01:00
|
|
|
ImGui::SaveDock(file);
|
2016-01-01 20:31:34 +01:00
|
|
|
|
2015-12-11 20:48:47 +01:00
|
|
|
file.close();
|
2015-09-29 02:36:24 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
void Settings::showToolbarSettings()
|
|
|
|
{
|
|
|
|
auto& actions = m_app.getToolbarActions();
|
2016-06-13 01:51:24 +02:00
|
|
|
static Action* dragged = nullptr;
|
|
|
|
|
2016-06-13 16:56:22 +02:00
|
|
|
ImVec4 tint_color = ImGui::GetStyle().Colors[ImGuiCol_Text];
|
2016-06-13 01:51:24 +02:00
|
|
|
for (auto* action : actions)
|
2016-06-12 23:24:33 +02:00
|
|
|
{
|
2016-06-13 16:56:22 +02:00
|
|
|
ImGui::ImageButton(action->icon, ImVec2(24, 24), ImVec2(0, 0), ImVec2(1, 1), -1, ImVec4(0, 0, 0, 0), tint_color);
|
2016-06-14 10:24:32 +02:00
|
|
|
if (dragged && ImGui::IsItemHovered() && ImGui::IsMouseReleased(0))
|
2016-06-12 23:24:33 +02:00
|
|
|
{
|
2016-06-13 01:51:24 +02:00
|
|
|
actions.insert(actions.indexOf(action), dragged);
|
|
|
|
dragged = nullptr;
|
|
|
|
break;
|
2016-06-12 23:24:33 +02:00
|
|
|
}
|
2016-06-13 01:51:24 +02:00
|
|
|
if (ImGui::IsItemActive() && ImGui::IsMouseDragging())
|
2016-06-12 23:24:33 +02:00
|
|
|
{
|
2016-06-13 01:51:24 +02:00
|
|
|
dragged = action;
|
|
|
|
actions.eraseItem(action);
|
2016-06-12 23:24:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2016-06-13 01:51:24 +02:00
|
|
|
ImGui::SameLine();
|
2016-06-12 23:24:33 +02:00
|
|
|
}
|
2016-06-13 01:51:24 +02:00
|
|
|
ImGui::NewLine();
|
|
|
|
|
2017-11-23 18:50:27 +01:00
|
|
|
if (dragged) ImGui::SetTooltip("%s", dragged->label_long);
|
2016-06-13 01:51:24 +02:00
|
|
|
if (ImGui::IsMouseReleased(0)) dragged = nullptr;
|
2016-06-12 23:24:33 +02:00
|
|
|
|
|
|
|
static int tmp = 0;
|
|
|
|
auto getter = [](void* data, int idx, const char** out) -> bool {
|
|
|
|
Action** tools = (Action**)data;
|
2017-11-23 18:50:27 +01:00
|
|
|
*out = tools[idx]->label_long;
|
2016-06-12 23:24:33 +02:00
|
|
|
return true;
|
|
|
|
};
|
|
|
|
Action* tools[1024];
|
|
|
|
int count = 0;
|
|
|
|
for (auto* action : m_app.getActions())
|
|
|
|
{
|
2016-06-13 01:51:24 +02:00
|
|
|
if (action->icon && action->is_global)
|
2016-06-12 23:24:33 +02:00
|
|
|
{
|
|
|
|
tools[count] = action;
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::Combo("", &tmp, getter, tools, count);
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::Button("Add"))
|
|
|
|
{
|
|
|
|
actions.push(tools[tmp]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Settings::showShortcutSettings()
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2016-06-12 23:24:33 +02:00
|
|
|
auto& actions = m_app.getActions();
|
2017-10-19 17:48:53 +02:00
|
|
|
ImGui::LabellessInputText("Filter", m_filter, lengthOf(m_filter));
|
2016-06-12 23:24:33 +02:00
|
|
|
ImGui::Columns(4);
|
2016-06-09 00:09:13 +02:00
|
|
|
ImGui::Text("Label");
|
|
|
|
ImGui::NextColumn();
|
|
|
|
ImGui::Text("Shortcut key 1");
|
|
|
|
ImGui::NextColumn();
|
|
|
|
ImGui::Text("Shortcut key 2");
|
|
|
|
ImGui::NextColumn();
|
|
|
|
ImGui::Text("Shortcut key 3");
|
|
|
|
ImGui::NextColumn();
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
for (int i = 0; i < actions.size(); ++i)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2015-10-01 02:07:22 +02:00
|
|
|
Action& a = *actions[i];
|
2017-11-23 18:50:27 +01:00
|
|
|
if (m_filter[0] == 0 || stristr(a.label_long, m_filter) != 0)
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2017-10-19 00:20:37 +02:00
|
|
|
ImGui::AlignTextToFramePadding();
|
2017-11-23 18:50:27 +01:00
|
|
|
ImGui::Text("%s", a.label_long);
|
2015-12-23 19:15:50 +01:00
|
|
|
ImGui::NextColumn();
|
|
|
|
shortcutInput(a.shortcut[0]);
|
|
|
|
ImGui::NextColumn();
|
|
|
|
shortcutInput(a.shortcut[1]);
|
|
|
|
ImGui::NextColumn();
|
|
|
|
shortcutInput(a.shortcut[2]);
|
|
|
|
ImGui::NextColumn();
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
}
|
2015-12-23 19:15:50 +01:00
|
|
|
ImGui::Columns(1);
|
2016-06-12 23:24:33 +02:00
|
|
|
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
void Settings::onGUI()
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2017-08-20 00:16:42 +02:00
|
|
|
if (ImGui::BeginDock("Settings", &m_is_open))
|
2015-09-29 02:36:24 +02:00
|
|
|
{
|
2016-06-12 23:24:33 +02:00
|
|
|
if (ImGui::Button("Save")) save();
|
2015-12-23 19:15:50 +01:00
|
|
|
ImGui::SameLine();
|
2016-06-12 23:24:33 +02:00
|
|
|
if (ImGui::Button("Reload")) load();
|
2015-12-23 19:15:50 +01:00
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::Text("Settings are saved when the application closes");
|
2015-09-29 02:36:24 +02:00
|
|
|
|
2016-02-14 21:56:06 +01:00
|
|
|
if (ImGui::CollapsingHeader("General"))
|
2015-10-09 22:03:06 +02:00
|
|
|
{
|
2016-05-21 17:13:55 +02:00
|
|
|
if (m_force_no_crash_report)
|
2016-02-14 21:56:06 +01:00
|
|
|
{
|
2016-05-21 17:13:55 +02:00
|
|
|
ImGui::Text("Crash reporting disabled from command line");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ImGui::Checkbox("Crash reporting", &m_is_crash_reporting_enabled))
|
|
|
|
{
|
2017-05-23 19:57:11 +02:00
|
|
|
enableCrashReporting(m_is_crash_reporting_enabled);
|
2016-05-21 17:13:55 +02:00
|
|
|
}
|
2016-02-14 21:56:06 +01:00
|
|
|
}
|
2017-09-23 22:15:11 +02:00
|
|
|
ImGui::DragFloat2("Mouse sensitivity", &m_mouse_sensitivity.x, 0.1f, 500.0f);
|
2016-05-22 12:40:42 +02:00
|
|
|
|
2017-10-19 00:20:37 +02:00
|
|
|
ImGui::AlignTextToFramePadding();
|
2016-05-22 12:40:42 +02:00
|
|
|
ImGui::Text("%s", m_data_dir[0] != '\0' ? m_data_dir : "Not set");
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (m_data_dir[0] != '\0')
|
|
|
|
{
|
|
|
|
if (ImGui::Button("Clear"))
|
|
|
|
{
|
|
|
|
m_data_dir[0] = '\0';
|
|
|
|
m_editor->getEngine().setPatchPath(nullptr);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
}
|
|
|
|
if (ImGui::Button("Set data directory"))
|
|
|
|
{
|
|
|
|
if (PlatformInterface::getOpenDirectory(m_data_dir, sizeof(m_data_dir), nullptr))
|
|
|
|
{
|
|
|
|
m_editor->getEngine().setPatchPath(m_data_dir);
|
|
|
|
}
|
|
|
|
}
|
2015-10-09 22:03:06 +02:00
|
|
|
}
|
2015-09-29 20:48:26 +02:00
|
|
|
|
2016-06-12 23:24:33 +02:00
|
|
|
if (ImGui::CollapsingHeader("Shortcuts")) showShortcutSettings();
|
|
|
|
if (ImGui::CollapsingHeader("Toolbar")) showToolbarSettings();
|
2016-06-07 18:51:49 +02:00
|
|
|
if (ImGui::CollapsingHeader("Style"))
|
|
|
|
{
|
|
|
|
static int selected = 0;
|
2017-10-30 23:39:34 +01:00
|
|
|
ImGui::InputInt("Font size (needs restart)", &m_font_size);
|
2016-06-07 18:51:49 +02:00
|
|
|
ImGui::Combo("Skin", &selected, "Light\0Dark\0");
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::Button("Apply"))
|
|
|
|
{
|
|
|
|
auto& style = ImGui::GetStyle();
|
|
|
|
switch (selected)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
style.Colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
|
|
|
style.Colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.39f);
|
|
|
|
style.Colors[ImGuiCol_BorderShadow] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
|
|
|
|
style.Colors[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
|
|
|
|
style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
|
|
|
|
style.Colors[ImGuiCol_TitleBg] = ImVec4(0.96f, 0.96f, 0.96f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 1.00f, 1.00f, 0.51f);
|
|
|
|
style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.98f, 0.98f, 0.98f, 0.53f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.69f, 0.69f, 0.69f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ComboBg] = ImVec4(0.86f, 0.86f, 0.86f, 0.99f);
|
|
|
|
style.Colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f);
|
|
|
|
style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
|
|
|
|
style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f);
|
|
|
|
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
|
2017-08-18 00:38:18 +02:00
|
|
|
style.Colors[ImGuiCol_Separator] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f);
|
|
|
|
style.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
|
2016-06-07 18:51:49 +02:00
|
|
|
style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
|
|
|
|
style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
|
|
|
|
style.Colors[ImGuiCol_CloseButton] = ImVec4(0.59f, 0.59f, 0.59f, 0.50f);
|
|
|
|
style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.98f, 0.39f, 0.36f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.98f, 0.39f, 0.36f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
|
2016-06-12 16:48:41 +02:00
|
|
|
style.Colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.94f);
|
2016-06-07 18:51:49 +02:00
|
|
|
style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
style.Colors[ImGuiCol_Text] = ImVec4(0.91f, 0.91f, 0.91f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.40f, 0.40f, 0.40f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
|
|
|
style.Colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.39f);
|
|
|
|
style.Colors[ImGuiCol_BorderShadow] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
|
|
|
|
style.Colors[ImGuiCol_FrameBg] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.75f, 0.42f, 0.02f, 0.40f);
|
|
|
|
style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.75f, 0.42f, 0.02f, 0.67f);
|
|
|
|
style.Colors[ImGuiCol_TitleBg] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f);
|
|
|
|
style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.18f, 0.18f, 0.18f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.15f, 0.15f, 0.15f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ComboBg] = ImVec4(0.15f, 0.15f, 0.15f, 0.99f);
|
|
|
|
style.Colors[ImGuiCol_CheckMark] = ImVec4(0.75f, 0.42f, 0.02f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.75f, 0.42f, 0.02f, 0.78f);
|
|
|
|
style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.75f, 0.42f, 0.02f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_Button] = ImVec4(0.75f, 0.42f, 0.02f, 0.40f);
|
|
|
|
style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.75f, 0.42f, 0.02f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.94f, 0.47f, 0.02f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_Header] = ImVec4(0.75f, 0.42f, 0.02f, 0.31f);
|
|
|
|
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.75f, 0.42f, 0.02f, 0.80f);
|
|
|
|
style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.75f, 0.42f, 0.02f, 1.00f);
|
2017-08-18 00:38:18 +02:00
|
|
|
style.Colors[ImGuiCol_Separator] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.75f, 0.42f, 0.02f, 0.78f);
|
|
|
|
style.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.75f, 0.42f, 0.02f, 1.00f);
|
2016-06-07 18:51:49 +02:00
|
|
|
style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.75f, 0.42f, 0.02f, 0.67f);
|
|
|
|
style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.75f, 0.42f, 0.02f, 0.95f);
|
|
|
|
style.Colors[ImGuiCol_CloseButton] = ImVec4(0.42f, 0.42f, 0.42f, 0.50f);
|
|
|
|
style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.02f, 0.61f, 0.64f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.02f, 0.61f, 0.64f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.00f, 0.57f, 0.65f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.10f, 0.30f, 1.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.00f, 0.40f, 1.00f, 1.00f);
|
|
|
|
style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.75f, 0.42f, 0.02f, 0.35f);
|
2016-06-12 16:48:41 +02:00
|
|
|
style.Colors[ImGuiCol_PopupBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.94f);
|
2016-06-07 18:51:49 +02:00
|
|
|
style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.06f, 0.06f, 0.06f, 0.35f);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::ShowStyleEditor();
|
|
|
|
}
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
2016-01-01 20:31:34 +01:00
|
|
|
ImGui::EndDock();
|
2015-09-29 02:36:24 +02:00
|
|
|
}
|
2017-05-23 19:57:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace Lumix
|