Skip to content

Commit d338d33

Browse files
committed
update suppporter info + fix infinite zooming on android
1 parent 19d2a04 commit d338d33

15 files changed

+40
-185
lines changed

about.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Pre-2.206 versions of BetterEdit relied on the now-defunct BetterSave mod to cre
2222

2323
## <cy>Support</c>
2424

25-
BetterEdit is first and foremost **a passion project**, however it is also being developed by a poor student living on his own. If you would like to support development and help me out, I have a <cp>Ko-fi</c>! Supporters get <co>Early Access</c> to features. I also plan on adding extra advanced features for Supporters in the future!
25+
BetterEdit is first and foremost <cy>a passion project</c>, but if you would like to support development, I have a Ko-fi!
26+
27+
Supporters used to get exclusive features, but those features have since been made free for everyone. Feel free to donate if you want to thank me for my work on BetterEdit and Geode, but be aware that it'll **not** come with any extra perks anymore!
2628

2729
[Link to my Ko-fi](https://ko-fi.com/hjfod)

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# BetterEdit 6
22

3+
## v6.10.0-alpha.8
4+
* Fix being able to zoom out infinitely in the editor on Android
5+
36
## v6.10.0-alpha.7
47
* <co>Group Summary</c> is back!
58

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.3.1",
2+
"geode": "4.6.1",
33
"version": "6.10.0-alpha.7",
44
"gd": {
55
"win": "2.2074",

src/features/ButtonRowsBypass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class $modify(EditorOptionsLayer) {
1414
void onButtonsPerRow(CCObject* sender) {
1515
if (0) EditorOptionsLayer::onButtonsPerRow(sender);
1616

17-
m_buttonsPerRow = clamp(m_buttonsPerRow + (sender->getTag() ? 1 : -1), 6, 128);
17+
m_buttonsPerRow = std::clamp(m_buttonsPerRow + (sender->getTag() ? 1 : -1), 6, 128);
1818
m_buttonsPerRowLabel->setString(std::to_string(m_buttonsPerRow).c_str());
1919
}
2020
};

src/features/EditMixedValues.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class MixedValuesInput : public CCMenu {
143143

144144
void onArrow(CCObject* sender) {
145145
for (auto obj : m_targets) {
146-
auto val = clamp(
147-
m_config.get(obj) + sender->getTag(),
146+
auto val = std::clamp(
147+
static_cast<T>(m_config.get(obj) + sender->getTag()),
148148
m_config.limits.min, m_config.limits.max
149149
);
150150
m_config.set(obj, val, sender->getTag() > 0 ? Direction::Increment : Direction::Decrement);
@@ -179,7 +179,7 @@ class MixedValuesInput : public CCMenu {
179179
}
180180
void override(T value, bool updateLabel = true) {
181181
for (auto obj : m_targets) {
182-
m_config.set(obj, clamp(value, m_config.limits.min, m_config.limits.max), Direction::Reset);
182+
m_config.set(obj, std::clamp(value, m_config.limits.min, m_config.limits.max), Direction::Reset);
183183
}
184184
if (updateLabel) {
185185
this->updateLabel();
@@ -253,7 +253,7 @@ class MixedValuesInput : public CCMenu {
253253
if (this->isMixed()) {
254254
auto minmax = this->getMinMax();
255255
m_input->setEnabled(false);
256-
m_input->getInputNode()->m_placeholderLabel->setOpacity(255);
256+
m_input->getInputNode()->m_textLabel->setOpacity(255);
257257
m_input->defocus();
258258
m_unmixBtn->setVisible(true);
259259
m_input->setString(fmt::format("{}..{}", minmax.min, minmax.max));

src/features/FixMouseControls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class $modify(EditorUI) {
4141
std::log(std::max(zoom, .001f)) - y * .01f
4242
));
4343
// zoom limit
44-
zoom = clamp(zoom, .1f, 10000000.f);
44+
zoom = std::clamp(zoom, .1f, 10000000.f);
4545

4646
if (Mod::get()->getSettingValue<bool>("mouse-move-on-zoom")) {
4747
auto mousePos = getMousePos();

src/features/PinchToZoom.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class $modify(EditorUI) {
6565
auto distNow = firstLoc.getDistance(secondLoc);
6666

6767
auto const mult = m_fields->m_initialDistance / distNow;
68-
auto zoom = std::max(m_fields->m_initialScale / mult, 0.1f);
68+
// zoom limit
69+
auto zoom = std::clamp(m_fields->m_initialScale / mult, .1f, 10000000.f);
6970
// safety measure, nan zoom can really mess up gd
7071
if (std::isnan(zoom) || std::isinf(zoom)) {
7172
this->updateZoom(1.f);

src/features/about/AboutBEButton.cpp

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <Geode/ui/BasedButtonSprite.hpp>
44
#include <Geode/binding/GameToolbox.hpp>
55
#include "AboutBEPopup.hpp"
6-
#include "SupportPopup.hpp"
76
#include <utils/Pro.hpp>
87

98
using namespace geode::prelude;
@@ -14,65 +13,6 @@ class $modify(AboutBEPauseLayer, EditorPauseLayer) {
1413
if (!EditorPauseLayer::init(lel))
1514
return false;
1615

17-
if (!Mod::get()->template getSavedValue<bool>("dont-show-support-button")) {
18-
if (auto topMenu = this->getChildByID("top-menu")) {
19-
auto supportSpr = CCSprite::createWithSpriteFrameName("support-btn.png"_spr);
20-
21-
auto glow = CCSprite::createWithSpriteFrameName("support-btn-glow.png"_spr);
22-
glow->setZOrder(2);
23-
glow->setBlendFunc({ GL_SRC_ALPHA, GL_ONE });
24-
glow->setOpacity(125);
25-
glow->runAction(CCRepeat::create(
26-
CCSequence::create(
27-
CCEaseInOut::create(CCFadeTo::create(1.5f, 0), 4.f),
28-
CCEaseInOut::create(CCFadeTo::create(1.5f, 125), 4.f),
29-
nullptr
30-
),
31-
1000
32-
));
33-
supportSpr->addChildAtPosition(glow, Anchor::Center);
34-
35-
auto particleFall = GameToolbox::particleFromString("37a-1a2a0.33a15a-90a92a0a0a59a0a0a-10a0a0a0a0a1a1a0a48a1a0a0a0a0.27451a0a1a0a0a1a0a165a1a0a0.686275a0a0.235294a0a1a0a0a0a0.61a0a0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0", nullptr, false);
36-
particleFall->setZOrder(-1);
37-
particleFall->setScaleX(1.61f);
38-
particleFall->setScaleY(1.61f);
39-
supportSpr->addChildAtPosition(particleFall, Anchor::Bottom);
40-
41-
// auto particleTop1 = GameToolbox::particleFromString("5a-1a2a0.33a15a-90a180a0a0a59a0a0a-10a0a0a0a0a20a1a75a48a1a0a0a0a0.27451a0a1a0a2a1a0a165a1a0a0.686275a0a0.235294a0a1a0a0a0a0.61a0a21a8a29a22a-11a40a1a2a1a0a0a0a158a0a0a0a0a0a0a0a0a0a0a0a0a0a0", nullptr, false);
42-
// particleTop1->setPosition({ supportSpr->getContentWidth() * .25f, supportSpr->getContentHeight() / 2 });
43-
// particleTop1->setZOrder(1);
44-
// particleTop1->setScaleX(.91f);
45-
// particleTop1->setScaleY(.91f);
46-
// particleTop1->setOpacity(105);
47-
// supportSpr->addChild(particleTop1);
48-
49-
// auto particleTop2 = GameToolbox::particleFromString("5a-1a2a0.33a15a-90a180a0a0a59a0a0a-10a0a0a0a0a20a1a75a48a1a0a0a0a0.27451a0a1a0a2a1a0a165a1a0a0.686275a0a0.235294a0a1a0a0a0a0.61a0a21a8a29a22a-11a40a1a2a1a0a0a0a158a0a0a0a0a0a0a0a0a0a0a0a0a0a0", nullptr, false);
50-
// particleTop2->setPosition({ supportSpr->getContentWidth() * .75f, supportSpr->getContentHeight() / 2 });
51-
// particleTop2->setZOrder(1);
52-
// particleTop2->setScaleX(.91f);
53-
// particleTop2->setScaleY(.91f);
54-
// particleTop2->setOpacity(105);
55-
// supportSpr->addChild(particleTop2);
56-
57-
supportSpr->setScale(.8f);
58-
supportSpr->runAction(CCRepeat::create(
59-
CCSequence::create(
60-
CCEaseInOut::create(CCScaleTo::create(1.5f, .7f), 4.f),
61-
CCEaseInOut::create(CCScaleTo::create(1.5f, .8f), 4.f),
62-
nullptr
63-
),
64-
1000
65-
));
66-
67-
auto supportBtn = CCMenuItemSpriteExtra::create(
68-
supportSpr, this, menu_selector(AboutBEPauseLayer::onSupport)
69-
);
70-
supportBtn->setID("support-be-btn"_spr);
71-
topMenu->addChild(supportBtn);
72-
topMenu->updateLayout();
73-
}
74-
}
75-
7616
auto menu = this->getChildByID("guidelines-menu");
7717

7818
auto spr = CCSprite::createWithSpriteFrameName("be-button.png"_spr);
@@ -134,9 +74,6 @@ class $modify(AboutBEPauseLayer, EditorPauseLayer) {
13474
));
13575
}
13676

137-
void onSupport(CCObject*) {
138-
SupportPopup::create(true)->show();
139-
}
14077
void onAbout(CCObject*) {
14178
AboutBEPopup::create()->show();
14279
}

src/features/about/AboutBEPopup.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "AboutBEPopup.hpp"
22
#include "ChangelogPopup.hpp"
3-
#include "SupportPopup.hpp"
43
#include <Geode/ui/GeodeUI.hpp>
54
#include <Geode/ui/MDTextArea.hpp>
65
#include <Geode/binding/ButtonSprite.hpp>
@@ -9,6 +8,7 @@
98

109
#ifdef BETTEREDIT_PRO
1110
#include <pro/features/supporters/SupportersPopup.hpp>
11+
#include <pro/features/supporters/ActivateLicensePopup.hpp>
1212
#endif
1313

1414
struct Dev {
@@ -208,8 +208,25 @@ void AboutBEPopup::onClose(CCObject* sender) {
208208
}
209209

210210
void AboutBEPopup::onSupport(CCObject*) {
211-
SupportPopup::create(false)->show();
212-
// openSupportPopup(Mod::get());
211+
#ifdef BETTEREDIT_PRO
212+
createQuickPopup(
213+
"Support BetterEdit",
214+
"The <cp>Supporter Perks</c> for BetterEdit are <co>about to be "
215+
"discontinued</c> as my financial situation has gotten better and "
216+
"<cj>I don't want to paywall features</c>. If you still want to support the mod "
217+
"and donate a thank you, feel free to do so, but be aware that the only "
218+
"perk I can offer is your name in the Supporters List!",
219+
"OK", "Activate Existing License",
220+
380,
221+
[](auto, bool btn2) {
222+
if (btn2) {
223+
ActivateLicensePopup::tryShowIfLoggedIn();
224+
}
225+
}
226+
);
227+
#else
228+
openSupportPopup(Mod::get());
229+
#endif
213230
}
214231
void AboutBEPopup::onSupporters(CCObject*) {
215232
#ifdef BETTEREDIT_PRO

src/features/about/ChangelogPopup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <Geode/ui/MDTextArea.hpp>
44

55
static std::string parseChangelog(std::optional<VersionInfo> const& since) {
6-
auto changelog = Mod::get()->getMetadata().getChangelog().value_or(std::string());
6+
auto changelog = Mod::get()->getMetadataRef().getChangelog().value_or(std::string());
77
auto res = std::string();
88

99
bool validHeader = false;

0 commit comments

Comments
 (0)