mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-23 03:01:08 +00:00
Update code using Dear ImGui for v1.91.2
This commit is contained in:
parent
9dffb367e2
commit
9f21cea354
2 changed files with 34 additions and 6 deletions
|
@ -121,6 +121,7 @@ namespace DG {
|
|||
D3_IMATTR_FLOAT( TabBorderSize ) \
|
||||
D3_IMATTR_FLOAT( TabMinWidthForCloseButton ) \
|
||||
D3_IMATTR_FLOAT( TabBarBorderSize ) \
|
||||
D3_IMATTR_FLOAT( TabBarOverlineSize ) \
|
||||
D3_IMATTR_FLOAT( TableAngledHeadersAngle ) \
|
||||
D3_IMATTR_VEC2( TableAngledHeadersTextAlign ) \
|
||||
D3_IMATTR_DIR( ColorButtonPosition ) \
|
||||
|
@ -186,11 +187,13 @@ namespace DG {
|
|||
D3_IMSTYLE_COLOR( ResizeGrip ) \
|
||||
D3_IMSTYLE_COLOR( ResizeGripHovered ) \
|
||||
D3_IMSTYLE_COLOR( ResizeGripActive ) \
|
||||
D3_IMSTYLE_COLOR( Tab ) \
|
||||
D3_IMSTYLE_COLOR( TabHovered ) \
|
||||
D3_IMSTYLE_COLOR( TabActive ) \
|
||||
D3_IMSTYLE_COLOR( TabUnfocused ) \
|
||||
D3_IMSTYLE_COLOR( TabUnfocusedActive ) \
|
||||
D3_IMSTYLE_COLOR( Tab ) \
|
||||
D3_IMSTYLE_COLOR( TabSelected ) \
|
||||
D3_IMSTYLE_COLOR( TabSelectedOverline ) \
|
||||
D3_IMSTYLE_COLOR( TabDimmed ) \
|
||||
D3_IMSTYLE_COLOR( TabDimmedSelected ) \
|
||||
D3_IMSTYLE_COLOR( TabDimmedSelectedOverline ) \
|
||||
DGIMST_ENABLE_IF_DOCKING( D3_IMSTYLE_COLOR( DockingPreview ) ) \
|
||||
DGIMST_ENABLE_IF_DOCKING( D3_IMSTYLE_COLOR( DockingEmptyBg ) ) \
|
||||
D3_IMSTYLE_COLOR( PlotLines ) \
|
||||
|
@ -202,6 +205,7 @@ namespace DG {
|
|||
D3_IMSTYLE_COLOR( TableBorderLight ) \
|
||||
D3_IMSTYLE_COLOR( TableRowBg ) \
|
||||
D3_IMSTYLE_COLOR( TableRowBgAlt ) \
|
||||
D3_IMSTYLE_COLOR( TextLink ) \
|
||||
D3_IMSTYLE_COLOR( TextSelectedBg ) \
|
||||
D3_IMSTYLE_COLOR( DragDropTarget ) \
|
||||
D3_IMSTYLE_COLOR( NavHighlight ) \
|
||||
|
@ -297,6 +301,21 @@ static void parseBehaviorLine( ImGuiStyle& s, const char* line )
|
|||
#undef D3_IMATTR_DIR
|
||||
#undef D3_IMATTR_BOOL
|
||||
|
||||
namespace {
|
||||
// for renamed colors
|
||||
struct ImGuiColorBackwardCompat {
|
||||
const char* oldColorStr;
|
||||
enum ImGuiCol_ newColorVal;
|
||||
};
|
||||
|
||||
static struct ImGuiColorBackwardCompat backwardCompatColorMappings[] = {
|
||||
{ "TabActive", ImGuiCol_TabSelected },
|
||||
{ "TabUnfocused", ImGuiCol_TabDimmed },
|
||||
{ "TabUnfocusedActive", ImGuiCol_TabDimmedSelected },
|
||||
};
|
||||
|
||||
} //anon namespace
|
||||
|
||||
static void parseColorLine( ImGuiStyle& s, const char* line )
|
||||
{
|
||||
ImVec4 c;
|
||||
|
@ -313,9 +332,18 @@ static void parseColorLine( ImGuiStyle& s, const char* line )
|
|||
|
||||
// NOTE: here backwards-compat is also possible, like
|
||||
// if ( sscanf( line, "OldColorName = %f , %f , %f , %f", &c.x, &c.y, &c.z, &c.w) == 4 ) {
|
||||
// s.Colors[ ImGuiCol_NewColorName = c;
|
||||
// s.Colors[ ImGuiCol_NewColorName ] = c;
|
||||
// return;
|
||||
// }
|
||||
for( const ImGuiColorBackwardCompat& bc : backwardCompatColorMappings ) {
|
||||
char matchString[64];
|
||||
snprintf( matchString, sizeof(matchString), "%s = %%f , %%f , %%f , %%f", bc.oldColorStr );
|
||||
|
||||
if ( sscanf( line, matchString, &c.x, &c.y, &c.z, &c.w) == 4 ) {
|
||||
s.Colors[ bc.newColorVal ] = c;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
warnPrintf( "Invalid line in ImGui style under [colors] section: '%s'\n", line );
|
||||
}
|
||||
|
|
|
@ -632,7 +632,7 @@ void SetDhewm3StyleColors( ImGuiStyle* dst )
|
|||
colors[ImGuiCol_TitleBgActive] = ImVec4(0.03f, 0.33f, 0.33f, 1.00f);
|
||||
//colors[ImGuiCol_TitleBg] = ImVec4(0.12f, 0.17f, 0.16f, 0.90f);
|
||||
colors[ImGuiCol_TabHovered] = ImVec4(0.42f, 0.69f, 1.00f, 0.80f);
|
||||
colors[ImGuiCol_TabActive] = ImVec4(0.24f, 0.51f, 0.83f, 1.00f);
|
||||
colors[ImGuiCol_TabSelected] = ImVec4(0.24f, 0.51f, 0.83f, 1.00f);
|
||||
}
|
||||
|
||||
void SetUserStyleColors()
|
||||
|
|
Loading…
Reference in a new issue