From 7d40c8188f4074f0c2dcaa7d8a15a78c8fa9598c Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Sun, 30 Jun 2024 18:31:21 -0400 Subject: [PATCH 01/10] New image arguments format --- loader/src/ui/nodes/MDTextArea.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/loader/src/ui/nodes/MDTextArea.cpp b/loader/src/ui/nodes/MDTextArea.cpp index 1147ec7c..d2d14a70 100644 --- a/loader/src/ui/nodes/MDTextArea.cpp +++ b/loader/src/ui/nodes/MDTextArea.cpp @@ -338,16 +338,20 @@ struct MDParser { else if (s_lastImage.size()) { bool isFrame = false; - std::vector imgArguments = utils::string::split(s_lastImage, "&"); + std::vector imgArguments = utils::string::split(s_lastImage, "?"); s_lastImage = imgArguments.at(0); + if (utils::string::contains(s_lastImage, "&")) { //old format + imgArguments = utils::string::split(s_lastImage, "&"); + s_lastImage = imgArguments.at(0); + } imgArguments.erase(imgArguments.begin()); //remove the image path float spriteScale = 1.0f; for(std::string arg : imgArguments){ - if(utils::string::startsWith(arg, "scale:")){ - std::string scaleValue = arg.substr(arg.find(":") + 1); + if(utils::string::startsWith(arg, "scale=")){ + std::string scaleValue = arg.substr(arg.find("=") + 1); std::stringstream s(scaleValue); float scale; @@ -355,6 +359,15 @@ struct MDParser { spriteScale = scale; } } + else if(utils::string::startsWith(arg, "scale:")){ //old format + std::string scaleValue = arg.substr(arg.find(":") + 1); + std::stringstream s(scaleValue); + + float scale; + if (s >> scale) { + spriteScale = scale; + } + } } if (utils::string::startsWith(s_lastImage, "frame:")) { From b80efe05177fa135395b1a64b3e2ea9767bb2a0c Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Thu, 4 Jul 2024 22:59:40 -0400 Subject: [PATCH 02/10] add ampersand support whoops --- loader/src/ui/nodes/MDTextArea.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loader/src/ui/nodes/MDTextArea.cpp b/loader/src/ui/nodes/MDTextArea.cpp index d2d14a70..e3f4c0a9 100644 --- a/loader/src/ui/nodes/MDTextArea.cpp +++ b/loader/src/ui/nodes/MDTextArea.cpp @@ -347,6 +347,11 @@ struct MDParser { imgArguments.erase(imgArguments.begin()); //remove the image path + // Split by "&" to get arguments + if (imgArguments.size() > 0) { + imgArguments = utils::string::split(imgArguments.at(0), "&"); + } + float spriteScale = 1.0f; for(std::string arg : imgArguments){ From ae24abbceccae490418cfbe1624e7e43fd90d3fa Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Fri, 9 Aug 2024 17:21:14 -0400 Subject: [PATCH 03/10] first moves oh lord --- loader/resources/copy.png | Bin 0 -> 1469 bytes loader/src/ui/mods/ModsLayer.cpp | 40 +++++++++++++++++++++++++++++++ loader/src/ui/mods/ModsLayer.hpp | 1 + 3 files changed, 41 insertions(+) create mode 100644 loader/resources/copy.png diff --git a/loader/resources/copy.png b/loader/resources/copy.png new file mode 100644 index 0000000000000000000000000000000000000000..b3b5692d67567cc4ca7e5dd33525c21c8c840997 GIT binary patch literal 1469 zcmcgs{W}u~9G{nYe`oaM2&p*HDsMYh(Ta^tmX}k*MoS^H%?`I0ZxwRR(KO|(JKczB z;-Pt&w8%@|&Lc0G8xo-~#HiWb?mxJn?uXCk^ZoqveV*^<^L%qJpnP<-_Gm1!6SR6ilfX3l*Y7M*DaJc!S?8DU5227t#v=s4LKx;eZOSndlov1_1Or{)JLE z;qes!0EmXeyn<39R?2!&4n8Kg`>?8qjRamrrN5+R+&q)%sO$>UH1z8{3-&u&qMqx6 z6{;Oder0Q9ef)`+uZC~ElI=?s@VD6GC4&%(h_l)?uCh+xuWZ6kuafvH)wOx`#N60o zFGjh{ua3rUw|j^tshLuJa!2=_UdSmj&P=PAx>$3@%7AMf=9l?J2H*W@^ zI8p9#^Q;^IIhc+QtQC6h8>8f0@I3kWllf6B-W3HtwN3c9|rfjW+8EiJ& zN^^UArqFtHrVpp4;gf`<{>wyl|cs#zk zwe>O*iA)7^#!>jHrly0%>S)ux4`dQaB$A zzP8+(xwg7mljt7**YxxeoxV1Kpg~PteSi#$R?{|++3YXkKI8L)@pukBU>gE~1eTSR z#U>|*rgeXn$!gXJ2?=8aOp;y_#FD0?Zzv0wjE&u+6Rv_|h6zwNEzM`kA3sto%Ah-r zzq_4FzRxgm4h{~EWiTQX0hh49h6p07e#{24IeYmVxlSCz(|X#doe||UIGMrVA^iMS zsCTmi`h~)bkE)RQ`UxqM6plE_VDy<_%iL`5e8=cq3JK+_>~ z+lb|hzKf;6I+rsri=sUVbOO-k`F*Q1a?}{an4=low>Aj$jK@r@>G{Tv0=bvuS_!qQ4#|V2fgkPJdh8X j&|Eje68o13I*2{>a*x`Uq&0t2#mfc2&!J#EZ*1m2hRUu{ literal 0 HcmV?d00001 diff --git a/loader/src/ui/mods/ModsLayer.cpp b/loader/src/ui/mods/ModsLayer.cpp index 05a3fcef..d6e540bc 100644 --- a/loader/src/ui/mods/ModsLayer.cpp +++ b/loader/src/ui/mods/ModsLayer.cpp @@ -375,6 +375,17 @@ bool ModsLayer::init() { folderBtn->setID("mods-folder-button"); actionsMenu->addChild(folderBtn); + auto copySpr = createGeodeCircleButton( + CCSprite::createWithSpriteFrameName("copy.png"_spr), 1.f, + CircleBaseSize::Medium + ); + copySpr->setScale(.8f); + auto copyBtn = CCMenuItemSpriteExtra::create( + copySpr, this, menu_selector(ModsLayer::onCopy) + ); + copyBtn->setID("copy-button"); + actionsMenu->addChild(copyBtn); + actionsMenu->setLayout( ColumnLayout::create() ->setAxisAlignment(AxisAlignment::Start) @@ -702,6 +713,35 @@ void ModsLayer::onSettings(CCObject*) { openSettingsPopup(Mod::get()); } +void ModsLayer::onCopy(CCObject*) { + auto text = "No mods installed"; + auto mods = Loader::get()->getAllMods(); + if (!mods.empty()) text = "Mods list copied to clipboard!"; + + auto* label = CCLabelBMFont::create(text, "bigFont.fnt"); + label->setPosition(CCDirector::get()->getWinSize() / 2); + label->setOpacity(0); + label->runAction(CCSequence::create( + CCFadeIn::create(.5f), + CCDelayTime::create(1.f), + CCFadeOut::create(.5f), + nullptr + )); + this->addChild(label); + + std::stringstream ss; + using namespace std::string_view_literals; + for (auto& mod : mods) { + ss << fmt::format("{} | [{}] {}\n", + mod->isEnabled() ? "x"sv : + mod->hasProblems() ? "!"sv : + " "sv, + mod->getVersion().toVString(), mod->getID() + ); + } + clipboard::write(ss.str()); +} + ModsLayer* ModsLayer::create() { auto ret = new ModsLayer(); if (ret->init()) { diff --git a/loader/src/ui/mods/ModsLayer.hpp b/loader/src/ui/mods/ModsLayer.hpp index 7e7de630..a7f6813c 100644 --- a/loader/src/ui/mods/ModsLayer.hpp +++ b/loader/src/ui/mods/ModsLayer.hpp @@ -80,6 +80,7 @@ protected: void onRefreshList(CCObject*); void onTheme(CCObject*); void onSettings(CCObject*); + void onCopy(CCObject*); void onBack(CCObject*); void updateState(); From cded0523a5b2165c2cabbb397665ff5ba25f15d0 Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Mon, 12 Aug 2024 18:24:27 -0400 Subject: [PATCH 04/10] it's finished holy moly --- loader/resources/copy.png | Bin 1469 -> 1482 bytes loader/src/ui/mods/ModsLayer.cpp | 49 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/loader/resources/copy.png b/loader/resources/copy.png index b3b5692d67567cc4ca7e5dd33525c21c8c840997..3ec2efe5fbbcb8fdee06c3304f570d50750bfa49 100644 GIT binary patch literal 1482 zcmchX|3A|S9LMMTj3mc=$+0<(U1X^&ooYTeXETuvZLTaAAz!m{J7T#OM@v2$fwc{-(6nD8J$DmkJtrmTpaLT%Sc^!xjDlD{%aNud?ril z3+yx4ap*QijLgDdeWDF_!aB6CgSR)sj31i$$T;3jqVvrS=T?{N<~MOKC4==Pyp8I! zlfdBCz*}(`nRZ+G(>aFBPuRw~lM#M`SoWiu5fzOHMjRo;Ir!Qd{m%c)oi12YdaN>- zD4V&-f2Qn(y{rTKL);7m#Cwg62TgK*UP>}cIN8(FBa%wFh$?vy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;y_#FD0?Zzv0wjE&u+6Rv_|h6zwNEzM`kA3sto%Ah-r zzq_4FzRxgm4h{~EWiTQX0hh49h6p07e#{24IeYmVxlSCz(|X#doe||UIGMrVA^iMS zsCTmi`h~)bkE)RQ`UxqM6plE_VDy<_%iL`5e8=cq3JK+_>~ z+lb|hzKf;6I+rsri=sUVbOO-k`F*Q1a?}{an4=low>Aj$jK@r@>G{Tv0=bvuS_!qQ4#|V2fgkPJdh8X j&|Eje68o13I*2{>a*x`Uq&0t2#mfc2&!J#EZ*1m2hRUu{ diff --git a/loader/src/ui/mods/ModsLayer.cpp b/loader/src/ui/mods/ModsLayer.cpp index 881ae1e4..22507ed7 100644 --- a/loader/src/ui/mods/ModsLayer.cpp +++ b/loader/src/ui/mods/ModsLayer.cpp @@ -716,30 +716,35 @@ void ModsLayer::onSettings(CCObject*) { void ModsLayer::onCopy(CCObject*) { auto text = "No mods installed"; auto mods = Loader::get()->getAllMods(); - if (!mods.empty()) text = "Mods list copied to clipboard!"; + if (!mods.empty()) { + text = "Mods list copied to clipboard!"; + std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { + auto const s1 = a->getID(); + auto const s2 = b->getID(); + return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) { + return std::tolower(a) < std::tolower(b); + }); + }); - auto* label = CCLabelBMFont::create(text, "bigFont.fnt"); - label->setPosition(CCDirector::get()->getWinSize() / 2); - label->setOpacity(0); - label->runAction(CCSequence::create( - CCFadeIn::create(.5f), - CCDelayTime::create(1.f), - CCFadeOut::create(.5f), - nullptr - )); - this->addChild(label); - - std::stringstream ss; - using namespace std::string_view_literals; - for (auto& mod : mods) { - ss << fmt::format("{} | [{}] {}\n", - mod->isEnabled() ? "x"sv : - mod->hasProblems() ? "!"sv : - " "sv, - mod->getVersion().toVString(), mod->getID() - ); + std::stringstream ss; + using namespace std::string_view_literals; + for (int i = 0; i < mods.size(); i++) { + auto& mod = mods[i]; + ss << fmt::format("{} | [{}] {}", + mod->isEnabled() ? "x"sv : + mod->hasProblems() ? "!"sv : + " "sv, + mod->getVersion().toVString(), mod->getID() + ); + if (i != mods.size() - 1) { + ss << "\n"; + } + } + clipboard::write(ss.str()); } - clipboard::write(ss.str()); + + auto popup = TextAlertPopup::create(text, 0.5f, 0.6f, 150, "bigFont.fnt"); + this->addChild(popup, 100); } ModsLayer* ModsLayer::create() { From 0da9cef29fe01f0800a49eaf47b9e5b87373ef8d Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Mon, 19 Aug 2024 07:01:50 -0400 Subject: [PATCH 05/10] made it slightly better --- loader/resources/copy.png | Bin 1482 -> 6051 bytes loader/src/ui/mods/ModsLayer.cpp | 56 +++++++++++++++---------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/loader/resources/copy.png b/loader/resources/copy.png index 3ec2efe5fbbcb8fdee06c3304f570d50750bfa49..3c40f1967cca492f5927ca89b4f8934b11e6c8f3 100644 GIT binary patch delta 6032 zcmV;B7jNjw3!^WPNq@lr01m+cxRGn^000*_Nklri3Sob2#Ju0 zhNuNvC?FsvCMwFI*pu`7zyJTU=X>|shxhB+-K)Fbg!yLXKYugNGtbO>_|{sm83#Jh zfev(_10Co<2RhJ!4)h44n;&=Wc%bBo=4U@$@~OpFG~ImdHD@3Gr1Eo~DS5>X<(6x% zUJiQd)b7DAH=nPbZ&>b>8;UO(ow9r=>BTjScYOKo+PrpufFl;Y;Q3=*b=9IDJ9!U_ zGt_~q!;-uEcqw8XL*L%l!$t&a%z4_P2`0vk;@!H?q9m=!6 zevA))Y}{1pCl}=S=pi3Sk=wD*JN~$CneVl+C#CT;`hR{-MB|J}Snn7ylGswlc+dOB z_@0+8I`sD69pgK{eT+B0WsKkWo!yJ*Sv8c8T!Nw0+%F$}({so8t{2+agVInnwZ#4U zSek~8vYu(5}mtziViU!pgD$LIJR!oIiMC9i$V7(eTw zuvdn1N8KYel#iEsEJJyC4Wt@F-(WSJhLzOafqxli;c2w)l9j|K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!xjDlD{%aNud?ril z3+yx4ap*QijLgDdeWDF_!aB6CgSR)sj31i$$T;3jqVvrS=T?{N<~MOKC4==Pyp8I! zlfdBCz*}(`nRZ+G(>aFBPuRw~lM#M`SoWiu5fzOHMjRo;Ir!Qd{m%c)oi12YdaN>- zD4V&-f2Qn(y{rTKL);7m#Cwg62TgK*UP>}cIN8(FBa%wFh$?vyfpEvl+Iq?LRqI;? zi+J)cA2Wc-N{qiOlgR?9)JKR+4@W35Iy##7je11?)PEH)+VtZE8 zlC?si;5~jEpt#QE!q?puG3ahW2`j|daM#w>t{GdsIPs$LA*=U% zhdLL6upJ;|WM(co=X(iJtZ|2+3N#i(@{W(MwJNDXUEIyEjmY0>R@M71d>BRuM5VA79x|?}Ff00k*n2 z+zm~z866$n!mxj(T@EGF9*ct5Re&m9^0B_cUF_~otSY&YmM!^VK<5e4}A z`f`ScgHH-bj%Q{&2>jaG(lD19iA3_u0-BhXHm9$zUv!$r+_ASWT-UE@16akf6B&%^ zni{7-GI?fB_f~oNcZ2=?+@z$WMaz!X*2`n#B2k6&*wj(>-dD9!=~WrQ6@?moo^e~I z^nB2pj+euuu-QZkrB?po6Cz$W6}d3qiLE!iP^Ph2z+AYP>=4Z3@k9~{=WJvo^3YU` zW@$+K`;Wn;8slSQNrEr~a>xo1O3$YyC-a0tq2#%^)kU$qtR(C$`x3(-m1@*hS0@Oj z^g=(_)c8gA<)>5pTIJ5?MC^ zTpoE7s}EF1oTk$$u`w|Xl@niyYiDB^*getAllMods(); - if (!mods.empty()) { - text = "Mods list copied to clipboard!"; - std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { - auto const s1 = a->getID(); - auto const s2 = b->getID(); - return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) { - return std::tolower(a) < std::tolower(b); - }); - }); - - std::stringstream ss; - using namespace std::string_view_literals; - for (int i = 0; i < mods.size(); i++) { - auto& mod = mods[i]; - ss << fmt::format("{} | [{}] {}", - mod->isEnabled() ? "x"sv : - mod->hasProblems() ? "!"sv : - " "sv, - mod->getVersion().toVString(), mod->getID() - ); - if (i != mods.size() - 1) { - ss << "\n"; - } - } - clipboard::write(ss.str()); + if (mods.empty()) { + Notification::create("No mods installed", NotificationIcon::Info, 0.6f)->show(); + return; } - auto popup = TextAlertPopup::create(text, 0.5f, 0.6f, 150, "bigFont.fnt"); - this->addChild(popup, 100); + std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { + auto const s1 = a->getID(); + auto const s2 = b->getID(); + return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) { + return std::tolower(a) < std::tolower(b); + }); + }); + + std::stringstream ss; + using namespace std::string_view_literals; + for (int i = 0; i < mods.size(); i++) { + auto& mod = mods[i]; + ss << fmt::format("{} | [{}] {}", + mod->isEnabled() ? "x"sv : + mod->hasProblems() ? "!"sv : + " "sv, + mod->getVersion().toVString(), mod->getID() + ); + if (i != mods.size() - 1) { + ss << "\n"; + } + } + clipboard::write(ss.str()); + + Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show(); } ModsLayer* ModsLayer::create() { From f45b8b7128f4337591ec3170eb45471c0643d300 Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Mon, 19 Aug 2024 07:02:55 -0400 Subject: [PATCH 06/10] almost forgot --- loader/src/ui/mods/ModsLayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/ui/mods/ModsLayer.cpp b/loader/src/ui/mods/ModsLayer.cpp index 96ab33f1..a8e3e0f3 100644 --- a/loader/src/ui/mods/ModsLayer.cpp +++ b/loader/src/ui/mods/ModsLayer.cpp @@ -716,7 +716,7 @@ void ModsLayer::onSettings(CCObject*) { void ModsLayer::onCopy(CCObject*) { auto mods = Loader::get()->getAllMods(); if (mods.empty()) { - Notification::create("No mods installed", NotificationIcon::Info, 0.6f)->show(); + Notification::create("No mods installed", NotificationIcon::Info, 0.5f)->show(); return; } From 3222c12e904bb672bae7d5ac57958e20088006ab Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Mon, 19 Aug 2024 07:38:14 -0400 Subject: [PATCH 07/10] texture revamp by @Alphalaneous --- loader/resources/copy.png | Bin 6051 -> 6635 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/loader/resources/copy.png b/loader/resources/copy.png index 3c40f1967cca492f5927ca89b4f8934b11e6c8f3..e9209613fcfecf68f7932de6e193dc44f55a1a7d 100644 GIT binary patch delta 6608 zcma)>Wl+@Nx5w!gM4APb6(s}~sRg7{x^?L;>2CPZjUX+xl7b=)(%oIs$kHXfNW=9% zb7$_I`|6(e&zbK$-!q?cp63*B9q=Z;189O2WF)n{jSdY7%Pir#MqXBnQ;U&BMJPyN z0bU-G-CfTipcmIhHideX6~>LVm_c2@P3lnct9H`1Qo;^H%Ff<9nUPke^Qlo<+B5A+ z@e$i!P@S)DUd(x1K8La+8XjgVgO?ne%3HQ7 z0-FuaipPt;MhXPag&t$JFGoK3^aOCWxoD0AMp%R4*Etsb~~sZKL4d^!vI3jDYnx@G-vvR&;qCo}p;*@Av& zeR6=@EvDOza0dRRmU+K^b0DVenSF0wByv`+>1i1H{S0bxGhy&L6vvFiwxTkno~A}Q zC+i(sK)Zilg-CiGa9HU(oNBps4tym1V`{mR9GQOD9;oDl%!}6VOJ&4u1JkXfVBWt$ z2y_!lKRMwkO6{}~@uwh29;K$#dhVbY?DKT&rH;uSvn1l(KISYp=AYm1-orIkMVp6R zmKfL(ZTq#Zo1}sH+6HJxXvSD)zvfCZ8FnL1D26`g;dqZv0G2WA((g9#r8Re#Yt%V( z4EfPkp!pFJPPvEqgq+R4^j$G+?7?=*I{LjNnHaebGpT25!)lyM^{{?Y6D@D!JJS=J zHP*9O1eqSaNI zY15+vca^kZrhojY?FA$!aKfCnj4k3FpqYgs<%n*4-BmDj{D85_{?{3L z6@cUl8ArRm34s1{_7Ap*4<0Psgq!FfX~d2Oy60QWOL|h%wrx^C@u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ALu=X}v33nwnVeBBJTCNLVvnl!h+Q-GCQl));_ zF_I;uH@|8uJ?kV#gnfc(zdNKpkQvU>6?55YqB+f)`igd9u>sM|xRN`6mH?{{2B4-B z2Z+RFJr~GP`<_(V>wg`hj&N9-5eDb*W;H8z=_Qt!Mtlp>KSf0hk`J#dfcRoHJ9bH} z6Fu?7l}P@~xs0TLZ&5{EJZ&0?&fN~n!P9WMF&k;$#3-s7wf>g%(NB-@cegvG{By|8 zTd%kFO@G@*5c{B9X8OR##<=5iHZGFR`>&gs=Fy&W(-?pH`hPJVf6dYWIot$3^h4gF zEz1qS9a~JCKmnHE64b@XIBb2MS|^1qoQ3t~pyz6VakPpIt z&h<)p{~cre;#+N&%{ll-mcMfEIhPil*J(-(8pvB;H^vjLt{#!;1`?sW#`?rdVrnSG zq`dnds?guB!hh~LQz-P@8|rrDezn~RCuqRX3?uO1CNSj8%747zFre+J0Syj z7!P5ezkwe&Z5qfOpB>}<{Qn*^geqKji3bB|IE(tQq<#Jde%y4yUoD@0%y?k^m%TT= zY>aQ^{~3l*y2>&_PD`nrmfgd+r%w{jHp}b=~l;>Pm zx7YUXXeW{$%-_H-7u`|?GKvSPV96_yb2guqKf9i2y7}sQe3iVS*=M}D_+de}T**W6 x*-reOai9Yo=s*WL(18wgpaUJ~K*vX8{6D2^+|WuNuoD0P002ovPDHLkV1i>k2lxO0 From c6c9af68674f92b32779c21ca8aab64d931c9a08 Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Tue, 10 Sep 2024 15:57:50 -0400 Subject: [PATCH 08/10] why is it not loading --- loader/resources/copy.png | Bin 6635 -> 0 bytes loader/resources/mod.json.in | 3 + loader/src/loader/CopyButtonSetting.cpp | 44 ++++++++++++++ loader/src/loader/CopyButtonSetting.hpp | 74 ++++++++++++++++++++++++ loader/src/ui/mods/ModsLayer.cpp | 45 -------------- loader/src/ui/mods/ModsLayer.hpp | 1 - 6 files changed, 121 insertions(+), 46 deletions(-) delete mode 100644 loader/resources/copy.png create mode 100644 loader/src/loader/CopyButtonSetting.cpp create mode 100644 loader/src/loader/CopyButtonSetting.hpp diff --git a/loader/resources/copy.png b/loader/resources/copy.png deleted file mode 100644 index e9209613fcfecf68f7932de6e193dc44f55a1a7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6635 zcma)>WlS7gu=jB+eWOs;$MiZyP0t zvPJ7H9~Li&aR)kaKyosw`7)hwpD>?rbpp}VaD2)Ed(o}h_SoZS;<&2p19I!RNaIj( zJO+}p`Hau^JbQ6S%RPb4AZ)l?KTdx&QizeOtTpEkp)2;!P^E5!E#Bp@Rjcl-098BS z&iF*|gdJJP2%XS$ep>-s-f@#OD)GHaff}oi1uZOC-tsnjdp|DYMp)|D(fw4NZ)jP} zeOx{Vv%?!7W~)M$9Gfdzw<-f$49-f%OTI-4gv^BH(Rg{AK5GZrrxXU{`%dH-$dYMiOE_6B@{08{A z9JXcsaI#(FHYYRsNZE>hXMJ*j+%2Kojc^WnI$7r9`ptouwr9@0d9lb@g{G%r*pD-? z#m$7l+b|q64%^DA)CQVb<=pHKYylnq`IRCW^@mly!)caV=Ruzd|C(Cvq(o*Mb_6Q< zAoHX3`_dS3+ktc|shIcg-~!!*($7wKiqjBQBK{NvDWlYsS}z?GLwuf(z1A_=W0r(} z*vFjZ#{B!|!$+vbs%Xow%Mt@SynVmUb(1u(K-&QA2+bJl?Dt%07Q=4D3B}Ntd>rrb z3CkFE=?@$D(we)=wdx!?hWuzN;DQJVr@X@gLe7@o`mUHZ_CPyj9sORCER4K|nY6RD zVKvUB21q}tiI%tVo#~0qJIY>!&45=p?firCa_5p?L@cxD>$L*tc5#@mAH^E=H8Rx^ zQ1>U<<^soV9v3>WznEt~WV>*Bs6Q;s_hUd=3qUjCdMK8oBLPL3C{x2!k#cjm;&C3>mP^K1Pz(krwB>&(kI1qy33!Q^`- zjP$MZa6uF;5o=YAI|sfFh=d~KiQ+i4aMcY~fcKLc|RR{aLdzBe!^8vzx*?th1XGp+I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=nI(S}#_T=%NC@0rO{_WBBOHU$SYVgD5hR2j@qWU%K*fXK-$! z0S#3L(^G|?8k;fvuDSm*bYLoyObqkr9J*`%)}{3zI7o7xs`*5?^s23*>#2?O1YIcJ zcsyyC|o>dhBz7SEpxKlxOK_^=Gg0O#Rcj1N69URWA5!c%>44^IE>b8AFY% z5%VO~s;?{wmK@8FIW~Fi4>8UYJq})kF?K*aI?PJWl~0%=t-~s@g3>-q)42sa$(iW^ zd)`WUO4Bt=Rav%*&G4N%P;jjfi6Xh;pgHFYN1ko1VtMb~08hRktC9H_tGq|)6hPH0 zmc$^Y)nhK7XdghA5^qQQ8Sx4A2_!LycN@XuDbX(PIf%R^3Um@MRtX?NiH5OGeode-themed color scheme. This does not affect any other menus!" }, + "copy-mods": { + "type": "custom:copy-mods" + }, "developer-title": { "type": "title", "name": "Developer Settings" diff --git a/loader/src/loader/CopyButtonSetting.cpp b/loader/src/loader/CopyButtonSetting.cpp new file mode 100644 index 00000000..178aea7a --- /dev/null +++ b/loader/src/loader/CopyButtonSetting.cpp @@ -0,0 +1,44 @@ +#include "CopyButtonSetting.hpp" +#include + +$execute { + (void)Mod::get()->registerCustomSettingType("copy-mods", &CopyButtonSetting::parse); +} + +SettingNodeV3* CopyButtonSetting::createNode(float width) { + return CopyButtonSettingNode::create(std::static_pointer_cast(shared_from_this()), width); +} + +void CopyButtonSettingNode::onCopy(CCObject*) { + auto mods = Loader::get()->getAllMods(); + if (mods.empty()) { + Notification::create("No mods installed", NotificationIcon::Info, 0.5f)->show(); + return; + } + + std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { + auto const s1 = a->getID(); + auto const s2 = b->getID(); + return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) { + return std::tolower(a) < std::tolower(b); + }); + }); + + std::stringstream ss; + using namespace std::string_view_literals; + for (int i = 0; i < mods.size(); i++) { + auto& mod = mods[i]; + ss << fmt::format("{} | [{}] {}", + mod->isEnabled() ? "x"sv : + mod->hasProblems() ? "!"sv : + " "sv, + mod->getVersion().toVString(), mod->getID() + ); + if (i != mods.size() - 1) { + ss << "\n"; + } + } + clipboard::write(ss.str()); + + Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show(); +} diff --git a/loader/src/loader/CopyButtonSetting.hpp b/loader/src/loader/CopyButtonSetting.hpp new file mode 100644 index 00000000..ac87eff5 --- /dev/null +++ b/loader/src/loader/CopyButtonSetting.hpp @@ -0,0 +1,74 @@ +#include +#include + +using namespace geode::prelude; + +class CopyButtonSetting : public SettingV3 { +public: + static Result> parse(std::string const& key, std::string const& modID, matjson::Value const& json) { + auto res = std::make_shared(); + auto root = checkJson(json, "CopyButtonSetting"); + + res->init(key, modID, root); + + return root.ok(res); + } + + bool load(matjson::Value const& json) override { + return true; + } + bool save(matjson::Value& json) const override { + return true; + } + + bool isDefaultValue() const override { + return true; + } + void reset() override {} + + SettingNodeV3* createNode(float width) override; +}; + +class CopyButtonSettingNode : public SettingNodeV3 { +protected: + bool init(std::shared_ptr setting, float width) { + if (!SettingNodeV3::init(setting, width)) + return false; + + auto buttonSprite = createGeodeButton("Copy Mods"); + buttonSprite->setScale(.5f); + auto button = CCMenuItemSpriteExtra::create( + buttonSprite, this, menu_selector(CopyButtonSettingNode::onCopy) + ); + this->getButtonMenu()->addChildAtPosition(button, Anchor::Center); + this->getButtonMenu()->setContentWidth(60); + this->getButtonMenu()->updateLayout(); + + this->updateState(nullptr); + + return true; + } + + void onCopy(CCObject*); + + void onCommit() override {} + void onResetToDefault() override {} + +public: + static CopyButtonSettingNode* create(std::shared_ptr setting, float width) { + auto ret = new CopyButtonSettingNode(); + if (ret && ret->init(setting, width)) { + ret->autorelease(); + return ret; + } + CC_SAFE_DELETE(ret); + return nullptr; + } + + bool hasUncommittedChanges() const override { + return false; + } + bool hasNonDefaultValue() const override { + return false; + } +}; diff --git a/loader/src/ui/mods/ModsLayer.cpp b/loader/src/ui/mods/ModsLayer.cpp index 30e61b7e..ce7562f8 100644 --- a/loader/src/ui/mods/ModsLayer.cpp +++ b/loader/src/ui/mods/ModsLayer.cpp @@ -380,17 +380,6 @@ bool ModsLayer::init() { folderBtn->setID("mods-folder-button"); actionsMenu->addChild(folderBtn); - auto copySpr = createGeodeCircleButton( - CCSprite::createWithSpriteFrameName("copy.png"_spr), 1.f, - CircleBaseSize::Medium - ); - copySpr->setScale(.8f); - auto copyBtn = CCMenuItemSpriteExtra::create( - copySpr, this, menu_selector(ModsLayer::onCopy) - ); - copyBtn->setID("copy-button"); - actionsMenu->addChild(copyBtn); - actionsMenu->setLayout( ColumnLayout::create() ->setAxisAlignment(AxisAlignment::Start) @@ -718,40 +707,6 @@ void ModsLayer::onSettings(CCObject*) { openSettingsPopup(Mod::get()); } -void ModsLayer::onCopy(CCObject*) { - auto mods = Loader::get()->getAllMods(); - if (mods.empty()) { - Notification::create("No mods installed", NotificationIcon::Info, 0.5f)->show(); - return; - } - - std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { - auto const s1 = a->getID(); - auto const s2 = b->getID(); - return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) { - return std::tolower(a) < std::tolower(b); - }); - }); - - std::stringstream ss; - using namespace std::string_view_literals; - for (int i = 0; i < mods.size(); i++) { - auto& mod = mods[i]; - ss << fmt::format("{} | [{}] {}", - mod->isEnabled() ? "x"sv : - mod->hasProblems() ? "!"sv : - " "sv, - mod->getVersion().toVString(), mod->getID() - ); - if (i != mods.size() - 1) { - ss << "\n"; - } - } - clipboard::write(ss.str()); - - Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show(); -} - ModsLayer* ModsLayer::create() { auto ret = new ModsLayer(); if (ret->init()) { diff --git a/loader/src/ui/mods/ModsLayer.hpp b/loader/src/ui/mods/ModsLayer.hpp index c0572fd7..35e36b97 100644 --- a/loader/src/ui/mods/ModsLayer.hpp +++ b/loader/src/ui/mods/ModsLayer.hpp @@ -82,7 +82,6 @@ protected: void onRefreshList(CCObject*); void onTheme(CCObject*); void onSettings(CCObject*); - void onCopy(CCObject*); void onBack(CCObject*); void updateState(); From 93e463bf197572285d7bee50db2d2dfd0b5f92d0 Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Tue, 10 Sep 2024 16:05:03 -0400 Subject: [PATCH 09/10] whoops --- loader/src/loader/CopyButtonSetting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/loader/CopyButtonSetting.cpp b/loader/src/loader/CopyButtonSetting.cpp index 178aea7a..834ec221 100644 --- a/loader/src/loader/CopyButtonSetting.cpp +++ b/loader/src/loader/CopyButtonSetting.cpp @@ -1,7 +1,7 @@ #include "CopyButtonSetting.hpp" #include -$execute { +$on_mod(Loaded) { (void)Mod::get()->registerCustomSettingType("copy-mods", &CopyButtonSetting::parse); } From 0597416d48dc6be0cd9d760c7d9984e6fbf5166d Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Tue, 10 Sep 2024 16:15:21 -0400 Subject: [PATCH 10/10] FINALLY --- loader/resources/mod.json.in | 3 ++- loader/src/loader/CopyButtonSetting.hpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/loader/resources/mod.json.in b/loader/resources/mod.json.in index 702306e2..dca3df4d 100644 --- a/loader/resources/mod.json.in +++ b/loader/resources/mod.json.in @@ -83,7 +83,8 @@ "description": "When enabled, the Geode menu has a Geode-themed color scheme. This does not affect any other menus!" }, "copy-mods": { - "type": "custom:copy-mods" + "type": "custom:copy-mods", + "name": "" }, "developer-title": { "type": "title", diff --git a/loader/src/loader/CopyButtonSetting.hpp b/loader/src/loader/CopyButtonSetting.hpp index ac87eff5..81b5f5b9 100644 --- a/loader/src/loader/CopyButtonSetting.hpp +++ b/loader/src/loader/CopyButtonSetting.hpp @@ -10,6 +10,7 @@ public: auto root = checkJson(json, "CopyButtonSetting"); res->init(key, modID, root); + res->parseNameAndDescription(root); return root.ok(res); } @@ -41,7 +42,8 @@ protected: buttonSprite, this, menu_selector(CopyButtonSettingNode::onCopy) ); this->getButtonMenu()->addChildAtPosition(button, Anchor::Center); - this->getButtonMenu()->setContentWidth(60); + this->getButtonMenu()->setPosition(getContentSize() / 2); + this->getButtonMenu()->setAnchorPoint({ .5f, .5f }); this->getButtonMenu()->updateLayout(); this->updateState(nullptr);