Skip to content

Commit

Permalink
update changelog & indicators in viewtab
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Dec 2, 2024
1 parent e5ab696 commit d621550
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# BetterEdit 6

## v6.10.0-alpha.2
* <cj>Trigger Indicators</c> are now the same color as the targeting triggers & now show Center Groups
* Some minor visual fixes (thank you to Alphalaneous!)

## 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)
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "4.0.1",
"version": "6.10.0-alpha.1",
"version": "6.10.0-alpha.2",
"gd": {
"win": "2.2074",
"mac": "2.2074",
Expand Down
19 changes: 14 additions & 5 deletions src/features/ViewTab/ViewTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,21 @@ struct $modify(ViewTabUI, EditorUI) {
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"));
auto indAllToggle = this->createViewToggleMSV("v_indicators_all.png"_spr, "show-all-trigger-indicators");
auto indToggle = this->createViewToggleMSV(
"v_indicators.png"_spr, "show-trigger-indicators", be::isProEnabled(),
[indAllToggle](bool enabled) {
be::enableToggle(indAllToggle, enabled);
}
);
btns->addObject(indToggle);
btns->addObject(indAllToggle);

// todo: add popup explaining why they're not available
if (!be::isProEnabled()) {
be::enableToggle(indToggle, false);
be::enableToggle(indAllToggle, false);
}
// 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
15 changes: 15 additions & 0 deletions src/utils/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,18 @@ void be::tintObject(GameObject* obj, std::optional<ccColor3B> const& color) {
lel->m_fields->tinted.erase(obj);
}
}

void be::enableButton(CCMenuItemSpriteExtra* btn, bool enabled) {
btn->setEnabled(enabled);
if (auto spr = typeinfo_cast<CCRGBAProtocol*>(btn->getNormalImage())) {
spr->setCascadeColorEnabled(true);
spr->setCascadeOpacityEnabled(true);
spr->setColor(enabled ? ccWHITE : ccGRAY);
spr->setOpacity(enabled ? 255 : 200);
}
}
void be::enableToggle(CCMenuItemToggler* toggle, bool enabled) {
toggle->setEnabled(enabled);
be::enableButton(toggle->m_onButton, enabled);
be::enableButton(toggle->m_offButton, enabled);
}
3 changes: 3 additions & 0 deletions src/utils/Editor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ namespace be {
* Color an object like selecting (without changing its actual color)
*/
void tintObject(GameObject* obj, std::optional<ccColor3B> const& color);

void enableButton(CCMenuItemSpriteExtra* btn, bool enabled);
void enableToggle(CCMenuItemToggler* toggle, bool enabled);
}

//// More EditCommand options
Expand Down

0 comments on commit d621550

Please sign in to comment.