@@ -1958,6 +1958,7 @@ SaberFett263Buttons() : PropBase() {}
1958
1958
CheckEvent ();
1959
1959
#endif
1960
1960
EditColor ();
1961
+ FreeWavplayerIfPossible ();
1961
1962
if (SaberBase::IsOn ()) {
1962
1963
DetectSwing ();
1963
1964
#ifdef FETT263_SAVE_CHOREOGRAPHY
@@ -2146,6 +2147,13 @@ SaberFett263Buttons() : PropBase() {}
2146
2147
}
2147
2148
}
2148
2149
2150
+ void FreeWavplayerIfPossible () {
2151
+ if (!wav_player) return ;
2152
+ if (menu_) return ;
2153
+ if (wav_player->isPlaying ()) return ;
2154
+ wav_player.Free ();
2155
+ }
2156
+
2149
2157
void SelectPreset (int preset) {
2150
2158
#ifdef SAVE_PRESET
2151
2159
SaveState (preset);
@@ -4459,7 +4467,7 @@ SaberFett263Buttons() : PropBase() {}
4459
4467
}
4460
4468
menu_type_ = MENU_TOP;
4461
4469
menu_ = false ;
4462
- twist_menu_ = M_PI / 2 ;
4470
+ twist_menu_ = M_PI / 2.2 ;
4463
4471
wav_player.Free ();
4464
4472
}
4465
4473
@@ -4640,7 +4648,6 @@ SaberFett263Buttons() : PropBase() {}
4640
4648
}
4641
4649
4642
4650
void DoIgnition () {
4643
- wav_player.Free ();
4644
4651
#ifdef FETT263_DUAL_MODE_SOUND
4645
4652
SelectIgnitionSound ();
4646
4653
#endif
@@ -5852,13 +5859,14 @@ SaberFett263Buttons() : PropBase() {}
5852
5859
return true ;
5853
5860
5854
5861
case EVENTID (BUTTON_NONE, EVENT_TWIST_RIGHT, MODE_ON | BUTTON_POWER):
5855
- if (wav_player && wav_player->isPlaying ()) {
5856
- current_menu_angle_ = fusor.angle2 ();
5857
- return false ;
5858
- }
5859
5862
if (menu_) {
5860
- MenuDialIncrement (1 );
5861
- return true ;
5863
+ if (wav_player && wav_player->isPlaying ()) {
5864
+ current_menu_angle_ = fusor.angle2 ();
5865
+ return false ;
5866
+ } else {
5867
+ MenuDialIncrement (1 );
5868
+ return true ;
5869
+ }
5862
5870
}
5863
5871
if (swinging_) {
5864
5872
return false ;
@@ -5880,13 +5888,14 @@ SaberFett263Buttons() : PropBase() {}
5880
5888
return false ;
5881
5889
5882
5890
case EVENTID (BUTTON_NONE, EVENT_TWIST_LEFT, MODE_ON | BUTTON_POWER):
5883
- if (wav_player && wav_player->isPlaying ()) {
5884
- current_menu_angle_ = fusor.angle2 ();
5885
- return false ;
5886
- }
5887
5891
if (menu_) {
5888
- MenuDialIncrement (-1 );
5889
- return true ;
5892
+ if (wav_player && wav_player->isPlaying ()) {
5893
+ current_menu_angle_ = fusor.angle2 ();
5894
+ return false ;
5895
+ } else {
5896
+ MenuDialIncrement (-1 );
5897
+ return true ;
5898
+ }
5890
5899
}
5891
5900
if (swinging_) {
5892
5901
return false ;
@@ -6099,7 +6108,6 @@ SaberFett263Buttons() : PropBase() {}
6099
6108
#ifdef FETT263_DUAL_MODE_SOUND
6100
6109
SelectIgnitionSound ();
6101
6110
#endif
6102
- wav_player.Free ();
6103
6111
if (SFX_preon) {
6104
6112
#ifdef FETT263_DUAL_MODE_SOUND
6105
6113
SelectPreonSound ();
@@ -6121,7 +6129,6 @@ SaberFett263Buttons() : PropBase() {}
6121
6129
#ifdef FETT263_DUAL_MODE_SOUND
6122
6130
SelectIgnitionSound ();
6123
6131
#endif
6124
- wav_player.Free ();
6125
6132
FastOn ();
6126
6133
#ifndef FETT263_SWING_ON_NO_BM
6127
6134
battle_mode_ = true ;
@@ -6178,7 +6185,6 @@ SaberFett263Buttons() : PropBase() {}
6178
6185
#ifdef FETT263_DUAL_MODE_SOUND
6179
6186
SelectIgnitionSound ();
6180
6187
#endif
6181
- wav_player.Free ();
6182
6188
if (SFX_preon) {
6183
6189
#ifdef FETT263_DUAL_MODE_SOUND
6184
6190
SelectPreonSound ();
@@ -6202,7 +6208,6 @@ SaberFett263Buttons() : PropBase() {}
6202
6208
#ifdef FETT263_DUAL_MODE_SOUND
6203
6209
SelectIgnitionSound ();
6204
6210
#endif
6205
- wav_player.Free ();
6206
6211
FastOn ();
6207
6212
#ifndef FETT263_TWIST_ON_NO_BM
6208
6213
battle_mode_ = true ;
@@ -6219,7 +6224,6 @@ SaberFett263Buttons() : PropBase() {}
6219
6224
#ifdef FETT263_DUAL_MODE_SOUND
6220
6225
SelectIgnitionSound ();
6221
6226
#endif
6222
- wav_player.Free ();
6223
6227
if (SFX_preon) {
6224
6228
#ifdef FETT263_DUAL_MODE_SOUND
6225
6229
SelectPreonSound ();
@@ -6241,7 +6245,6 @@ SaberFett263Buttons() : PropBase() {}
6241
6245
#ifdef FETT263_DUAL_MODE_SOUND
6242
6246
SelectIgnitionSound ();
6243
6247
#endif
6244
- wav_player.Free ();
6245
6248
FastOn ();
6246
6249
#ifndef FETT263_STAB_ON_NO_BM
6247
6250
battle_mode_ = true ;
@@ -6258,7 +6261,6 @@ SaberFett263Buttons() : PropBase() {}
6258
6261
#ifdef FETT263_DUAL_MODE_SOUND
6259
6262
SelectIgnitionSound ();
6260
6263
#endif
6261
- wav_player.Free ();
6262
6264
if (SFX_preon) {
6263
6265
#ifdef FETT263_DUAL_MODE_SOUND
6264
6266
SelectPreonSound ();
@@ -6280,7 +6282,6 @@ SaberFett263Buttons() : PropBase() {}
6280
6282
#ifdef FETT263_DUAL_MODE_SOUND
6281
6283
SelectIgnitionSound ();
6282
6284
#endif
6283
- wav_player.Free ();
6284
6285
FastOn ();
6285
6286
#ifndef FETT263_THRUST_ON_NO_BM
6286
6287
battle_mode_ = true ;
@@ -6460,7 +6461,7 @@ SaberFett263Buttons() : PropBase() {}
6460
6461
int sub_dial_; // Sub menu dial "tick"
6461
6462
int arg_dial_; // Argument Sub menu dial "tick"
6462
6463
int gesture_num_;
6463
- float twist_menu_ = M_PI / 2 ; // default Twist Right / Left sensitivity
6464
+ float twist_menu_ = M_PI / 2.2 ; // default Twist Right / Left sensitivity
6464
6465
bool choice_ = false ;
6465
6466
// Edit Mode selection confirmation
6466
6467
// for True/False control when deleting, disabling/enabling or copying
0 commit comments