Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mine rebuilder userscript #386

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

SasSam
Copy link
Contributor

@SasSam SasSam commented Jul 23, 2024

This is an update for @PiTi2k5 's user_mine_rebuild.js userscript.

We can now switch between 2 options:

  • show all checkboxes for all mines, regardless
  • show checkboxes for mines only where they can be built. In this case, it doesn't show a checkbox if a mine is already built or a depo has not been found yet.

image

image

@fedorovvl
Copy link
Owner

@PiTi2k5 you approve this?

@PiTi2k5
Copy link
Contributor

PiTi2k5 commented Jul 23, 2024

Without combobox on each deposit, the create of templates are useless or not?

@SasSam
Copy link
Contributor Author

SasSam commented Jul 23, 2024

@PiTi2k5 and I had a quick chat, and we agreed to add a radio button in the header that will show all checkboxes or only the available ones. Let's put this PR on hold till then.

@SasSam
Copy link
Contributor Author

SasSam commented Jul 24, 2024

The update has been pushed.

@fedorovvl
Copy link
Owner

fedorovvl commented Jul 24, 2024

i see u using "game" variable for storing DepositDepletedGameScriptKeys.SWITCH_STATUS.. why? its not saving to settings ang "game" is class variable..
instead of this u can use settings file.. for ex

var DepositDepletedSettings = {
	SWITCH_STATUS: DepositDepletedSwitchStatuses.ON
}
$.extend(DepositDepletedSettings, readSettings(null, 'DepositDepleted'));
......
DepositDepletedSettings.SWITCH_STATUS = DepositDepletedSwitchStatuses.OFF;
......
storeSettings(DepositDepletedSettings, 'DepositDepleted');

@SasSam
Copy link
Contributor Author

SasSam commented Jul 24, 2024

i see u using "game" variable for storing DepositDepletedGameScriptKeys.SWITCH_STATUS.. why? its not saving to settings ang "game" is class variable.. instead of this u can use settings file.. for ex

It just stores the radio button's state while the client is running. So, if you close the modal and reopen it, the radio button's state will be restored. But I don't think we need to save this setting permanently in a file.

I know the game is the main object, but the set key-value won't conflict with anything because it has a unique prefix.

image

@fedorovvl
Copy link
Owner

I know the game is the main object, but the set key-value won't conflict with anything because it has a unique prefix.

not necessary to escape from script scope.. u can use any variable defined inside script

@SasSam
Copy link
Contributor Author

SasSam commented Jul 25, 2024

not necessary to escape from script scope.. u can use any variable defined inside script

Ok, I've pushed the update for this. Using a global variable within the script instead of the game object.

@fedorovvl fedorovvl merged commit 7b5777c into fedorovvl:master Jul 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants