add ccColor3B comparators + settings stuff

This commit is contained in:
HJfod 2022-04-29 13:09:50 +03:00
parent 0204ad6a66
commit 770006c093
3 changed files with 15 additions and 3 deletions

2
bin

@ -1 +1 @@
Subproject commit 4a3cfa8646694cb3758dd41b47eaee072cd42644
Subproject commit eebb33cc28dbdc094c0aab6a934cd6811cf8dd7b

View file

@ -147,11 +147,12 @@ namespace geode {
size_t getDefaultIndex() const { return m_default; }
T getValue() const { return m_options.at(m_value); }
T getDefault() const { return m_options.at(m_default); }
T getValueAt(size_t ix) { return m_options.at(ix); }
using value_type_t = T;
using value_type_t = size_t;
void setIndex(size_t value) {
m_value = clamp(value, 0, m_options.size() - 1);
m_value = clamp<size_t>(value, 0, m_options.size() - 1);
this->update();
}
void incrementIndex(long increment) {

View file

@ -97,4 +97,15 @@ namespace geode {
return r1.origin != r2.origin ||
r1.size != r2.size;
}
static bool operator==(cocos2d::ccColor4B const& c1, cocos2d::ccColor4B const& c2) {
return c1.r == c2.r &&
c1.g == c2.g &&
c1.b == c2.b &&
c1.a == c2.a;
}
static bool operator==(cocos2d::ccColor3B const& c1, cocos2d::ccColor3B const& c2) {
return c1.r == c2.r &&
c1.g == c2.g &&
c1.b == c2.b;
}
}