mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
9ffb15b616
- Settings no longer abuse templates - Custom settings are now supported (finally) - Bumped version to v1.0.0-alpha
32 lines
821 B
C++
32 lines
821 B
C++
#pragma once
|
|
|
|
#include "Setting.hpp"
|
|
|
|
#include <cocos2d.h>
|
|
|
|
namespace geode {
|
|
class SettingNode;
|
|
|
|
struct SettingNodeDelegate {
|
|
virtual void settingValueChanged(SettingNode* node) {}
|
|
virtual void settingValueCommitted(SettingNode* node) {}
|
|
};
|
|
|
|
class GEODE_DLL SettingNode : public cocos2d::CCNode {
|
|
protected:
|
|
SettingValue* m_value;
|
|
SettingNodeDelegate* m_delegate = nullptr;
|
|
|
|
bool init(SettingValue* value);
|
|
void dispatchChanged();
|
|
void dispatchCommitted();
|
|
|
|
public:
|
|
void setDelegate(SettingNodeDelegate* delegate);
|
|
|
|
virtual void commit() = 0;
|
|
virtual bool hasUncommittedChanges() = 0;
|
|
virtual bool hasNonDefaultValue() = 0;
|
|
virtual void resetToDefault() = 0;
|
|
};
|
|
}
|