feat: add potatoes, exilus, & arcanes everywhere cheats #774

Merged
Sainan merged 2 commits from equipment-cheats into main 2025-01-14 20:20:30 -08:00
Owner

Closes #767

Closes #767
coderabbitai[bot] commented 2025-01-11 23:29:31 -08:00 (Migrated from github.com)
Author
Owner

Walkthrough

The pull request introduces new configuration options to unlock specific equipment features across the application. Three new boolean configuration flags have been added: unlockDoubleCapacityPotatoesEverywhere, unlockExilusEverywhere, and unlockArcanesEverywhere. These options are implemented across multiple files:

  1. config.json.example now includes the new configuration options with default values of true.
  2. src/services/configService.ts extends the IConfig interface to include these new optional boolean properties.
  3. src/controllers/api/inventoryController.ts adds logic to apply the specified features to equipment items when the corresponding configuration flags are enabled.
  4. static/webui/index.html introduces new checkbox inputs for these features in the server settings.
  5. static/webui/script.js updates the configuration gathering mechanism to dynamically collect these new settings.

Assessment against linked issues

Objective Addressed Explanation
Apply Orokin Reactors/Catalysts to all items [#767]
Apply Exilus Adapters to all items [#767]
Apply Arcane Adapters to all items [#767]

The changes directly address the user's request to simplify the process of applying special adapters and capacity modifiers to all moddable items by providing a global configuration option to unlock these features everywhere.

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough The pull request introduces new configuration options to unlock specific equipment features across the application. Three new boolean configuration flags have been added: `unlockDoubleCapacityPotatoesEverywhere`, `unlockExilusEverywhere`, and `unlockArcanesEverywhere`. These options are implemented across multiple files: 1. `config.json.example` now includes the new configuration options with default values of `true`. 2. `src/services/configService.ts` extends the `IConfig` interface to include these new optional boolean properties. 3. `src/controllers/api/inventoryController.ts` adds logic to apply the specified features to equipment items when the corresponding configuration flags are enabled. 4. `static/webui/index.html` introduces new checkbox inputs for these features in the server settings. 5. `static/webui/script.js` updates the configuration gathering mechanism to dynamically collect these new settings. ## Assessment against linked issues | Objective | Addressed | Explanation | |-----------|-----------|-------------| | Apply Orokin Reactors/Catalysts to all items [#767] | ✅ | | | Apply Exilus Adapters to all items [#767] | ✅ | | | Apply Arcane Adapters to all items [#767] | ✅ | | The changes directly address the user's request to simplify the process of applying special adapters and capacity modifiers to all moddable items by providing a global configuration option to unlock these features everywhere. <!-- walkthrough_end --> <!-- internal state start --> <!-- FAHghAtBAEAqAWBLAztF0CGA7TBXALgPYQDmAplmQE4b5kAm0AxoQLasX4Bc0ADldEIAjAFZkm+RADcyqIQE9mhetQxChifADoMiaFAB8wY+CjGAxOegAFAErQAyrnYYq84wjJ9cAGx/QqMgBHXFl8aEl8HwZoACIAMzJaHgx6Rl5CfFpCWQAaaDIAD0QfXGR8gDJMKiZsWQKZNwB3eGovJlbaZFjoJoxUZFwhVk06RgUI1ugy6kddLGxMLEZ0RBUsSXjEGP7oLGchWYB2I4AWLTgp/kRWV0VeXCoM5C9CeMn0OzRUIjQNqmUuCYXkoTWYnXwqECPloMV+sQyWSIeR6sSKJTKuR62EYsVctUo3V6miQOHwUwcvAwwIAcogsCIMA5qI0+ACxBILgh0BR4NhgRwNpgbj9CAVClTlpMvPFcFgJIhCAsfJpFG9pdAXlRWRMMH5CE16SRpS9wUlIRExYdMExgchkIghNE/tApK5FWUlBsihbyQDcCR4IQCBqSBgOFpjABBNKaRXKnzyfLk9APPwBYKhZDhdAqrAAazhYpQgxBB2OADYjvl6fRELVJFhjeTaGhwql6IF7fVCAIu4QfDJUBg2WQpB7kIm0OtNttGCx5dQcL3oIlaI8vIEQmFiSmyVd2eJtJcvF8CdBrfFg1LW+SZQOfAajdAAKq2AAyPAA2vB8PheMgXAAPRASQJJDFoLCsEByBUsCWD0oyWqNEBlLUmQdIMkyLLUEBaY+EBJynAAugAFL+/6ASBYHkhBUEwXBFCIf0OFUKhjGYYyzLarh+GEWcACUkbAIYJiQDAFCMOqGAEMQ5CUDQYxKOwnA8PwgiiEe0j1BMLAqDQ6iaDoeiiaYMDcqg6CLDJRCkBQqhKVBgrcAEGBgoMLhuBeih6aohnaLo+gQE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ScxscNhL3Lc4hrMA9MD904UAvoxQgqQrwwD4lQvAhBhlBBELVrHo+0dq7jp4HifcJMphdLXiDb5MJR/cpJA8fjD5IhrtT5oAAA1d0amLwOmsYR+BcBdMS7DSSmrQixSkirpFSmKXVIOkcMy6oSysJKOgW8ypK+4EmXwUJeIIOzKvaxXSMPC0SUAcSQ+KSd4GyOSWi0JJyVSVydyZ/LyXSZQPyDQAKEyYKdeqAZSEYfARVNYZARVQIccOaBgRVffbeIKEKMyaACsIQegCsMgCsOWIGKsI4OWAAVlqAwAAAYMBoHkH4GhBoGgZQ4KwAAOeIKBoQeIIGIGXBo4CsBNNe/+pyTQJ++gF+t+7YI/egRVSSX+oAA== --> <!-- internal state end --> <!-- finishing_touch_checkbox_start --> ## Finishing Touches - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings (Beta) <!-- finishing_touch_checkbox_end --> <!-- tips_start --> --- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <details> <summary>🪧 Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>, please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR. ([Beta](https://docs.coderabbit.ai/early-access#beta)) - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> <!-- tips_end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-01-11 23:30:48 -08:00
coderabbitai[bot] (Migrated from github.com) left a comment
Author
Owner

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/controllers/api/inventoryController.ts (1)

214-245: Consider refactoring the duplicated feature-setting logic.

The three blocks share identical structure and only differ in the feature being set. Consider extracting this into a helper function to reduce code duplication.

+function setEquipmentFeature(inventoryResponse: IInventoryResponse, feature: EquipmentFeatures): void {
+    for (const key of equipmentKeys) {
+        if (key in inventoryResponse) {
+            for (const equipment of inventoryResponse[key]) {
+                equipment.Features ??= 0;
+                equipment.Features |= feature;
+            }
+        }
+    }
+}

 if (config.unlockDoubleCapacityPotatoesEverywhere) {
-    for (const key of equipmentKeys) {
-        if (key in inventoryResponse) {
-            for (const equipment of inventoryResponse[key]) {
-                equipment.Features ??= 0;
-                equipment.Features |= EquipmentFeatures.DOUBLE_CAPACITY;
-            }
-        }
-    }
+    setEquipmentFeature(inventoryResponse, EquipmentFeatures.DOUBLE_CAPACITY);
 }

 if (config.unlockExilusEverywhere) {
-    for (const key of equipmentKeys) {
-        if (key in inventoryResponse) {
-            for (const equipment of inventoryResponse[key]) {
-                equipment.Features ??= 0;
-                equipment.Features |= EquipmentFeatures.UTILITY_SLOT;
-            }
-        }
-    }
+    setEquipmentFeature(inventoryResponse, EquipmentFeatures.UTILITY_SLOT);
 }

 if (config.unlockArcanesEverywhere) {
-    for (const key of equipmentKeys) {
-        if (key in inventoryResponse) {
-            for (const equipment of inventoryResponse[key]) {
-                equipment.Features ??= 0;
-                equipment.Features |= EquipmentFeatures.ARCANE_SLOT;
-            }
-        }
-    }
+    setEquipmentFeature(inventoryResponse, EquipmentFeatures.ARCANE_SLOT);
 }
static/webui/script.js (1)

797-797: LGTM! Dynamic configuration array improves maintainability.

The change to dynamically populate uiConfigs from DOM elements eliminates the need to manually update the array when adding new configuration options.

Consider documenting the jQuery dependency.

The code uses jQuery ($) which appears to be a global dependency. Consider adding a comment or JSDoc to document this requirement.

+// Requires jQuery to be loaded globally
 const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
🧰 Tools
🪛 eslint

[error] 797-797: '$' is not defined.

(no-undef)

static/webui/index.html (1)

274-291: LGTM! The implementation follows existing patterns.

The new checkboxes are well-structured and maintain consistency with the existing UI elements.

Consider adding tooltips to explain what "Potatoes", "Exilus Adapters", and "Arcane Adapters" mean for new users. Example:

 <div class="form-check">
     <input class="form-check-input" type="checkbox" id="unlockDoubleCapacityPotatoesEverywhere" />
-    <label class="form-check-label" for="unlockDoubleCapacityPotatoesEverywhere">
+    <label class="form-check-label" for="unlockDoubleCapacityPotatoesEverywhere" title="Unlocks Orokin Catalysts and Reactors (commonly known as potatoes) for all equipment">
         Potatoes Everywhere
     </label>
 </div>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ebd7068e2 and 6bd6e62167.

📒 Files selected for processing (5)
  • config.json.example (1 hunks)
  • src/controllers/api/inventoryController.ts (2 hunks)
  • src/services/configService.ts (1 hunks)
  • static/webui/index.html (1 hunks)
  • static/webui/script.js (1 hunks)
🧰 Additional context used
🪛 eslint
static/webui/script.js

[error] 797-797: '$' is not defined.

(no-undef)

🔇 Additional comments (3)
config.json.example (1)

28-30: LGTM! The new configuration flags follow the existing pattern.

The new flags are well-named, consistently formatted, and logically grouped with other similar "unlock" flags.

src/services/configService.ts (1)

54-56: LGTM! The interface updates match the configuration changes.

The new properties are correctly typed as optional booleans and follow the existing pattern.

src/controllers/api/inventoryController.ts (1)

8-8: LGTM! Import statement updated correctly.

The EquipmentFeatures enum is now imported along with the existing types.

**Actionable comments posted: 0** <details> <summary>🧹 Nitpick comments (3)</summary><blockquote> <details> <summary>src/controllers/api/inventoryController.ts (1)</summary><blockquote> `214-245`: **Consider refactoring the duplicated feature-setting logic.** The three blocks share identical structure and only differ in the feature being set. Consider extracting this into a helper function to reduce code duplication. ```diff +function setEquipmentFeature(inventoryResponse: IInventoryResponse, feature: EquipmentFeatures): void { + for (const key of equipmentKeys) { + if (key in inventoryResponse) { + for (const equipment of inventoryResponse[key]) { + equipment.Features ??= 0; + equipment.Features |= feature; + } + } + } +} if (config.unlockDoubleCapacityPotatoesEverywhere) { - for (const key of equipmentKeys) { - if (key in inventoryResponse) { - for (const equipment of inventoryResponse[key]) { - equipment.Features ??= 0; - equipment.Features |= EquipmentFeatures.DOUBLE_CAPACITY; - } - } - } + setEquipmentFeature(inventoryResponse, EquipmentFeatures.DOUBLE_CAPACITY); } if (config.unlockExilusEverywhere) { - for (const key of equipmentKeys) { - if (key in inventoryResponse) { - for (const equipment of inventoryResponse[key]) { - equipment.Features ??= 0; - equipment.Features |= EquipmentFeatures.UTILITY_SLOT; - } - } - } + setEquipmentFeature(inventoryResponse, EquipmentFeatures.UTILITY_SLOT); } if (config.unlockArcanesEverywhere) { - for (const key of equipmentKeys) { - if (key in inventoryResponse) { - for (const equipment of inventoryResponse[key]) { - equipment.Features ??= 0; - equipment.Features |= EquipmentFeatures.ARCANE_SLOT; - } - } - } + setEquipmentFeature(inventoryResponse, EquipmentFeatures.ARCANE_SLOT); } ``` </blockquote></details> <details> <summary>static/webui/script.js (1)</summary><blockquote> `797-797`: **LGTM! Dynamic configuration array improves maintainability.** The change to dynamically populate `uiConfigs` from DOM elements eliminates the need to manually update the array when adding new configuration options. **Consider documenting the jQuery dependency.** The code uses jQuery (`$`) which appears to be a global dependency. Consider adding a comment or JSDoc to document this requirement. ```diff +// Requires jQuery to be loaded globally const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id); ``` <details> <summary>🧰 Tools</summary> <details> <summary>🪛 eslint</summary> [error] 797-797: '$' is not defined. (no-undef) </details> </details> </blockquote></details> <details> <summary>static/webui/index.html (1)</summary><blockquote> `274-291`: **LGTM! The implementation follows existing patterns.** The new checkboxes are well-structured and maintain consistency with the existing UI elements. Consider adding tooltips to explain what "Potatoes", "Exilus Adapters", and "Arcane Adapters" mean for new users. Example: ```diff <div class="form-check"> <input class="form-check-input" type="checkbox" id="unlockDoubleCapacityPotatoesEverywhere" /> - <label class="form-check-label" for="unlockDoubleCapacityPotatoesEverywhere"> + <label class="form-check-label" for="unlockDoubleCapacityPotatoesEverywhere" title="Unlocks Orokin Catalysts and Reactors (commonly known as potatoes) for all equipment"> Potatoes Everywhere </label> </div> ``` </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: .coderabbit.yaml** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 8ebd7068e2cb44731a70e07783b648e0da5f79bb and 6bd6e62167725caa0a5550b51368f72bf11f776c. </details> <details> <summary>📒 Files selected for processing (5)</summary> * `config.json.example` (1 hunks) * `src/controllers/api/inventoryController.ts` (2 hunks) * `src/services/configService.ts` (1 hunks) * `static/webui/index.html` (1 hunks) * `static/webui/script.js` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 eslint</summary> <details> <summary>static/webui/script.js</summary> [error] 797-797: '$' is not defined. (no-undef) </details> </details> </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>config.json.example (1)</summary> `28-30`: **LGTM! The new configuration flags follow the existing pattern.** The new flags are well-named, consistently formatted, and logically grouped with other similar "unlock" flags. </details> <details> <summary>src/services/configService.ts (1)</summary> `54-56`: **LGTM! The interface updates match the configuration changes.** The new properties are correctly typed as optional booleans and follow the existing pattern. </details> <details> <summary>src/controllers/api/inventoryController.ts (1)</summary> `8-8`: **LGTM! Import statement updated correctly.** The `EquipmentFeatures` enum is now imported along with the existing types. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Sign in to join this conversation.
No description provided.