|
5 | 5 | #include <Button.hpp> |
6 | 6 | #include <LayoutModule.hpp> |
7 | 7 | #include <RealtimeAction.hpp> |
| 8 | +#include <BetterSlider.hpp> |
| 9 | +#include <../IconEffects/IconicPlayerHook.hpp> |
8 | 10 |
|
9 | 11 | using namespace geode::prelude; |
10 | 12 | using namespace qolmod; |
@@ -111,6 +113,8 @@ bool EditLayoutUI::setup() |
111 | 113 | node->addChild(previewOutline, 7); |
112 | 114 | node->addChild(grab, 7); |
113 | 115 |
|
| 116 | + node->addChild(createOptions(), 2); |
| 117 | + |
114 | 118 | m_mainLayer->addChildAtPosition(clip, Anchor::Center); |
115 | 119 | m_mainLayer->addChildAtPosition(menu, Anchor::Bottom, ccp(0, -5.0f)); |
116 | 120 | m_mainLayer->addChildAtPosition(titleBG, Anchor::Top, ccp(0, 15)); |
@@ -244,6 +248,38 @@ void EditLayoutUI::updateAnchorPoints() |
244 | 248 | } |
245 | 249 | } |
246 | 250 |
|
| 251 | +void EditLayoutUI::onSliderChanged(CCObject* sender) |
| 252 | +{ |
| 253 | + |
| 254 | +} |
| 255 | + |
| 256 | +CCMenu* EditLayoutUI::createOptions() |
| 257 | +{ |
| 258 | + return CCMenu::create(); |
| 259 | + |
| 260 | + auto menu = CCMenu::create(); |
| 261 | + |
| 262 | + float y = 0; |
| 263 | + for (auto& option : module->floatOptions) |
| 264 | + { |
| 265 | + auto label = AdvLabelBMFont::createWithString(option.second.display, "bigFont.fnt"); |
| 266 | + auto slider = BetterSlider::create(this, menu_selector(EditLayoutUI::onSliderChanged)); |
| 267 | + slider->setRange(option.second.min, option.second.max); |
| 268 | + slider->setValueRanged(option.second.value); |
| 269 | + slider->setID(option.first); |
| 270 | + |
| 271 | + label->setPosition(ccp(0, y)); |
| 272 | + slider->setPosition(ccp(0, y)); |
| 273 | + |
| 274 | + menu->addChild(label); |
| 275 | + menu->addChild(slider); |
| 276 | + |
| 277 | + y -= 30; |
| 278 | + } |
| 279 | + |
| 280 | + return menu; |
| 281 | +} |
| 282 | + |
247 | 283 | CCNode* EditLayoutUI::createBackground(bool acu) |
248 | 284 | { |
249 | 285 | auto imageNode = CCNode::create(); |
@@ -277,6 +313,10 @@ CCNode* EditLayoutUI::createBackground(bool acu) |
277 | 313 | player->setColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); |
278 | 314 | player->setSecondColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); |
279 | 315 |
|
| 316 | + auto hook = IconicPlayerHook::create(player); |
| 317 | + hook->setGamemode(IconicGamemodeType::Cube, false); |
| 318 | + this->addChild(hook); |
| 319 | + |
280 | 320 | if (GameManager::get()->m_playerGlow) |
281 | 321 | { |
282 | 322 | player->enableCustomGlowColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerGlowColor.value())); |
|
0 commit comments