OBSOLETE ~Implemented in TABS > Change EA Sim GUI Elements positions

Get back the disable unit button to old position.

  1. // ==UserScript==
  2. // @name OBSOLETE ~Implemented in TABS > Change EA Sim GUI Elements positions
  3. // @description Get back the disable unit button to old position.
  4. // @author VisiG
  5. // @version 0.41
  6. // @namespace https://prodgame*.alliances.commandandconquer.com/*/index.aspx*
  7. // @include https://prodgame*.alliances.commandandconquer.com/*/index.aspx*
  8. // ==/UserScript==
  9.  
  10. (function () {
  11. var EASimGUIChanger_main = function () {
  12. function EASimGUIChanger_checkIfLoaded() {
  13. if (PerforceChangelist >= 443425) { // patch 16.1
  14. try {
  15. if (typeof qx !== 'undefined' && typeof qx.core !== 'undefined' && typeof qx.core.Init !== 'undefined') {
  16. try {
  17. app = qx.core.Init.getApplication();
  18. rightGUIBar = app.getRightBar();
  19. ArmySetupAttackBar = app.getArmySetupAttackBar();
  20. rightAttackBar = ArmySetupAttackBar.getChildren()[2].getChildren()[1].getChildren()[8];
  21. EASimAttackBar = ArmySetupAttackBar.getChildren()[0].getChildren()[1];
  22. if(PerforceChangelist >= 448942) { // patch 16.2
  23. unitDisableButton = EASimAttackBar.getChildren()[11];
  24. }
  25. else
  26. {
  27. unitDisableButton = EASimAttackBar.getChildren()[8]; // enable disable button
  28. }
  29. playButton = ArmySetupAttackBar.getChildren()[2].getChildren()[1].getChildren()[8].getChildren()[1];
  30. if(rightGUIBar === null || rightAttackBar === null || unitDisableButton === null || playButton === null)
  31. {
  32. window.setTimeout(EASimGUIChanger_checkIfLoaded, 1000);
  33. }
  34. else
  35. {
  36. //rightGUIBar.removeAt(3); // removes the ea stats bar
  37. rightAttackBar.removeAt(1);
  38. //ArmySetupAttackBar.getChildren()[2].getChildren()[1].getChildren()[8].getChildren()[1]; // play button
  39. rightAttackBar.addAt(unitDisableButton, 1);
  40. if(PerforceChangelist >= 448942) { // patch 16.2
  41. EASimAttackBar.addAt(playButton, 7);
  42. }
  43. else
  44. {
  45. EASimAttackBar.addAt(playButton, 8);
  46. }
  47. }
  48. } catch (e) {
  49. window.setTimeout(EASimGUIChanger_checkIfLoaded, 1000);
  50. }
  51. } else {
  52. window.setTimeout(EASimGUIChanger_checkIfLoaded, 1000);
  53. }
  54. } catch (e) {
  55. console.log("EASimGUIChanger_checkIfLoaded: ", e);
  56. }
  57. }
  58. }
  59.  
  60. if (/commandandconquer\.com/i.test(document.domain)) {
  61. window.setTimeout(EASimGUIChanger_checkIfLoaded, 1000);
  62. }
  63. }
  64. try {
  65. var script = document.createElement("script");
  66. script.innerHTML = "(" + EASimGUIChanger_main.toString() + ")();";
  67. script.type = "text/javascript";
  68. document.getElementsByTagName("head")[0].appendChild(script);
  69. } catch (e) {
  70. console.log("EASimGUIChanger: init error: ", e);
  71. }
  72. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址