mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
remove usages of cc3x
This commit is contained in:
parent
b6250cd278
commit
22bcbe1b5e
4 changed files with 8 additions and 8 deletions
|
@ -861,7 +861,7 @@ namespace geode::cocos {
|
||||||
return {color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f};
|
return {color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f};
|
||||||
}
|
}
|
||||||
|
|
||||||
[[deprecated("This function sucks, use cc3bFromHexString instead")]]
|
[[deprecated("This function may have unintended behavior, use cc3bFromHexString or manually expand the color instead")]]
|
||||||
constexpr cocos2d::ccColor3B cc3x(int hexValue) {
|
constexpr cocos2d::ccColor3B cc3x(int hexValue) {
|
||||||
if (hexValue <= 0xf)
|
if (hexValue <= 0xf)
|
||||||
return cocos2d::ccColor3B{
|
return cocos2d::ccColor3B{
|
||||||
|
|
|
@ -150,10 +150,10 @@ protected:
|
||||||
|
|
||||||
virtual void valueChanged(bool updateText = true) {
|
virtual void valueChanged(bool updateText = true) {
|
||||||
if (this->hasUncommittedChanges()) {
|
if (this->hasUncommittedChanges()) {
|
||||||
m_nameLabel->setColor(cc3x(0x1d0));
|
m_nameLabel->setColor({0x11, 0xdd, 0x00});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_nameLabel->setColor(cc3x(0xfff));
|
m_nameLabel->setColor({0xff, 0xff, 0xff});
|
||||||
}
|
}
|
||||||
if (m_resetBtn) m_resetBtn->setVisible(this->hasNonDefaultValue());
|
if (m_resetBtn) m_resetBtn->setVisible(this->hasNonDefaultValue());
|
||||||
auto isValid = setting()->validate(m_uncommittedValue);
|
auto isValid = setting()->validate(m_uncommittedValue);
|
||||||
|
|
|
@ -145,22 +145,22 @@ void ModSettingsPopup::onResetAll(CCObject*) {
|
||||||
|
|
||||||
void ModSettingsPopup::settingValueCommitted(SettingNode*) {
|
void ModSettingsPopup::settingValueCommitted(SettingNode*) {
|
||||||
if (this->hasUncommitted()) {
|
if (this->hasUncommitted()) {
|
||||||
m_applyBtnSpr->setColor(cc3x(0xf));
|
m_applyBtnSpr->setColor({0xff, 0xff, 0xff});
|
||||||
m_applyBtn->setEnabled(true);
|
m_applyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_applyBtnSpr->setColor(cc3x(0x4));
|
m_applyBtnSpr->setColor({0x44, 0x44, 0x44});
|
||||||
m_applyBtn->setEnabled(false);
|
m_applyBtn->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModSettingsPopup::settingValueChanged(SettingNode*) {
|
void ModSettingsPopup::settingValueChanged(SettingNode*) {
|
||||||
if (this->hasUncommitted()) {
|
if (this->hasUncommitted()) {
|
||||||
m_applyBtnSpr->setColor(cc3x(0xf));
|
m_applyBtnSpr->setColor({0xff, 0xff, 0xff});
|
||||||
m_applyBtn->setEnabled(true);
|
m_applyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_applyBtnSpr->setColor(cc3x(0x4));
|
m_applyBtnSpr->setColor({0x44, 0x44, 0x44});
|
||||||
m_applyBtn->setEnabled(false);
|
m_applyBtn->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ static constexpr float g_fontScale = .5f;
|
||||||
static constexpr float g_paragraphPadding = 7.f;
|
static constexpr float g_paragraphPadding = 7.f;
|
||||||
static constexpr float g_indent = 7.f;
|
static constexpr float g_indent = 7.f;
|
||||||
static constexpr float g_codeBlockIndent = 8.f;
|
static constexpr float g_codeBlockIndent = 8.f;
|
||||||
static constexpr ccColor3B g_linkColor = cc3x(0x7ff4f4);
|
static constexpr ccColor3B g_linkColor = {0x7f, 0xf4, 0xf4};
|
||||||
|
|
||||||
TextRenderer::Font g_mdFont = [](int style) -> TextRenderer::Label {
|
TextRenderer::Font g_mdFont = [](int style) -> TextRenderer::Label {
|
||||||
if ((style & TextStyleBold) && (style & TextStyleItalic)) {
|
if ((style & TextStyleBold) && (style & TextStyleItalic)) {
|
||||||
|
|
Loading…
Reference in a new issue