Skip to content

addMaterialBox - #41

Open
Ledniky wants to merge 2 commits into
ss14-art:masterfrom
Ledniky:addMaterialBox
Open

addMaterialBox#41
Ledniky wants to merge 2 commits into
ss14-art:masterfrom
Ledniky:addMaterialBox

Conversation

@Ledniky

@Ledniky Ledniky commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Добавил коробку для хранения материалов, очень полезно при покупке 10 ящиков пластстали/пластика/стали

Summary by CodeRabbit

  • New Features

    • Added a material storage box for construction materials.
    • Supports a 20×10 storage grid, standard item-size limits, and open/close sounds.
    • Restricts storage to approved construction materials.
    • Added the box as a cargo purchase option.
    • Added construction support, requiring 7 units of steel and suitable placement space.
  • Localization

    • Added Russian name and description text for the material storage box.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added the MaterialBox storage prototype with configured capacity, sounds, and construction-material filtering. Added construction, cargo, and Russian localization definitions.

Changes

Material storage box

Layer / File(s) Summary
MaterialBox definition and localization
Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml, Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl
The MaterialBox prototype inherits from OreBox, configures a 20×10 storage grid, item-size limit, sounds, and a ConstructionMaterial whitelist. Russian text defines the entity name and description.
MaterialBox construction flow
Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml, Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml
The construction prototype applies placement rules. MaterialBoxGraph consumes 7 Steel after 1 second and creates a MaterialBox.
Cargo product integration
Resources/Prototypes/_Art/Catalog/Cargo/cargo_cargo.yml
CargoMaterialBox defines OreBox icon data, a cost of 300, and cargo market categorization.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: rewafflution

Sequence Diagram(s)

sequenceDiagram
  participant ConstructionPrototype
  participant MaterialBoxGraph
  participant MaterialBox
  ConstructionPrototype->>MaterialBoxGraph: validate placement and start construction
  MaterialBoxGraph->>MaterialBoxGraph: consume 7 Steel after 1 second
  MaterialBoxGraph->>MaterialBox: create entity
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the added material storage box feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.45.0)

ast-grep could not parse rule config: /ast-grep-rules/../git/.ast-grep/rules/ss14-raw-string-popup.yml


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml`:
- Around line 2-4: Update
Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml lines 2-4
to use a fork-prefixed prototype ID and locale keys for the name and description
instead of raw text. Update
Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl
lines 1-2 to define matching fork-prefixed, kebab-case keys for MaterialBox.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 88c1e092-06e7-47d9-9a3a-2dda4fab23bb

📥 Commits

Reviewing files that changed from the base of the PR and between b88a46a and 66bf39d.

📒 Files selected for processing (2)
  • Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl
  • Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml

Comment on lines +2 to +4
id: MaterialBox
name: material box
description: A large storage container for holding construction material.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Align the fork prototype identity across YAML and FTL.

The prototype uses a generic ID and raw text, while the translation targets ent-OreBox. This can cause an upstream ID collision and leave MaterialBox untranslated.

  • Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml#L2-L4: use a fork-prefixed ID and matching locale keys for name and description.
  • Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl#L1-L2: define the matching fork-prefixed, kebab-case keys for MaterialBox.

As per coding guidelines: fork prototype IDs must be fork-named. As per path instructions: prototype display fields must use locale keys, and fork locale keys must be fork--prefixed and kebab-case.

📍 Affects 2 files
  • Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml#L2-L4 (this comment)
  • Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl#L1-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml`
around lines 2 - 4, Update
Resources/Prototypes/_Art/Entities/Structures/Storege/material_box.yml lines 2-4
to use a fork-prefixed prototype ID and locale keys for the name and description
instead of raw text. Update
Resources/Locale/ru-RU/_Art/prototypes/entities/structures/storage/material_box.ftl
lines 1-2 to define matching fork-prefixed, kebab-case keys for MaterialBox.

Sources: Coding guidelines, Path instructions

@Odleer

Odleer commented Aug 8, 2026

Copy link
Copy Markdown
Member

Нужно добавить спрайт и возможность крафта

@Ledniky

Ledniky commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

я не добавил получение XD
щас сделаем

@github-actions github-actions Bot added the size/S label Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Resources/Prototypes/_Art/Catalog/Cargo/cargo_cargo.yml`:
- Around line 1-8: Add the missing product field to the CargoMaterialBox
cargoProduct definition, setting it to MaterialBox so purchases spawn the
intended entity, consistent with the CargoOreBox definition.

In
`@Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml`:
- Around line 2-3: Rename the fork-owned MaterialBox construction, graph, and
entity references to use the repository’s established fork prefix. Update
Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml
lines 2-3 to rename the construction ID and synchronized graph reference; update
Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml
line 2 to rename the graph ID and line 14 to reference the renamed entity
prototype.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5f0732c1-9bec-4c97-8b94-d0c0241ed4d0

📥 Commits

Reviewing files that changed from the base of the PR and between 66bf39d and c85707c.

📒 Files selected for processing (3)
  • Resources/Prototypes/_Art/Catalog/Cargo/cargo_cargo.yml
  • Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml
  • Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml

Comment on lines +1 to +8
- type: cargoProduct
id: CargoMaterialBox
icon:
sprite: /Textures/Structures/Storage/orebox.rsi
state: orebox
cost: 300
category: cargoproduct-category-name-cargo
group: market No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Link the cargo product to MaterialBox.

The cargo product does not define a product field. Cargo listings use this field to identify the entity to spawn, as shown by CargoOreBox. Add product: MaterialBox; otherwise, purchasing CargoMaterialBox may not provide the new storage box.

Proposed fix
 - type: cargoProduct
   id: CargoMaterialBox
   icon:
     sprite:  /Textures/Structures/Storage/orebox.rsi
     state: orebox
+  product: MaterialBox
   cost: 300
   category: cargoproduct-category-name-cargo
   group: market
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- type: cargoProduct
id: CargoMaterialBox
icon:
sprite: /Textures/Structures/Storage/orebox.rsi
state: orebox
cost: 300
category: cargoproduct-category-name-cargo
group: market
- type: cargoProduct
id: CargoMaterialBox
icon:
sprite: /Textures/Structures/Storage/orebox.rsi
state: orebox
product: MaterialBox
cost: 300
category: cargoproduct-category-name-cargo
group: market
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Resources/Prototypes/_Art/Catalog/Cargo/cargo_cargo.yml` around lines 1 - 8,
Add the missing product field to the CargoMaterialBox cargoProduct definition,
setting it to MaterialBox so purchases spawn the intended entity, consistent
with the CargoOreBox definition.

Comment on lines +2 to +3
id: MaterialBox
graph: MaterialBoxGraph

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use fork-named IDs for all MaterialBox prototypes.

The construction, graph, and entity identifiers use generic names. Rename the fork-owned prototypes with the repository’s established fork prefix, then update all references.

  • Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml#L2-L3: rename the construction ID and synchronize graph:.
  • Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml#L2-L2: rename the graph ID.
  • Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml#L14-L14: reference the renamed entity prototype.

As per coding guidelines, prototype IDs for fork content must be fork-named to avoid collisions with upstream IDs.

📍 Affects 2 files
  • Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml#L2-L3 (this comment)
  • Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml#L2-L2
  • Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml#L14-L14
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml`
around lines 2 - 3, Rename the fork-owned MaterialBox construction, graph, and
entity references to use the repository’s established fork prefix. Update
Resources/Prototypes/_Art/Recipes/Construction/material_box_construction.yml
lines 2-3 to rename the construction ID and synchronized graph reference; update
Resources/Prototypes/_Art/Recipes/Construction/Graphs/material_box_graph.yml
line 2 to rename the graph ID and line 14 to reference the renamed entity
prototype.

Source: Coding guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Нужно сделать

Development

Successfully merging this pull request may close these issues.

2 participants