Skip to content

Conversation

@RagingLink
Copy link

This PR's intention is to add basic support for seeing the mineral names for mineral containers.
I didn't really bother adding more support/features for mineral containers (like how many you have of a certain type).
It's really just to add the GUIDs of mineral containers, and displaying Mineral: Bismor (C709D...) for them. If more should be done, or the current implementation is too 'hacky' let me know 🙂.

@AnthonyMichaelTDM
Copy link
Owner

AnthonyMichaelTDM commented Jul 21, 2025

Hello!
First of all, thanks for contributing. I don't play the game much anymore, so the project very much relies on external contributors like yourself.

The CI seems to be failing, but there's a lot of warnings cluttering the view, so don't worry about that yet. I'll make a PR myself to fix the stuff mypy is complaining about, and when I'm done we can update your branch.

In the meantime, could you add some tests for this new feature?

@AnthonyMichaelTDM AnthonyMichaelTDM force-pushed the feat/mineral-containers branch from 3ce9ac6 to b3bcb39 Compare July 22, 2025 01:26
@AnthonyMichaelTDM
Copy link
Owner

okay, I updated your branch but didn't change anything else.

From my understanding you can have multiple of even the same kind of mineral container, how is that being handled?

@AnthonyMichaelTDM AnthonyMichaelTDM added the Status: In Progress This issue or pull request is currently being worked on label Jul 22, 2025
@RagingLink
Copy link
Author

Yes you can have multiple of each type of mineral. Since originally the cores just showed up as unknown, I just changed it to the mineral type. So it's just a list of all the cores/mineral containers. I didn't bother changing it to show like Mineral: Bismor x40 if you have 40 bismor containers, because I didn't really want to change how the cores are listed. Here is a zip of my save if that helps SaveFile.zip

Before:
image
After:
Screenshot 2025-07-22 114014

@AnthonyMichaelTDM
Copy link
Owner

Looks good, thanks for the confirmation.

I'm good to review and merge this once you get the CI checks to pass

@RagingLink
Copy link
Author

This updates the tests and fixes the mypy error.
While updating the tests I noticed the mineral container are now in the overclock tree (see screenshot)
image
and it feels a bit weird imo. With mineral containers being a rather special case, as in you can several duplicates and having it just displayed like in the overclock tree doesn't really make sense.

Personally I think what I mentioned earlier about the mineral counts would feel appropriate in the overclock tree (All+Unforged), and in the trees Unaquired+Forged the section Mineral Containers shouldn't even be displayed.
But I'm open to your ideas 🙂

@AnthonyMichaelTDM
Copy link
Owner

yeah, I have to agree. I think being in the sidebar is better

@RagingLink
Copy link
Author

So just completely remove it from the centre overclock tree, including the Unforged list?

@AnthonyMichaelTDM
Copy link
Owner

Honestly it's up to you, I didn't mean to change how things were rendered so don't take that it renders in the OC tree now as a preference of mine or anything.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds basic support for mineral containers by creating a new category and displaying them in the overclock tree with the format "Mineral: {name} ({guid})".

  • Adds MINERAL_CONTAINERS category to the Category enum
  • Updates the data structure to handle mineral containers separately from other overclocks
  • Integrates mineral container display into the UI tree and unforged list

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/python/helpers/enums.py Adds MINERAL_CONTAINERS category enum
src/main/python/helpers/datatypes.py Refactors OcData to handle mineral containers with dedicated field and logic
src/main/python/core/view.py Updates UI to display mineral containers in tree and unforged list
src/main/python/core/state_manager.py Adds mineral container data reshaping logic
src/main/python/core/file_parser.py Handles mineral container overclock creation with hardcoded values
guids.json Adds GUID mappings for 6 mineral types
tests/*.py Updates test expectations for new overclock counts

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

self.overclocks.append(
Overclock(
category=overclock_data.category,
dwarf=Dwarf.SCOUT,
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding Dwarf.SCOUT for mineral containers is inconsistent with the empty dwarf string used in state_manager.py. Consider using a consistent approach or adding a comment explaining why SCOUT is used here.

Suggested change
dwarf=Dwarf.SCOUT,
dwarf="",

Copilot uses AI. Check for mistakes.
category=overclock_data.category,
dwarf=Dwarf.SCOUT,
weapon="",
cost=Cost(credits=600),
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded cost of 600 credits for mineral containers should be documented or made configurable. Consider adding a constant or comment explaining this value.

Suggested change
cost=Cost(credits=600),
cost=Cost(credits=MINERAL_CONTAINER_CREDIT_COST),

Copilot uses AI. Check for mistakes.
for k, v in data[Category.MINERAL_CONTAINERS.value].items():
new_data[k] = {
"category": Category.MINERAL_CONTAINERS,
"dwarf": "",
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an empty string for dwarf is inconsistent with the Dwarf enum usage elsewhere. Consider using a specific enum value like Dwarf.NONE or None to be more explicit about the absence of a dwarf association.

Suggested change
"dwarf": "",
"dwarf": None,

Copilot uses AI. Check for mistakes.
):
for category, data in oc_data.non_weapon.items():
for category, data in oc_data.other.items():
if category == Category.WEAPONS or category == Category.MINERAL_CONTAINERS:
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This condition check to skip WEAPONS and MINERAL_CONTAINERS is fragile. Consider refactoring to make the separation of concerns more explicit, perhaps by using a set of categories to skip or checking for specific categories to include.

Suggested change
if category == Category.WEAPONS or category == Category.MINERAL_CONTAINERS:
SKIP_CATEGORIES = {Category.WEAPONS, Category.MINERAL_CONTAINERS}
for category, data in oc_data.other.items():
if category in SKIP_CATEGORIES:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: In Progress This issue or pull request is currently being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants