Prop Feature Migration: DIY?

I was reading through the new props in 8.1 and see the results of @Sabersense 's work. Amazing!

The clicking feature sounds like a great solution to sabers that suffer from squishy buttons (they look so good, though :slight_smile:)

The saber I’m taking about relies on the Fett263 prop. Can I move the Sabersense click feature into Fett’s prop? I feel like there’d be an issue with defines. I’ll certainly try if it’s possible!

1 Like

Not familiar, what is it you’re wanting? I’m currently updating my prop for OS8 so I can probably add the option in via a define.

#define SABERSENSE_BUTTON_CLICKER
Button Clicker to play press/release wav files when
buttons are pressed. Intended for Scavenger hilt
where wheel makes tactile feel difficult.
Requires press.wav and release.wav files to work.

void PlaySound(const char* sound) {
  RefPtr<BufferedWavPlayer> player = GetFreeWavPlayer();
  if (player) {
    if (!player->PlayInCurrentDir(sound)) player->Play(sound);
  }
}

bool Event2(enum BUTTON button, EVENT event, uint32_t modifiers) override {
  if (GetWavPlayerPlaying(&SFX_boot)) return false;
  switch (EVENTID(button, event, modifiers)) {
    case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_OFF):
    case EVENTID(BUTTON_AUX, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_AUX, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_OFF):
      SaberBase::RequestMotion();
#ifdef SABERSENSE_BUTTON_CLICKER
      // Intended to play click sound on button presses, primarily for Scavenger 
      // hilt where wheel makes tactile switch feel difficult.
      PlaySound("press.wav");  // Requires press.wav file to work.
#endif
      return false;
    case EVENTID(BUTTON_POWER, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_POWER, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_OFF):
    case EVENTID(BUTTON_AUX, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_AUX, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_OFF):
#ifdef SABERSENSE_BUTTON_CLICKER
      PlaySound("release.wav");  // Requires release.wav file to work.
#endif
....................

In the saber sense prop:

#define SABERSENSE_BUTTON_CLICKER
  Button Clicker to play press/release wav files when
  buttons are pressed. Intended for Scavenger hilt
  where wheel makes tactile feel difficult.
  Requires press.wav and release.wav files to work.

I first saw it here in the OS8 beta thread:

Not sure where to begin and end, but in prop I see:

bool Event2(enum BUTTON button, EVENT event, uint32_t modifiers) override {
  if (GetWavPlayerPlaying(&SFX_boot)) return false;
  switch (EVENTID(button, event, modifiers)) {
    case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_POWER, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_OFF):
    case EVENTID(BUTTON_AUX, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_AUX, EVENT_PRESSED, MODE_ANY_BUTTON | MODE_OFF):
      SaberBase::RequestMotion();
#ifdef SABERSENSE_BUTTON_CLICKER
      // Intended to play click sound on button presses, primarily for Scavenger 
      // hilt where wheel makes tactile switch feel difficult.
      PlaySound("press.wav");  // Requires press.wav file to work.
#endif
      return false;
    case EVENTID(BUTTON_POWER, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_POWER, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_OFF):
    case EVENTID(BUTTON_AUX, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_ON):
    case EVENTID(BUTTON_AUX, EVENT_RELEASED, MODE_ANY_BUTTON | MODE_OFF):
#ifdef SABERSENSE_BUTTON_CLICKER
      PlaySound("release.wav");  // Requires release.wav file to work.
#endif
      if (SaberBase::Lockup()) {
        SaberBase::DoEndLockup();
        SaberBase::SetLockup(SaberBase::LOCKUP_NONE);
        return true;
      } else {
        return false;
      }

That would be most excellent of you if possible.

If you need click effects, there are some sound file downloads on my website that include them:

:slight_smile:

1 Like

Thanks, seems straightforward enough, I have a queue of OS8 additions to work through but should be able to implement.

1 Like