Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit 8ff4842

Browse files
committed
update version number and some minor improvements
1 parent 4ffe59e commit 8ff4842

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/hooks.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,10 @@ namespace Hooks {
165165
reinterpret_cast<void (*)(string*, int)>(
166166
dlsym(dlopen("libcocos2dcpp.so", RTLD_LAZY), "_ZN12GauntletNode11nameForTypeE12GauntletType"))(&gauntletName, gauntletType);
167167

168-
if (shouldReverseGauntlet(gauntletType)) {
169-
nameLabel->setString(string("Остров ").append(gauntletName).c_str());
170-
shadowLabel->setString(string("Остров ").append(gauntletName).c_str());
171-
} else {
172-
nameLabel->setString(gauntletName.append(" Остров").c_str());
173-
shadowLabel->setString(gauntletName.c_str());
174-
}
168+
auto newName = fmt::format(shouldReverseGauntlet(gauntletType) ? "Остров {}" : "{} Остров", gauntletName);
169+
170+
nameLabel->setString(newName.c_str());
171+
shadowLabel->setString(newName.c_str());
175172

176173
return true;
177174
}
@@ -191,7 +188,7 @@ namespace Hooks {
191188
lbl = node;
192189
}
193190

194-
lbl->setString(string("Таблица Лидеров для ").append(MBO(string, lvl, 252)).c_str());
191+
lbl->setString(fmt::format("Таблица Лидеров для {}", MBO(string, lvl, 252)).c_str());
195192

196193
return true;
197194
}
@@ -202,7 +199,7 @@ namespace Hooks {
202199
auto spr = cocos2d::CCSprite::createWithSpriteFrameName("gdl_icon.png");
203200
spr->setScale(1.25f);
204201

205-
auto btn = CCMenuItemSpriteExtra::create(spr, spr, self, (cocos2d::SEL_MenuHandler)&GDLMenu::openLayer);
202+
auto btn = CCMenuItemSpriteExtra::create(spr, spr, self, menu_selector(GDLMenu::openLayer));
206203
btn->setPosition({0, 0});
207204

208205
auto menu = CCMenu::create();
@@ -270,7 +267,7 @@ namespace Hooks {
270267

271268
auto winSize = CCDirector::sharedDirector()->getWinSize();
272269

273-
auto lbl = CCLabelBMFont::create("GDL 1.1.1", "goldFont.fnt");
270+
auto lbl = CCLabelBMFont::create("GDL 1.1.2", "goldFont.fnt");
274271
lbl->setPosition({winSize.width / 2.f, winSize.height - 15.f});
275272
lbl->setScale(.8f);
276273
self->addChild(lbl);

src/logger.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22
#include "fmt/format.h"
33
#include "android/log.h"
44

5-
#ifndef MODNAME
65
#define MODNAME "GDL"
7-
#endif
6+
7+
// #define GDL_DEBUG
88

99
template <typename... Args>
1010
void logD(Args... args) {
11+
#ifdef GDL_DEBUG
1112
auto str = fmt::format(args...);
1213
__android_log_print(ANDROID_LOG_DEBUG, MODNAME, "%s", str.c_str());
14+
#endif
1315
}
1416

1517
template <typename... Args>
1618
void logW(Args... args) {
19+
#ifdef GDL_DEBUG
1720
auto str = fmt::format(args...);
1821
__android_log_print(ANDROID_LOG_WARN, MODNAME, "%s", str.c_str());
22+
#endif
1923
}
2024

2125
template <typename... Args>
2226
void logE(Args... args) {
27+
#ifdef GDL_DEBUG
2328
auto str = fmt::format(args...);
2429
__android_log_print(ANDROID_LOG_ERROR, MODNAME, "%s", str.c_str());
30+
#endif
2531
}

src/utils.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <dirent.h>
55
#include <regex>
66

7-
#define GDL_DEBUG
8-
97
#define HOOK_FUNC(retType, name, ...) \
108
retType (*name##_o)(__VA_ARGS__); \
119
retType name##_hk(__VA_ARGS__)

0 commit comments

Comments
 (0)