Skip to content

Commit

Permalink
Handle #define DISABLE_COLOR_CHANGE in menus (profezzorn#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdarosa2663 authored Jan 3, 2022
1 parent 7dd65ff commit 25f3569
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions props/saber_fett263_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,9 @@ SaberFett263Buttons() : PropBase() {}
uses_rgb_arg |= style_parser.UsesArgument(current_preset_.GetStyle(N), 3);
ONCEPERBLADE(USES_RGB_ARG)
if (!uses_rgb_arg) {
#ifndef DISABLE_COLOR_CHANGE
ToggleColorChangeMode();
#endif
} else {
bool handles_color_change;
#define USES_COLOR_CHANGE(N) \
Expand All @@ -1517,7 +1519,9 @@ SaberFett263Buttons() : PropBase() {}
dial_ = -1;
hybrid_font.PlayCommon(&SFX_ccbegin);
} else {
#ifndef DISABLE_COLOR_CHANGE
ToggleColorChangeMode();
#endif
}
}
}
Expand Down Expand Up @@ -2166,10 +2170,12 @@ SaberFett263Buttons() : PropBase() {}

// If Color Zoom mode is active save NewColor and end ShowColor style
bool EndColorZoom() {
#ifndef DISABLE_COLOR_CHANGE
if (SaberBase::GetColorChangeMode() == SaberBase::COLOR_CHANGE_MODE_ZOOMED) {
ToggleColorChangeMode();
return true;
}
#endif
switch(color_mode_) {
case ZOOM_COLOR:
case EDIT_COLOR:
Expand Down Expand Up @@ -2246,10 +2252,12 @@ SaberFett263Buttons() : PropBase() {}
break;
case EDIT_COLORS:
if (style_parser.MaxUsedArgument(current_preset_.GetStyle(1)) == 0) {
#ifndef DISABLE_COLOR_CHANGE
menu_type_ = MENU_COLOR;
sound_library_.SaySelect();
variation_revert_ = SaberBase::GetCurrentVariation();
ToggleColorChangeMode();
#endif
break;
} else {
#if NUM_BLADES == 1
Expand Down Expand Up @@ -3778,8 +3786,10 @@ SaberFett263Buttons() : PropBase() {}
}
case MENU_COLOR:
menu_type_ = MENU_TOP;
#ifndef DISABLE_COLOR_CHANGE
SaberBase::SetVariation(variation_revert_);
ToggleColorChangeMode();
#endif
MenuCancel();
break;
case MENU_COLOR_SUB:
Expand Down Expand Up @@ -4944,11 +4954,13 @@ SaberFett263Buttons() : PropBase() {}
} else {
// Avoid the base and the very tip.
// TODO: Make blast only appear on one blade!
#ifndef DISABLE_COLOR_CHANGE
if (SaberBase::GetColorChangeMode() != SaberBase::COLOR_CHANGE_MODE_NONE) {
SaberBase::SetVariation(0);
ToggleColorChangeMode();
return true;
}
#endif
if (color_mode_ == CC_COLOR_LIST) {
color_mode_ = NONE;
show_color_all_.Stop();
Expand Down

0 comments on commit 25f3569

Please sign in to comment.