예제 #1
0
 public void Click() {
   switch (type) {
     case BB_Add:
       mapper.addbind = true;
       SetActiveBind(null);
       change_action_text("Press a key/joystick button or move the joystick.", CLR_RED);
       break;
     case BB_Del:
       if (mapper.abindit != mapper.aevent.bindlist.size()) {
         mapper.aevent.bindlist.remove(mapper.abindit).destroy();
         if (mapper.abindit == mapper.aevent.bindlist.size()) mapper.abindit = 0;
       }
       if (mapper.abindit != mapper.aevent.bindlist.size())
         SetActiveBind(mapper.aevent.bindlist.elementAt(mapper.abindit));
       else SetActiveBind(null);
       break;
     case BB_Next:
       if (mapper.abindit != mapper.aevent.bindlist.size()) mapper.abindit++;
       if (mapper.abindit == mapper.aevent.bindlist.size()) mapper.abindit = 0;
       SetActiveBind(mapper.aevent.bindlist.elementAt(mapper.abindit));
       break;
     case BB_Save:
       MAPPER_SaveBinds();
       break;
     case BB_Exit:
       mapper.exit = true;
       break;
   }
 }
예제 #2
0
 static void SetActiveEvent(CEvent event) {
   mapper.aevent = event;
   mapper.redraw = true;
   mapper.addbind = false;
   bind_but.event_title.Change("EVENT:" + ((event != null) ? event.GetName() : "none"), null);
   if (event == null) {
     change_action_text("Select an event to change.", CLR_WHITE);
     bind_but.add.Enable(false);
     SetActiveBind(null);
   } else {
     change_action_text("Select a different event or hit the Add/Del/Next buttons.", CLR_WHITE);
     mapper.abindit = 0;
     if (mapper.abindit != event.bindlist.size()) {
       SetActiveBind(event.bindlist.elementAt(mapper.abindit));
     } else SetActiveBind(null);
     bind_but.add.Enable(true);
   }
 }
예제 #3
0
 public void Click() {
   switch (type) {
     case BC_Mod1:
       mapper.abind.mods ^= BMOD_Mod1;
       break;
     case BC_Mod2:
       mapper.abind.mods ^= BMOD_Mod2;
       break;
     case BC_Mod3:
       mapper.abind.mods ^= BMOD_Mod3;
       break;
     case BC_Hold:
       mapper.abind.flags ^= BFLG_Hold;
       break;
   }
   mapper.redraw = true;
 }
예제 #4
0
 private static void SetActiveBind(CBind _bind) {
   mapper.abind = _bind;
   if (_bind != null) {
     bind_but.bind_title.Enable(true);
     bind_but.bind_title.Change("BIND:" + _bind.BindName(), null);
     bind_but.del.Enable(true);
     bind_but.next.Enable(true);
     bind_but.mod1.Enable(true);
     bind_but.mod2.Enable(true);
     bind_but.mod3.Enable(true);
     bind_but.hold.Enable(true);
   } else {
     bind_but.bind_title.Enable(false);
     bind_but.del.Enable(false);
     bind_but.next.Enable(false);
     bind_but.mod1.Enable(false);
     bind_but.mod2.Enable(false);
     bind_but.mod3.Enable(false);
     bind_but.hold.Enable(false);
   }
 }
예제 #5
0
 public void Change(String format, Object[] args) {
   caption = StringHelper.sprintf(format, args);
   mapper.redraw = true;
 }
예제 #6
0
 public void Active(boolean yesno) {
   if (yesno) mapper.mods |= (1 << (wmod - 1));
   else mapper.mods &= ~(1 << (wmod - 1));
 }