verveplay

scrControls

Sep 16th, 2021
708
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///scrControls(type)
  2.  
  3. switch(type)
  4. {
  5.     case "loadKeyboardConfig":
  6.         global.leftButton[0] = ini_read_real("Controls",        "Left",         vk_left);
  7.         global.rightButton[0] = ini_read_real("Controls",       "Right",        vk_right);
  8.         global.upButton[0] = ini_read_real("Controls",          "Up",           vk_up);
  9.         global.downButton[0] = ini_read_real("Controls",        "Down",         vk_down);
  10.         global.jumpButton[0] = ini_read_real("Controls",        "Jump",         vk_shift);
  11.         global.shootButton[0] = ini_read_real("Controls",       "Shoot",        ord("Z"));
  12.         global.restartButton[0] = ini_read_real("Controls",     "Restart",      ord("R"));
  13.         global.skipButton[0] = ini_read_real("Controls",        "Skip",         ord("S"));
  14.         global.suicideButton[0] = ini_read_real("Controls",     "Suicide",      ord("Q"));
  15.         global.pauseButton[0] = ini_read_real("Controls",       "Pause",        ord("P"));
  16.         global.alignLeftButton[0] = ini_read_real("Controls",   "Align_left",   ord("A"));
  17.         global.alignRightButton[0] = ini_read_real("Controls",  "Align_right",  ord("D"));
  18.         break;
  19.        
  20.     case "loadControllerConfig":
  21.         global.controllerIndex = ini_read_real("Controller",        "Index",        -1); //-1 means no controller
  22.         global.leftButton[1] = ini_read_real("Controller",          "Left",         gp_padl);
  23.         global.rightButton[1] = ini_read_real("Controller",         "Right",        gp_padr);
  24.         global.upButton[1] = ini_read_real("Controller",            "Up",           gp_padu);
  25.         global.downButton[1] = ini_read_real("Controller",          "Down",         gp_padd);
  26.         global.jumpButton[1] = ini_read_real("Controller",          "Jump",         gp_face1);
  27.         global.shootButton[1] = ini_read_real("Controller",         "Shoot",        gp_face3);
  28.         global.restartButton[1] = ini_read_real("Controller",       "Restart",      gp_face4);
  29.         global.skipButton[1] = ini_read_real("Controller",          "Skip",         gp_face2);
  30.         global.suicideButton[1] = ini_read_real("Controller",       "Suicide",      gp_select);
  31.         global.pauseButton[1] = ini_read_real("Controller",         "Pause",        gp_start);
  32.         global.alignLeftButton[1] = ini_read_real("Controller",     "Align_left",   gp_shoulderl);
  33.         global.alignRightButton[1] = ini_read_real("Controller",    "Align_right",  gp_shoulderr);
  34.         break;
  35.        
  36.     case "getKeyboardNameArray":
  37.         var buttonName;
  38.         buttonName[0] = "Left Button";
  39.         buttonName[1] = "Right Button";
  40.         buttonName[2] = "Up Button";
  41.         buttonName[3] = "Down Button";
  42.         buttonName[4] = "Jump Button";
  43.         buttonName[5] = "Shoot Button";
  44.         buttonName[6] = "Restart Button";
  45.         buttonName[7] = "Skip Button";
  46.         buttonName[8] = "Suicide Button";
  47.         buttonName[9] = "Pause Button";
  48.         return buttonName;
  49.        
  50.     case "getControllerNameArray":
  51.         var buttonName;
  52.         buttonName[0] = "Controller Index";
  53.         buttonName[1] = "Left Button";
  54.         buttonName[2] = "Right Button";
  55.         buttonName[3] = "Up Button";
  56.         buttonName[4] = "Down Button";
  57.         buttonName[5] = "Jump Button";
  58.         buttonName[6] = "Shoot Button";
  59.         buttonName[7] = "Restart Button";
  60.         buttonName[8] = "Skip Button";
  61.         buttonName[9] = "Suicide Button";
  62.         buttonName[10] = "Pause Button";
  63.         return buttonName;
  64.        
  65.     case "getKeyboardBindArray":
  66.         var bindName;
  67.         bindName[0] = scrGetKeybind(global.leftButton[0]);
  68.         bindName[1] = scrGetKeybind(global.rightButton[0]);
  69.         bindName[2] = scrGetKeybind(global.upButton[0]);
  70.         bindName[3] = scrGetKeybind(global.downButton[0]);
  71.         bindName[4] = scrGetKeybind(global.jumpButton[0]);
  72.         bindName[5] = scrGetKeybind(global.shootButton[0]);
  73.         bindName[6] = scrGetKeybind(global.restartButton[0]);
  74.         bindName[7] = scrGetKeybind(global.skipButton[0]);
  75.         bindName[8] = scrGetKeybind(global.suicideButton[0]);
  76.         bindName[9] = scrGetKeybind(global.pauseButton[0]);
  77.         return bindName;
  78.        
  79.     case "getControllerBindArray":
  80.         var bindName;
  81.         bindName[0] = string(global.controllerIndex);
  82.         bindName[1] = scrGetControllerBind(global.leftButton[1]);
  83.         bindName[2] = scrGetControllerBind(global.rightButton[1]);
  84.         bindName[3] = scrGetControllerBind(global.upButton[1]);
  85.         bindName[4] = scrGetControllerBind(global.downButton[1]);
  86.         bindName[5] = scrGetControllerBind(global.jumpButton[1]);
  87.         bindName[6] = scrGetControllerBind(global.shootButton[1]);
  88.         bindName[7] = scrGetControllerBind(global.restartButton[1]);
  89.         bindName[8] = scrGetControllerBind(global.skipButton[1]);
  90.         bindName[9] = scrGetControllerBind(global.suicideButton[1]);
  91.         bindName[10] = scrGetControllerBind(global.pauseButton[1]);
  92.         return bindName;
  93.        
  94.     case "setKeyboardBind":
  95.         if (select == 0)      {global.leftButton[0] = newKey;}
  96.         else if (select == 1) {global.rightButton[0] = newKey;}
  97.         else if (select == 2) {global.upButton[0] = newKey;}
  98.         else if (select == 3) {global.downButton[0] = newKey;}
  99.         else if (select == 4) {global.jumpButton[0] = newKey;}
  100.         else if (select == 5) {global.shootButton[0] = newKey;}
  101.         else if (select == 6) {global.restartButton[0] = newKey;}
  102.         else if (select == 7) {global.skipButton[0] = newKey;}
  103.         else if (select == 8) {global.suicideButton[0] = newKey;}
  104.         else if (select == 9) {global.pauseButton[0] = newKey;}
  105.         break;
  106.        
  107.     case "setControllerBind":
  108.         if (select == 1)       {global.leftButton[1] = newButton;}
  109.         else if (select == 2)  {global.rightButton[1] = newButton;}
  110.         else if (select == 3)  {global.upButton[1] = newButton;}
  111.         else if (select == 4)  {global.downButton[1] = newButton;}
  112.         else if (select == 5)  {global.jumpButton[1] = newButton;}
  113.         else if (select == 6)  {global.shootButton[1] = newButton;}
  114.         else if (select == 7)  {global.restartButton[1] = newButton;}
  115.         else if (select == 8)  {global.skipButton[1] = newButton;}
  116.         else if (select == 9)  {global.suicideButton[1] = newButton;}
  117.         else if (select == 10) {global.pauseButton[1] = newButton;}
  118.         break;
  119.        
  120.     case "setKeyboardDefault":
  121.         global.leftButton[0] = vk_left;
  122.         global.rightButton[0] = vk_right;
  123.         global.upButton[0] = vk_up;
  124.         global.downButton[0] = vk_down;
  125.         global.jumpButton[0] = vk_shift;
  126.         global.shootButton[0] = ord("Z");
  127.         global.restartButton[0] = ord("R");
  128.         global.skipButton[0] = ord("S");
  129.         global.suicideButton[0] = ord("Q");
  130.         global.pauseButton[0] = ord("P");
  131.         break;
  132.        
  133.     case "setControllerDefault":
  134.         global.leftButton[1] = gp_padl;
  135.         global.rightButton[1] = gp_padr;
  136.         global.upButton[1] = gp_padu;
  137.         global.downButton[1] = gp_padd;
  138.         global.jumpButton[1] = gp_face1;
  139.         global.shootButton[1] = gp_face3;
  140.         global.restartButton[1] = gp_face4;
  141.         global.skipButton[1] = gp_face2;
  142.         global.suicideButton[1] = gp_select;
  143.         global.pauseButton[1] = gp_start;
  144.         break;
  145. }
RAW Paste Data