Example #1
0
    // What to do when 'clicked':
    public boolean activate(boolean button) {
      if (!button) return false;
      // Want to toggle it.

      boolean prot = !actor.isCombatProtected();
      setPushed(prot);
      parent.paint();
      actor.setCombatProtected(prot);
      if (!prot) // Toggled off?
      return true;
      // On?  Got to turn off others.
      Actor party[] = new Actor[9];
      // Get entire party, including Avatar.
      gwin.getParty(party, true);
      for (Actor a : party) {
        if (a != null && a != actor && a.isCombatProtected()) a.setCombatProtected(false);
        // +++++Should also update gumps.
      }
      return true;
    }