mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
Add non default forecolor flag if forecolor is not white
This commit is contained in:
parent
f628d33a95
commit
8e4b2bb057
@ -1421,8 +1421,8 @@ namespace IW4
|
|||||||
WINDOW_FLAG_FADING_OUT = 0x10,
|
WINDOW_FLAG_FADING_OUT = 0x10,
|
||||||
WINDOW_FLAG_FADING_IN = 0x20,
|
WINDOW_FLAG_FADING_IN = 0x20,
|
||||||
WINDOW_FLAG_80 = 0x80,
|
WINDOW_FLAG_80 = 0x80,
|
||||||
WINDOW_FLAG_SCRIPT_BACKCOLOR = 0x8000,
|
WINDOW_FLAG_NON_DEFAULT_BACKCOLOR = 0x8000,
|
||||||
WINDOW_FLAG_SCRIPT_FORECOLOR = 0x10000
|
WINDOW_FLAG_NON_DEFAULT_FORECOLOR = 0x10000
|
||||||
};
|
};
|
||||||
|
|
||||||
struct windowDef_t
|
struct windowDef_t
|
||||||
|
@ -917,7 +917,11 @@ namespace IW4
|
|||||||
item->textStyle = commonItem.m_text_style;
|
item->textStyle = commonItem.m_text_style;
|
||||||
item->fontEnum = ConvertTextFont(commonItem.m_text_font);
|
item->fontEnum = ConvertTextFont(commonItem.m_text_font);
|
||||||
ConvertColor(item->window.backColor, commonItem.m_back_color);
|
ConvertColor(item->window.backColor, commonItem.m_back_color);
|
||||||
|
|
||||||
ConvertColor(item->window.foreColor, commonItem.m_fore_color);
|
ConvertColor(item->window.foreColor, commonItem.m_fore_color);
|
||||||
|
if (!commonItem.m_fore_color.Equals(CommonColor(1.0, 1.0, 1.0, 1.0)))
|
||||||
|
item->window.dynamicFlags[0] |= WINDOW_FLAG_NON_DEFAULT_FORECOLOR;
|
||||||
|
|
||||||
ConvertColor(item->window.borderColor, commonItem.m_border_color);
|
ConvertColor(item->window.borderColor, commonItem.m_border_color);
|
||||||
ConvertColor(item->window.outlineColor, commonItem.m_outline_color);
|
ConvertColor(item->window.outlineColor, commonItem.m_outline_color);
|
||||||
ConvertColor(item->window.disableColor, commonItem.m_disable_color);
|
ConvertColor(item->window.disableColor, commonItem.m_disable_color);
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#include "CommonMenuTypes.h"
|
#include "CommonMenuTypes.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using namespace menu;
|
using namespace menu;
|
||||||
|
|
||||||
CommonColor::CommonColor()
|
CommonColor::CommonColor()
|
||||||
@ -20,6 +23,14 @@ CommonColor::CommonColor(const double r, const double g, const double b, const d
|
|||||||
this->a = a;
|
this->a = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CommonColor::Equals(const CommonColor& other) const
|
||||||
|
{
|
||||||
|
return std::fabs(this->r - other.r) < std::numeric_limits<double>::epsilon()
|
||||||
|
&& std::fabs(this->g - other.g) < std::numeric_limits<double>::epsilon()
|
||||||
|
&& std::fabs(this->b - other.b) < std::numeric_limits<double>::epsilon()
|
||||||
|
&& std::fabs(this->a - other.a) < std::numeric_limits<double>::epsilon();
|
||||||
|
}
|
||||||
|
|
||||||
CommonRect::CommonRect()
|
CommonRect::CommonRect()
|
||||||
: CommonRect(0, 0, 0, 0)
|
: CommonRect(0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,8 @@ namespace menu
|
|||||||
|
|
||||||
CommonColor();
|
CommonColor();
|
||||||
CommonColor(double r, double g, double b, double a);
|
CommonColor(double r, double g, double b, double a);
|
||||||
|
|
||||||
|
bool Equals(const CommonColor& other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CommonRect
|
struct CommonRect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user