Advertisement
dcomicboy

Uninstall Patcher

Jun 21st, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. //frame 1, var's
  2. var _loc3 = classes.GlobalData.getSelectedCarXML();
  3. var acid = _loc3.attributes.i;
  4. var aeid = _loc3.attributes.ae;
  5.  
  6. //Frame 2/Class function
  7.  
  8. function uninstallPartCB(t, c)
  9. {
  10. classes.Frame.serverLights(false);
  11. var _loc6 = new XML();
  12. _loc6.ignoreWhite = true;
  13. _loc6.parseXML(c);
  14. var _loc4 = _loc6.firstChild;
  15. switch (Number(_loc4.attributes.s))
  16. {
  17. case 1:
  18. {
  19. _root.abc.contentMC.gotoAndStop("response");
  20. _root.abc.contentMC.alertIconMC.gotoAndStop("installplus");
  21. _root.abc.contentMC.txtTitle = "Part is Uninstalled";
  22. _root.abc.contentMC.txtMsg = "The part is successfully uninstalled from your car.";
  23. _root.abc.removeButtons();
  24. _root.abc.addButton("OK");
  25. _global.shopPartsMC.uninstallCartPart();
  26. break;
  27. }
  28. case 0:
  29. {
  30. _root.abc.contentMC.gotoAndStop("response");
  31. _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  32. _root.abc.contentMC.txtTitle = "Part is Already Uninstalled";
  33. _root.abc.contentMC.txtMsg = "I\'m sorry, but this part is already uninstalled from your car.";
  34. _root.abc.removeButtons();
  35. _root.abc.addButton("Cancel");
  36. _global.shopPartsMC.clearCart();
  37. break;
  38. }
  39. case -1:
  40. {
  41. var _loc5 = "Error, dependent parts:";
  42. for (var _loc3 = 0; _loc3 < _loc4.childNodes.length; ++_loc3)
  43. {
  44. _loc5 = _loc5 + ("\n" + _loc4.childNodes[_loc3].firstChild.nodeValue);
  45. } // end of for
  46. _root.abc.contentMC.gotoAndStop("response");
  47. _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  48. _root.abc.contentMC.txtTitle = "Part is Required";
  49. _root.abc.contentMC.txtMsg = "I\'m sorry, but this part was required by these parts:" + _loc5;
  50. _root.abc.removeButtons();
  51. _root.abc.addButton("Cancel");
  52. _global.shopPartsMC.clearCart();
  53. break;
  54. }
  55. case -2:
  56. {
  57. _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is impounded.");
  58. break;
  59. }
  60. case -3:
  61. {
  62. _root.abc.contentMC.txtTitle = "Part is Required";
  63. _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be uninstalled.";
  64. _root.abc.removeButtons();
  65. _root.abc.addButton("Cancel");
  66. _global.shopPartsMC.clearCart();
  67. break;
  68. }
  69. case -4:
  70. {
  71. _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is locked.");
  72. break;
  73. }
  74. case -5:
  75. {
  76. _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is not yours.");
  77. break;
  78. }
  79. case -6:
  80. {
  81. _root.markTestDriveExpiredAndDisplayWarning();
  82. break;
  83. }
  84. case -50:
  85. {
  86. _root.abc.contentMC.txtTitle = "Account Locked"; //
  87. _root.abc.contentMC.txtMsg = "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished. This may take moment.";
  88. _root.abc.removeButtons();
  89. _root.abc.addButton("Cancel");
  90. _global.shopPartsMC.clearCart();
  91. break;
  92. }
  93. case -99:
  94. {
  95. _root.abc.contentMC.txtTitle = "Car Not Owned"; //Title of the warning screen
  96. _root.abc.contentMC.txtMsg = "Sorry, you do not own this car, therefore, you can not install the selected part to the selected car." //Message in the warning screen
  97. _root.abc.removeButtons(); //Removes any old buttons
  98. _root.abc.addButton("OK"); //OK Button to close out of the warning.
  99. break;
  100. }
  101. } // End of switch
  102. } // End of the function
  103.  
  104.  
  105. //Eplanation as to why this would work
  106.  
  107. For uninstalling parts to be successful, it needs to go to Case 1 of the function. If you write a case with a warning instead of the server info for installing, its not going to install.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement