Skip to content

Commit

Permalink
switch to geode::TextInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed May 31, 2024
1 parent 16ee116 commit 2609dd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions src/ui/nong_add_popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <Geode/loader/Log.hpp>
#include <Geode/utils/MiniFunction.hpp>
#include <Geode/utils/string.hpp>
#include <Geode/ui/InputNode.hpp>
#include <Geode/ui/TextInput.hpp>
#include <ccTypes.h>
#include <GUI/CCControlExtension/CCScale9Sprite.h>

Expand Down Expand Up @@ -162,28 +162,28 @@ void NongAddPopup::openFile(CCObject* target) {
void NongAddPopup::createInputs() {
auto inputParent = CCNode::create();
inputParent->setID("input-parent");
auto songInput = geode::InputNode::create(250.f, "Song name*", "bigFont.fnt");
auto songInput = TextInput::create(250.f, "Song name*", "bigFont.fnt");
songInput->setID("song-name-input");
songInput->getInput()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
songInput->getInput()->setMaxLabelScale(0.7f);
songInput->getInput()->setAllowedChars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 1234567890(),.-_+");
songInput->getInput()->setLabelPlaceholderScale(0.7f);
songInput->setCommonFilter(CommonFilter::Any);
songInput->getInputNode()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
songInput->getInputNode()->setMaxLabelScale(0.7f);
songInput->getInputNode()->setLabelPlaceholderScale(0.7f);
m_songNameInput = songInput;

auto artistInput = InputNode::create(250.f, "Artist name*", "bigFont.fnt");
auto artistInput = TextInput::create(250.f, "Artist name*", "bigFont.fnt");
artistInput->setID("artist-name-input");
artistInput->getInput()->setAllowedChars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 1234567890(),.-_+");
artistInput->getInput()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
artistInput->getInput()->setMaxLabelScale(0.7f);
artistInput->getInput()->setLabelPlaceholderScale(0.7f);
artistInput->setCommonFilter(CommonFilter::Any);
artistInput->getInputNode()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
artistInput->getInputNode()->setMaxLabelScale(0.7f);
artistInput->getInputNode()->setLabelPlaceholderScale(0.7f);
m_artistNameInput = artistInput;

auto levelNameInput = InputNode::create(250.f, "Level name", "bigFont.fnt");
auto levelNameInput = TextInput::create(250.f, "Level name", "bigFont.fnt");
levelNameInput->setID("artist-name-input");
levelNameInput->getInput()->setAllowedChars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 1234567890(),.-_+");
levelNameInput->getInput()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
levelNameInput->getInput()->setMaxLabelScale(0.7f);
levelNameInput->getInput()->setLabelPlaceholderScale(0.7f);
levelNameInput->setCommonFilter(CommonFilter::Any);
levelNameInput->getInputNode()->setLabelPlaceholderColor(ccColor3B {108, 153, 216});
levelNameInput->getInputNode()->setMaxLabelScale(0.7f);
levelNameInput->getInputNode()->setLabelPlaceholderScale(0.7f);
m_levelNameInput = levelNameInput;

uint32_t inputs = 3;
Expand Down
8 changes: 4 additions & 4 deletions src/ui/nong_add_popup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <Geode/c++stl/gdstdlib.hpp>
#include <Geode/cocos/label_nodes/CCLabelBMFont.h>
#include <Geode/cocos/base_nodes/CCNode.h>
#include <Geode/ui/InputNode.hpp>
#include <Geode/ui/TextInput.hpp>

#include "nong_dropdown_layer.hpp"

Expand All @@ -21,9 +21,9 @@ class NongAddPopup : public Popup<NongDropdownLayer*> {
CCMenu* m_selectSongMenu;
CCMenu* m_addSongMenu;

InputNode* m_songNameInput;
InputNode* m_artistNameInput;
InputNode* m_levelNameInput;
TextInput* m_songNameInput;
TextInput* m_artistNameInput;
TextInput* m_levelNameInput;

fs::path m_songPath;
CCNode* m_selectedContainer;
Expand Down

0 comments on commit 2609dd6

Please sign in to comment.