Zorn192 / AutoTrimps

AutoTrimps - Zek
GNU General Public License v3.0
58 stars 102 forks source link

Updating farming settings implementation #148

Closed SadAugust closed 2 years ago

SadAugust commented 2 years ago

SettingsGUI.js

So the implementation requires pretty specific variable names. You'll need to have the setting name for each ending end the same way, so I had to rewrite all my zone settings that are being used to end with Zone, you can input the prefix and affix yourself so it's not too important just requires consistency to make it work easier.

All settings for special (lmc, lwc etc) need to be converted textValue unless you don't want to allow that selection, doesn't make a huge difference but it's a worthwhile addition for dailies and C3s. All cell settings need to be converted to multiValue unless you don't want to allow things to be run on different cells on different zones If you do implement either of these 2 you'll have to warn users that their old setting won't work and will need updated

You'll need to implement a settings button to allow the user access to the settings menu. Here's what I done for mine, super simple createSetting('rTributeFarmSettings', 'Tribute Farm Settings', 'Click to adjust settings. ', 'boolean', 1, null, 'Maps');

Afterwards you'll have to have an onclick for each settings button. The first parameter that you input is what the title of the settings window will be displayed as. The second parameter is the prefix for the variable name that you used for that setting, example of mine is below document.getElementById('rTimeFarmSettings').setAttribute('onclick', 'MAZLookalike("Time Farm", 'rTimeFarm')');

The potion input setting for alch needs to be rewritten to be stored in an array instead of just as a textfile, would highly recommend creating a second setting and automatically transferring the data from the original setting into the 2nd so that peoples inputs aren't lost in the ether. You can do this by throwing the following code into SettingsGUI.js.

if (autoTrimpSettings.oldSetting.value !== 'undefined') { autoTrimpSettings.newSettig.value = autoTrimpSettings.oldSetting.value.split(','); autoTrimpSettings.oldSetting.value = 'undefined';

MAZ.js

To change the affix you want to change any line that reads similar to autoTrimpSettings[varPrefix+"MapLevel"].value[x], change MapLevel or any other line to how all of your settings have been named.

You probably want to modify when settings or options are shown depending on what settings you've got, just add to or remove the if (titleText.inclues('xyz')) lines

Maps.js

Need to adjust the cell variable to use an index of the zone to find out the correct cell to run it at

Gather.js/Jobs.js Might need to rewrite some stuff? I had to do some for time farm settings but idk how much I've changed it

AutoTrimps2.js

Might need to put a warning on running stuff on the same cell. I had to go sort out the priority system for my fork and not sure how yours handles things running at the same time.

You'll need to add MAZ.js or whatever you rename it to to the modules list. Add the following if statement to remove the scrollbar showing up on every tooltip after you've been editting map settings. Should add it so that it runs in both universes.

if (document.getElementById('tooltipDiv').classList.contains('tooltipExtraLg') === false) document.getElementById('tooltipDiv').style.overflowY = '';

tabs.css

Added a ton of items to this, to add a new setting the the heading row then add it to the line that has every .window option and the only style setting for it is display: inline-block.

Can manually adjust width to each item by putting them into a new function and giving them a unique width style. I haven't gone as far as to find super optimal widths to get rid of blank space, was gonna look into that after a week of playing with it.