Skip to content

Commit

Permalink
trigger indicators + metadata changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Nov 30, 2024
1 parent ed3717a commit 8e3c7a5
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: Windows
os: windows-latest

# - name: Android32
# os: ubuntu-latest
# target: Android32
- name: Android32
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# BetterEdit 6

## v6.10.0
* Add <cj>Trigger Indicators</c>
## v6.10.0-alpha.1
* Add <cj>Trigger Indicators</c> (toggleable in <cc>View Tab</c>)
* Make Alpha's mods only Suggested instead of Recommended (so they aren't auto-installed)

## v6.9.2
* Remove limits from <ca>Z Order</c>
Expand Down
10 changes: 5 additions & 5 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "4.0.1",
"version": "6.10.0",
"version": "6.10.0-alpha.1",
"gd": {
"win": "2.2074",
"mac": "2.2074",
Expand Down Expand Up @@ -44,22 +44,22 @@
{
"id": "hjfod.backups",
"version": "1.0.0",
"importance": "recommended"
"importance": "suggested"
},
{
"id": "alphalaneous.awesome_modifier_icons",
"version": "1.0.3",
"importance": "recommended"
"importance": "suggested"
},
{
"id": "alphalaneous.improvedlink",
"version": "1.0.5",
"importance": "recommended"
"importance": "suggested"
},
{
"id": "alphalaneous.improved_group_view",
"version": "1.0.5",
"importance": "recommended"
"importance": "suggested"
}
],
"resources": {
Expand Down
Binary file added resources/view/v_indicators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/view/v_indicators_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions src/features/ViewTab/ViewTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <geode.custom-keybinds/include/Keybinds.hpp>
#include <utils/Editor.hpp>
#include <utils/HolyUB.hpp>
#include <utils/Pro.hpp>

using namespace geode::prelude;
using namespace keybinds;
Expand Down Expand Up @@ -121,12 +122,15 @@ struct $modify(ViewTabUI, EditorUI) {
}));
return toggler;
}
CCMenuItemToggler* createViewToggleMSV(const char* frame, const char* modSavedValue, std::function<void(bool)> postSet = nullptr) {
CCMenuItemToggler* createViewToggleMSV(
const char* frame, const char* modSavedValue,
bool defaultValue = false, std::function<void(bool)> postSet = nullptr
) {
auto off = createViewToggleSpr(frame, false);
auto on = createViewToggleSpr(frame, true);
auto toggler = CCMenuItemToggler::create(off, on, this, menu_selector(ViewTabUI::onViewToggle));
toggler->setUserObject("getter", CCFunction<bool()>::create([modSavedValue]() {
return Mod::get()->template getSavedValue<bool>(modSavedValue);
toggler->setUserObject("getter", CCFunction<bool()>::create([modSavedValue, defaultValue]() {
return Mod::get()->template getSavedValue<bool>(modSavedValue, defaultValue);
}));
toggler->setUserObject("setter", CCFunction<void(bool)>::create([modSavedValue, postSet](bool enabled) {
Mod::get()->setSavedValue(modSavedValue, enabled);
Expand Down Expand Up @@ -219,7 +223,7 @@ struct $modify(ViewTabUI, EditorUI) {
m_editorLayer->updatePreviewParticles();
}));
btns->addObject(this->createViewToggleGV("v_shaders.png"_spr, "0158"));
btns->addObject(this->createViewToggleMSV("v_ldm.png"_spr, "hide-ldm", [this](bool) {
btns->addObject(this->createViewToggleMSV("v_ldm.png"_spr, "hide-ldm", false, [this](bool) {
for (auto obj : CCArrayExt<GameObjectExtra*>(m_editorLayer->m_objects)) {
obj->updateVisibility();
}
Expand All @@ -243,6 +247,14 @@ struct $modify(ViewTabUI, EditorUI) {
btns->addObject(this->createViewToggleMSV("v_pos_line.png"_spr, "pos-line"));
btns->addObject(this->createViewToggleGV("v_dur_line.png"_spr, "0058"));
btns->addObject(this->createViewToggleGV("v_eff_line.png"_spr, "0043"));

if (be::isProEnabled()) {
btns->addObject(this->createViewToggleMSV("v_indicators.png"_spr, "show-trigger-indicators", true));
// todo: disable this if show-trigger-indicators is disabled
btns->addObject(this->createViewToggleMSV("v_indicators_all.png"_spr, "show-all-trigger-indicators"));
}
// todo: show trigger indicators as disabled for non-pro users

btns->addObject(this->createViewToggleGV("v_ground.png"_spr, "0037", [this](bool enable) {
m_editorLayer->m_groundLayer->setVisible(enable);
}));
Expand Down
4 changes: 4 additions & 0 deletions src/features/about/SupportPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <Geode/binding/ButtonSprite.hpp>
#include <utils/Pro.hpp>

#ifdef BETTEREDIT_PRO
#include <pro/Pro.hpp>
#endif

bool SupportPopup::setup(bool showDontShowAgain) {
m_bgSprite->setVisible(false);

Expand Down
7 changes: 7 additions & 0 deletions src/utils/Pro.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#include "Pro.hpp"

#ifdef BETTEREDIT_PRO
#include <pro/Pro.hpp>
bool be::isProEnabled() {
return HAS_PRO();
}
bool be::isProUIEnabled() {
return pro::isNewUIEnabled();
}
#else
bool be::isProEnabled() {
return false;
}
bool be::isProUIEnabled() {
return false;
}
Expand Down
5 changes: 1 addition & 4 deletions src/utils/Pro.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#pragma once

namespace be {
bool isProEnabled();
bool isProUIEnabled();
}

#ifdef BETTEREDIT_PRO
#include <pro/Pro.hpp>
#endif

0 comments on commit 8e3c7a5

Please sign in to comment.