@@ -44,10 +44,12 @@ std::vector<std::string> MoreLeaderboards::getWords(std::string s, std::string d
4444class SearchUserLBLayer : public BrownAlertDelegate {
4545 protected:
4646 MoreLeaderboards* m_layer;
47- InputNode * input_username = InputNode ::create(200 .0F , " Username" , " bigFont.fnt" , " " , 20 );
47+ TextInput * input_username = TextInput ::create(200 .0F , " Username" , " bigFont.fnt" );
4848
4949 virtual void setup () {
5050 auto winSize = cocos2d::CCDirector::sharedDirector ()->getWinSize ();
51+ input_username->setMaxCharCount (20 );
52+ input_username->setPlaceholder (" " );
5153 input_username->setPositionY (10 );
5254 this ->m_buttonMenu ->addChild (input_username);
5355 auto validate_spr = ButtonSprite::create (" Search" , 60 , true , " bigFont.fnt" , " GJ_button_01.png" , 30 , .5F );
@@ -435,7 +437,7 @@ void MoreLeaderboards::startLoadingMods() {
435437 [expect = std::move (expect), then = std::move (then)](web::WebResponse* response) {
436438 const std::lock_guard<std::mutex> lock (lock_var);
437439 if (response->ok ()) {
438- then (response->string ().value ());
440+ then (response->string ().unwrapOrDefault ());
439441 } else {
440442 expect (" An error occured while sending a request on our server. Please try again later." );
441443 }
@@ -464,7 +466,7 @@ void MoreLeaderboards::startLoadingMore() {
464466
465467 this ->retain ();
466468
467- const geode::utils::MiniFunction <void (std::string const &)> expect = [this ](std::string const & error) {
469+ const std::function <void (std::string const &)> expect = [this ](std::string const & error) {
468470 loading = false ;
469471 auto scene = CCDirector::sharedDirector ()->getRunningScene ();
470472 auto layer = scene->getChildren ()->objectAtIndex (0 );
@@ -486,7 +488,7 @@ void MoreLeaderboards::startLoadingMore() {
486488 this ->release ();
487489 };
488490
489- const geode::utils::MiniFunction <void (std::string const &)> then = [this ](std::string const & data) {
491+ const std::function <void (std::string const &)> then = [this ](std::string const & data) {
490492 if (data != " -1" ) {
491493 data_region = data;
492494 SelectRegion::displayedData = MoreLeaderboards::getWords (data, " |" );
@@ -552,7 +554,7 @@ void MoreLeaderboards::startLoadingMore() {
552554 break ;
553555 }
554556
555- const geode::utils::MiniFunction <void (std::string const &)> expect = [this ](std::string const & error) {
557+ const std::function <void (std::string const &)> expect = [this ](std::string const & error) {
556558 loading = false ;
557559
558560 auto scene = CCDirector::sharedDirector ()->getRunningScene ();
@@ -575,7 +577,7 @@ void MoreLeaderboards::startLoadingMore() {
575577 this ->release ();
576578 };
577579
578- const geode::utils::MiniFunction <void (std::string const &)> then = [this ](std::string const & data) {
580+ const std::function <void (std::string const &)> then = [this ](std::string const & data) {
579581 loading = false ;
580582
581583 const std::lock_guard<std::mutex> lock (lock_var);
@@ -629,7 +631,7 @@ void MoreLeaderboards::startLoadingMore() {
629631 request.param (" type" , type).param (" page" , page).param (" country" , country_id).param (" username" , username).param (" mod" , (modFilter ? " 1" : " 0" )).param (" modFilter" , modFilterType).get (" https://clarifygdps.com/gdutils/moreleaderboards.php" ).map (
630632 [expect = std::move (expect), then = std::move (then)](web::WebResponse* response) {
631633 if (response->ok ()) {
632- then (response->string ().value ());
634+ then (response->string ().unwrap ());
633635 } else {
634636 expect (" An error occured while sending a request on our server. Please try again later." );
635637 }
@@ -645,7 +647,7 @@ void MoreLeaderboards::startLoadingMore() {
645647 m_listener.bind ([expect = std::move (expect), then = std::move (then)] (web::WebTask::Event* e) {
646648 if (web::WebResponse* res = e->getValue ()) {
647649 if (res->ok ()) {
648- then (res->string ().value ());
650+ then (res->string ().unwrap ());
649651 } else {
650652 expect (" An error occured while sending a request on our server. Please try again later." );
651653 }
@@ -751,8 +753,7 @@ void MoreLeaderboards::loadPageStats() {
751753 page_label->setLayoutOptions (
752754 AxisLayoutOptions::create ()
753755 ->setAutoScale (true )
754- ->setMinScale (0 )
755- ->setMaxScale (0 .7f )
756+ ->setScaleLimits (0 , 0 .7F )
756757 ->setScalePriority (1 )
757758 );
758759 menu_label->addChild (page_label);
@@ -1255,9 +1256,6 @@ void MoreLeaderboards::onTab(CCObject* pSender) {
12551256 if (pSender) {
12561257 MoreLeaderboards::g_tab = static_cast <StatsListType>(pSender->getTag ());
12571258 }
1258-
1259-
1260-
12611259 resetInfos ();
12621260
12631261 page = 0 ;
@@ -1293,6 +1291,7 @@ class $modify(LeaderboardsLayer) {
12931291 bool init (LeaderboardState state) {
12941292 if (!LeaderboardsLayer::init (state)) return false ;
12951293
1294+ log::info (" weee" );
12961295 auto menu = CCMenu::create ();
12971296
12981297 auto plusSpr = CCSprite::createWithSpriteFrameName (" GJ_plusBtn_001.png" );
0 commit comments