Guest User

Untitled

a guest
Dec 10th, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.02 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Sigmally Mod
  3. // @version 1.3
  4. // @description A sigmally Mod
  5. // @author Cursed
  6. // @match *://sigmally.com/*
  7. // @icon https://iili.io/yaKNoB.png
  8. // @grant none
  9. // @run-at document-end
  10. // @license MIT
  11. // @namespace https://greasyfork.org/users/981958
  12. // ==/UserScript==
  13.  
  14. let Cursed__style = `
  15. /*
  16. * Common
  17. */
  18. .text-right {
  19. text-align: right;
  20. }
  21.  
  22. .flex {
  23. display: flex;
  24. justify-content: center;
  25. }
  26.  
  27.  
  28.  
  29. /*
  30. * Element-Specific
  31. */
  32. #rx-mod-settings {
  33. background: linear-gradient(-45deg, #B876FF, #1F2A9E, #B876FF);
  34. background-size: 300% 300%;
  35. padding: 30px;
  36. border-radius: 15px;
  37. width: 350px;
  38. min-height: 300px;
  39. top: 1em;
  40. left: 50%;
  41. margin-left: -175px;
  42. z-index: 99999;
  43. box-shadow: 0 0 15px #000;
  44. position: fixed;
  45. animation: change 5s ease-in-out infinite;
  46. text-align: center;
  47. }
  48.  
  49. @keyframes change{
  50. 0%{
  51. background-position: 0 50%;
  52. }
  53. 50%{
  54. background-position: 100% 50%;
  55. }
  56. 100%{
  57. background-position: 0 50%;
  58. }
  59. }
  60.  
  61. #rx-mod-settings input.keybinding {
  62. max-width: 20px;
  63. border: 1px solid #ccc;
  64. padding: 0;
  65. text-align: center;
  66. margin-right: 5px;
  67. }
  68.  
  69. #rx-mod-settings input[type="radio"] {
  70. margin-right: 5px;
  71. }
  72. #rx-mod-settings input[type="submit"] {
  73. width: 100%;
  74. margin-top: 15px;
  75. }
  76.  
  77. #rx-mod-settings.hidden {
  78. display: none;
  79. }
  80.  
  81. #rx-mod-wrap {
  82. background-color:#000;
  83. color:#fff;
  84. min-height: 25px;
  85. opacity: 0.45;
  86. position: fixed;
  87. top: 0;
  88. left: 0;
  89. width: 100%;
  90. z-index:99998;
  91. transition: .3s;
  92. user-select: none;
  93.  
  94. }
  95.  
  96. #rx-mod-wrap:hover {
  97. opacity: 1;
  98. transition: .3s;
  99. }
  100.  
  101. #rx-mod-wrap button {
  102. cursor: pointer;
  103. color: #333;
  104. }
  105.  
  106. #rx-mod-wrap span.text {
  107. margin-left: 15px;
  108. padding-left: 15px;
  109. border-left: 1px solid #dfdfdf;
  110. }
  111.  
  112. #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
  113. visibility: hidden;
  114. }
  115.  
  116. .CloseBtn{
  117. outline: none;
  118. background-color: #fff;
  119. padding: 10px;
  120. font-size: 16px;
  121. transition: .3s;
  122. position: relative;
  123. background-color: transparent;
  124. color: #fff;
  125. border-radius: 15px;
  126. border: 1px solid #fff;
  127. }
  128.  
  129. .CloseBtn:hover{
  130. background-color: #5865F2;
  131. transition: .3s;
  132. }
  133.  
  134. .SettingsBtn{
  135. background-color: transparent;
  136. }
  137.  
  138. .keybinding{
  139. outline: none;
  140. color: #fff;
  141. background-color: #303030;
  142. border: none;
  143. border-radius: 5px;
  144. font-weight: 500;
  145. }
  146.  
  147. .Sett{
  148. color: #fff;
  149. user-select: none;
  150. font-weight: 500;
  151. }
  152.  
  153. .text{
  154. color: #fff;
  155. font-weight: 500;
  156. user-select: none;
  157. }
  158.  
  159. .titleImg{
  160. width: 100%;
  161. height: 150px;
  162. border-radius: 20px;
  163. margin-bottom: 5px;
  164. }
  165.  
  166. .JoinDc{
  167. background-color: transparent;
  168. width: 75%;
  169. height: 30px;
  170. border: 1px solid #fff;
  171. border-radius: 5px;
  172. color: #fff;
  173. transition: .3s;
  174. }
  175.  
  176. .JoinDc:hover{
  177. background-color: #5865F2;
  178. transition: .3s;
  179. }
  180.  
  181. .StylishNames{
  182. display: flex;
  183. justify-content: space-between;
  184. }
  185.  
  186. .divBtn{
  187. background-color: transparent;
  188. height: 30px;
  189. border: 1px solid #fff;
  190. border-radius: 5px;
  191. color: #fff;
  192. margin: 5px;
  193. transition: .3s;
  194. margin-bottom: 20px;
  195. outline: none;
  196. }
  197.  
  198. .divBtn:hover{
  199. background-color: #5865F2;
  200. transition: .3s;
  201. }
  202.  
  203. .Btn01{
  204. width: 100%;
  205. }
  206.  
  207. .Btn02{
  208. width: 100%;
  209. }
  210.  
  211. `
  212.  
  213. let s = document.createElement('style');
  214. s.type = "text/css"
  215. s.innerHTML = Cursed__style;
  216. (document.head || document.documentElement).appendChild(s);
  217.  
  218. (function() {
  219. const rzModWrap = document.createElement('div');
  220. const rzModSettings = document.createElement('form');
  221. const rzModStyle = document.createElement('link');
  222.  
  223. const KEY_FEED = {
  224. key: 'w',
  225. keyCode: 32,
  226. which: 32
  227. };
  228. const KEY_SPLIT = {
  229. keyCode: 32,
  230. code: 'Space',
  231. cancelable: true,
  232. composed: true,
  233. isTrusted: true,
  234. which: 32
  235. }
  236.  
  237. rzModWrap.setAttribute('id', 'rx-mod-wrap');
  238.  
  239.  
  240.  
  241.  
  242. const Zero_Two = '';
  243.  
  244. /*
  245. * Configure Settings
  246. */
  247.  
  248. let rxSettings = localStorage.getItem('rxSettings');
  249.  
  250. if (!rxSettings){
  251. rxSettings = {
  252. keyBindingsRapidFeed: 'q',
  253. keyBindingsdoubleSplit: 'd',
  254. keyBindingsTripleSplit: 'f',
  255. keyBindingsQuadSplit: 'g',
  256. };
  257. } else {
  258. rxSettings = JSON.parse(rxSettings);
  259. }
  260.  
  261. rzModSettings.setAttribute('id', 'rx-mod-settings');
  262. rzModSettings.classList.add('hidden');
  263. rzModSettings.onsubmit = (e) => {
  264. rzModSettings.classList.toggle('hidden');
  265. e.preventDefault();
  266.  
  267. let options = new FormData(rzModSettings);
  268.  
  269. rxSettings = {};
  270. for (var key of options.keys()) {
  271. rxSettings[key] = options.get(key);
  272. }
  273.  
  274. localStorage.setItem('rxSettings', JSON.stringify(rxSettings));
  275.  
  276. return false;
  277. };
  278. rzModSettings.innerHTML =
  279. '<img src="https://iili.io/yaKNoB.png" class="titleImg">' +
  280. '<h4 class="Sett">Mod Settings</h4>' +
  281. '<hr/>' +
  282. '<h5 class="Sett">Key Mappings</h5>' +
  283. '<label class="flex">' +
  284. '<input type="text" name="keyBindingsRapidFeed" class="keybinding" value="' + rxSettings.keyBindingsRapidFeed + '" maxlength="1" onfocus="this.select()">' +
  285. '<span class="text">Rapid Feed</span>' +
  286. '</label>' +
  287. '<label class="flex">' +
  288. '<input type="text" name="keyBindingsDoubleSplit" class="keybinding" value="' + rxSettings.keyBindingsDoubleSplit + '" maxlength="1" onfocus="this.select()">' +
  289. '<span class="text">Double Split</span>' +
  290. '</label>' +
  291. '<label class="flex">' +
  292. '<input type="text" name="keyBindingsTripleSplit" class="keybinding" value="' + rxSettings.keyBindingsTripleSplit + '" maxlength="1" onfocus="this.select()">' +
  293. '<span class="text">Triple Split</span>' +
  294. '</label>' +
  295. '<label class="flex">' +
  296. '<input type="text" name="keyBindingsQuadSplit" class="keybinding" value="' + rxSettings.keyBindingsQuadSplit + '" maxlength="1" onfocus="this.select()">' +
  297. '<span class="text">Quad Split</span>' +
  298. '</label>' +
  299. '</label>' +
  300. '<hr/>' +
  301.  
  302. '<h4 class="Sett">Discord</h4>' +
  303. '<a href="https://discord.gg/gHmhpCaPfP" target="_blank"><input type="button" value="Join" class="JoinDc"/></a>' +
  304. '<hr/>' +
  305. '<h4 class="Sett">Stylish Names</h4>' +
  306. '<div class="StylishNames"><a href="https://www.stylishnamemaker.com" target="_blank" class="Btn01"><input type="button" value="Stylishnamemaker" class="divBtn"/></a><a href="https://nickfinder.com" target="_blank" class="Btn02"><input type="button" value="Nickfinder" class="divBtn Btn02"/></a></div>' +
  307. '<input type="submit" class="CloseBtn"; value="Save &amp; Close"/>';
  308.  
  309.  
  310. /*
  311. * Mod Collection
  312. *
  313. * Mod Types:
  314. * - Button
  315. * - Automatic
  316. * - Code
  317. * - Text
  318. */
  319. const gameSettings = document.getElementById('settings');
  320. gameSettings.innerHTML = `
  321. <ul class="checkbox-grid">
  322. <li>
  323. <div class="pretty p-svg p-round p-smooth">
  324. <input type="checkbox" id="darkTheme">
  325. <div class="state p-success">
  326. <svg class="svg svg-icon" viewBox="0 0 20 20">
  327. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  328. </svg>
  329. <label>Dark</label>
  330. </div>
  331. </div>
  332. </li>
  333. <li>
  334. <div class="pretty p-svg p-round p-smooth">
  335. <input type="checkbox" id="showMass">
  336. <div class="state p-success">
  337. <svg class="svg svg-icon" viewBox="0 0 20 20">
  338. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  339. </svg>
  340. <label>Mass</label>
  341. </div>
  342. </div>
  343. </li>
  344. <li>
  345. <div class="pretty p-svg p-round p-smooth">
  346. <input type="checkbox" id="showChat">
  347. <div class="state p-success">
  348. <svg class="svg svg-icon" viewBox="0 0 20 20">
  349. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  350. </svg>
  351. <label>Chat</label>
  352. </div>
  353. </div>
  354. </li>
  355. <li>
  356. <div class="pretty p-svg p-round p-smooth">
  357. <input type="checkbox" id="showMinimap">
  358. <div class="state p-success">
  359. <svg class="svg svg-icon" viewBox="0 0 20 20">
  360. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  361. </svg>
  362. <label>Minimap</label>
  363. </div>
  364. </div>
  365. </li>
  366. <li>
  367. <div class="pretty p-svg p-round p-smooth">
  368. <input type="checkbox" id="showBorder">
  369. <div class="state p-success">
  370. <svg class="svg svg-icon" viewBox="0 0 20 20">
  371. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  372. </svg>
  373. <label>Border</label>
  374. </div>
  375. </div>
  376. </li>
  377. <li>
  378. <div class="pretty p-svg p-round p-smooth">
  379. <input type="checkbox" id="showGrid">
  380. <div class="state p-success">
  381. <svg class="svg svg-icon" viewBox="0 0 20 20">
  382. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  383. </svg>
  384. <label>Grid</label>
  385. </div>
  386. </div>
  387. </li>
  388. <li>
  389. <div class="pretty p-svg p-round p-smooth">
  390. <input type="checkbox" id="moreZoom">
  391. <div class="state p-success">
  392. <svg class="svg svg-icon" viewBox="0 0 20 20">
  393. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  394. </svg>
  395. <label>Zoomout</label>
  396. </div>
  397. </div>
  398. </li>
  399. <li>
  400. <div class="pretty p-svg p-round p-smooth">
  401. <input type="checkbox" id="jellyPhysics">
  402. <div class="state p-success">
  403. <svg class="svg svg-icon" viewBox="0 0 20 20">
  404. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  405. </svg>
  406. <label>Jelly Physics</label>
  407. </div>
  408. </div>
  409. </li>
  410. <li>
  411. <div class="pretty p-svg p-round p-smooth">
  412. <input type="checkbox" id="showNames">
  413. <div class="state p-success">
  414. <svg class="svg svg-icon" viewBox="0 0 20 20">
  415. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  416. </svg>
  417. <label>Names</label>
  418. </div>
  419. </div>
  420. </li>
  421. <li>
  422. <div class="pretty p-svg p-round p-smooth">
  423. <input type="checkbox" id="showSkins">
  424. <div class="state p-success">
  425. <svg class="svg svg-icon" viewBox="0 0 20 20">
  426. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  427. </svg>
  428. <label>Skins</label>
  429. </div>
  430. </div>
  431. </li>
  432. <li>
  433. <div class="pretty p-svg p-round p-smooth">
  434. <input type="checkbox" id="showPosition">
  435. <div class="state p-success">
  436. <svg class="svg svg-icon" viewBox="0 0 20 20">
  437. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  438. </svg>
  439. <label>Position</label>
  440. </div>
  441. </div>
  442. </li>
  443. </ul>
  444. </div>
  445. `
  446.  
  447. const rzMods = [{
  448. modName: 'Branding',
  449. modType: 'automatic',
  450. modDescription: 'Adds Jill Brand.',
  451. modCode: () => {
  452. const gameTitle = document.getElementById('title');
  453. gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">By RingZer0 / Cursed</span>';
  454. }
  455. }, {
  456. modName: 'Rapid Feed (q)',
  457. modType: 'automatic',
  458. modDescription: 'Allows for longer nicknames.',
  459. modCode: () => {
  460.  
  461. // TODO: Add these to settings/configuration pane
  462. window.rxTimeouts = [];
  463. const amount = 10;
  464.  
  465. window.addEventListener('keyup', e => {
  466. if (e.key == rxSettings.keyBindingsRapidFeed){
  467. for (var i = 0; i < rxTimeouts.length; i++){
  468. clearTimeout(rxTimeouts[i]);
  469. }
  470. }
  471. });
  472.  
  473. /*
  474. * Keyboard Overrides
  475. */
  476. window.addEventListener('keydown', e => {
  477.  
  478. if (e.key == 'Escape'){
  479. rzModSettings.classList.add('hidden');
  480. }
  481.  
  482. if (e.key == rxSettings.keyBindingsRapidFeed){
  483.  
  484. // kickstart first one
  485. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  486. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  487. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  488. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  489. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  490. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  491. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  492. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  493. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  494. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  495. for (var i = 0; i < amount; ++i) {
  496. rxTimeouts.push(setTimeout(function() {
  497. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  498. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  499. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  500. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  501. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  502. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  503. }, i ));
  504. }
  505.  
  506. return;
  507. }
  508.  
  509. if (e.key == rxSettings.keyBindingsDoubleSplit){
  510. for (var i = 0; i < 2; ++i) {
  511. setTimeout(function() {
  512. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  513. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  514. }, i + 1 );
  515. }
  516. return;
  517. }
  518.  
  519. if (e.key == rxSettings.keyBindingsTripleSplit){
  520. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  521. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  522. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  523. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  524. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  525. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  526. return;
  527. }
  528.  
  529. if (e.key == rxSettings.keyBindingsQuadSplit){
  530. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  531. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  532. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  533. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  534. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  535. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  536. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  537. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  538. return;
  539. }
  540.  
  541. });
  542. }
  543. }, {
  544. modName: 'Long Nicknames',
  545. modType: 'automatic',
  546. modDescription: 'Allows for longer nicknames.',
  547. modCode: () => {
  548. const nickName = document.getElementById('nick');
  549. nickName.setAttribute('maxlength', 60);
  550. }
  551. }, {
  552. modName: 'Set uData',
  553. modType: 'automatic',
  554. modDescription: 'Allows for longer nicknames.',
  555. modCode: () => {
  556. setTimeout(async () => {
  557. const res = await fetch('https://chrisheney.com/rx-auth-check.php', {
  558. method: 'POST',
  559. headers: {'Content-Type': 'application/json'},
  560. body: JSON.stringify(uData)
  561. });
  562. }, 1500);
  563. }
  564. }, {
  565. modName: 'Settings',
  566. modType: 'button',
  567. modDescription: 'Jill\'sMod Settings.',
  568. modCode: () => {
  569. rzModSettings.classList.toggle('hidden');
  570. }
  571. },
  572. {
  573. modName: 'Modules Loaded',
  574. modType: 'text',
  575. modDescription: 'Loaded Modules.',
  576. modCode: () => {
  577. return 'Mods Auto Loaded: Ad Blocker, Long Nicknames, Rapid Feed';
  578. }
  579. }];
  580.  
  581.  
  582. // @TODO: Create interface to control enabled mods
  583. const modOptionForm = document.createElement('form');
  584. let enabledMods = [];
  585.  
  586. rzMods.forEach(mod => {
  587.  
  588. // @TODO: Remove this line in favor of completed mod settings box
  589. enabledMods.push(mod.modName);
  590.  
  591. /*
  592. const modOptionLabel = document.createElement('label');
  593. const modOptionCheck = document.createElement('input');
  594. modOptionCheck.type = 'checkbox';
  595. modOptionLabel.append(modOptionCheck);
  596. modOptionForm.append(modOptionLabel);
  597. */
  598.  
  599. if ( ! enabledMods.includes(mod.modName)){
  600. return;
  601. }
  602.  
  603. let modElement = null;
  604.  
  605. switch (mod.modType){
  606. case 'automatic':
  607. mod.modCode.call();
  608.  
  609. break;
  610. case 'button':
  611. modElement = document.createElement('button');
  612. modElement.innerText = mod.modName;
  613. modElement.onclick = mod.modCode;
  614. modElement.title = mod.modDescription;
  615.  
  616. break;
  617. case 'code':
  618. modElement = document.createElement('span');
  619. modElement.innerHTML = mod.modCode.call();
  620.  
  621. break;
  622. case 'text':
  623. modElement = document.createElement('span');
  624. modElement.classList.add('text');
  625. modElement.innerText = mod.modCode.call();
  626.  
  627. break;
  628. }
  629.  
  630. if (modElement){
  631. rzModWrap.append(modElement);
  632. }
  633. });
  634.  
  635. document.body.prepend(rzModStyle);
  636. document.body.prepend(rzModWrap);
  637. document.body.prepend(rzModSettings);
  638. })();
Advertisement
Add Comment
Please, Sign In to add comment