Skip to content

Commit ab263f1

Browse files
committed
Fix some stuff for android support
1 parent 31ae636 commit ab263f1

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

src/layers/PlayLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class $modify(PlayLayerPause, PlayLayer)
5858
!this->m_isPracticeMode &&
5959
percentage >= RouletteManager.levelPercentageGoal
6060
) {
61-
if (delta > .2f && !this->m_player1->m_isDead)
61+
if (delta > .2f/* && !this->m_player1->m_isDead*/)
6262
{
6363
RouletteManager.hasFinishedPreviousLevel = true;
6464
RouletteManager.lastLevelPercentage = percentage;

src/listfetcher/ListFetcher.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <matjson.hpp>
33

44
#include <random>
5-
#include <format>
65
#include "ListFetcher.hpp"
76
#include "../utils.hpp"
87

@@ -22,8 +21,9 @@ void ListFetcher::getRandomNormalListLevel(int stars, matjson::Value& json)
2221

2322
isFetching = true;
2423

25-
std::string link = std::format(
26-
"https://gdbrowser.com/api/search/*?diff={}&starred&page={}", stars, roulette::utils::randomInt(1, m_normalListMaxPage[stars - 1])
24+
std::string link = fmt::format(
25+
"https://gdbrowser.com/api/search/*?diff={}&starred&page={}",
26+
stars, roulette::utils::randomInt(1, m_normalListMaxPage[stars - 1])
2727
);
2828

2929
web::AsyncWebRequest()
@@ -125,7 +125,7 @@ void ListFetcher::getRandomChallengeListLevel(matjson::Value& json)
125125

126126
void ListFetcher::getLevelInfo(int levelID, matjson::Value& json)
127127
{
128-
std::string link = std::format("https://gdbrowser.com/api/search/{}", levelID);
128+
std::string link = fmt::format("https://gdbrowser.com/api/search/{}", levelID);
129129

130130
web::AsyncWebRequest()
131131
.get(link)

src/roulette/layers/RouletteLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void RouletteLayer::onLevelInfo(CCObject* sender)
516516
break;
517517
}
518518

519-
roulette::utils::setClipboardText(text.c_str());
519+
clipboard::write(text);
520520
// this->addChild(TextAlertPopup::create("Copied to Clipboard", .5f, .6f, 1, "bigFont.fnt"));
521521
Notification::create("Copied to Clipboard", NotificationIcon::Success)->show();
522522
}
@@ -591,7 +591,7 @@ void RouletteLayer::onNextButton(CCObject*)
591591
// ), 1.2f, .8f, 1, "bigFont.fnt"
592592
// ));
593593
Notification::create(
594-
std::format(
594+
fmt::format(
595595
"You need to get at least {}%!", static_cast<int>(RouletteManager.levelPercentageGoal)
596596
),
597597
NotificationIcon::Error

src/utils.hpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,6 @@ namespace roulette::utils
1515
return distribution(generator);
1616
}
1717

18-
inline void setClipboardText(std::string text)
19-
{
20-
if (OpenClipboard(0))
21-
{
22-
HGLOBAL clipbuffer;
23-
char* buffer;
24-
EmptyClipboard();
25-
26-
clipbuffer = GlobalAlloc(GMEM_DDESHARE, text.size() + 1);
27-
if (clipbuffer)
28-
{
29-
buffer = static_cast<char*>(GlobalLock(clipbuffer));
30-
if (buffer)
31-
{
32-
strcpy(buffer, text.c_str());
33-
GlobalUnlock(clipbuffer);
34-
SetClipboardData(CF_TEXT, clipbuffer);
35-
}
36-
}
37-
38-
CloseClipboard();
39-
}
40-
}
41-
4218
template<typename T>
4319
inline std::ptrdiff_t getIndexOf(const std::vector<matjson::Value>& vec, T to_find)
4420
{

0 commit comments

Comments
 (0)