mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
use new awesome ColorProvider utility
This commit is contained in:
parent
b356a7670a
commit
54ac66ef7c
2 changed files with 11 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "ModList.hpp"
|
||||
#include <Geode/ui/TextInput.hpp>
|
||||
#include <Geode/utils/ColorProvider.hpp>
|
||||
|
||||
bool ModList::init(ModListSource* src, CCSize const& size) {
|
||||
if (!CCNode::init())
|
||||
|
@ -26,7 +27,9 @@ bool ModList::init(ModListSource* src, CCSize const& size) {
|
|||
m_searchMenu->setContentSize({ size.width, 30 });
|
||||
m_searchMenu->setAnchorPoint({ .5f, 1.f });
|
||||
|
||||
auto searchBG = CCLayerColor::create({ 83, 65, 109, 255 });
|
||||
auto searchBG = CCLayerColor::create(
|
||||
ColorProvider::get()->define("mod-list-search-bg"_spr, { 83, 65, 109, 255 })
|
||||
);
|
||||
searchBG->setContentSize(m_searchMenu->getContentSize());
|
||||
searchBG->ignoreAnchorPointForPosition(false);
|
||||
m_searchMenu->addChildAtPosition(searchBG, Anchor::Center);
|
||||
|
@ -136,7 +139,9 @@ void ModList::onPromise(typename ModListSource::PageLoadEvent* event) {
|
|||
for (auto item : *resolved) {
|
||||
// Add separators between items after the first one
|
||||
if (!first) {
|
||||
auto separator = CCLayerColor::create({ 255, 255, 255, 45 });
|
||||
auto separator = CCLayerColor::create(
|
||||
ColorProvider::get()->define("mod-list-separator"_spr, { 255, 255, 255, 45 })
|
||||
);
|
||||
separator->setContentSize({ m_obContentSize.width - 10, .5f });
|
||||
m_list->m_contentLayer->addChild(separator);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "ModsLayer.hpp"
|
||||
#include "SwelvyBG.hpp"
|
||||
#include <Geode/ui/TextInput.hpp>
|
||||
|
||||
static bool BIG_VIEW = false;
|
||||
#include <Geode/utils/ColorProvider.hpp>
|
||||
|
||||
bool ModsLayer::init() {
|
||||
if (!CCLayer::init())
|
||||
|
@ -54,7 +53,9 @@ bool ModsLayer::init() {
|
|||
m_frame->setAnchorPoint({ .5f, .5f });
|
||||
m_frame->setContentSize({ 380, 205 });
|
||||
|
||||
auto frameBG = CCLayerColor::create({ 25, 17, 37, 255 });
|
||||
auto frameBG = CCLayerColor::create(
|
||||
ColorProvider::get()->define("mod-list-bg"_spr, { 25, 17, 37, 255 })
|
||||
);
|
||||
frameBG->setContentSize(m_frame->getContentSize());
|
||||
frameBG->ignoreAnchorPointForPosition(false);
|
||||
m_frame->addChildAtPosition(frameBG, Anchor::Center);
|
||||
|
|
Loading…
Reference in a new issue