Skip to content

为建筑工具箱实现地板/矿物/建筑图层独立开关#115

Open
Wind-DeterMination-backup wants to merge 7 commits intoTinyLake:mainfrom
Wind-DeterMination-backup:gh-87
Open

为建筑工具箱实现地板/矿物/建筑图层独立开关#115
Wind-DeterMination-backup wants to merge 7 commits intoTinyLake:mainfrom
Wind-DeterMination-backup:gh-87

Conversation

@Wind-DeterMination-backup
Copy link
Copy Markdown

@Wind-DeterMination-backup Wind-DeterMination-backup commented Mar 15, 2026

概要

  • 为 issue [Feature] 地蓝 图层增强 #87 实现建筑工具箱中的地板/矿物/建筑图层独立开关。
  • 渲染逻辑与地形蓝图的复制/放置行为已与图层开关保持一致。
  • 已整理 wall ore overlay 绘制流程,并对齐相关矿层绘制行为。

Closes #87

验证

  • ./work/gradlew.bat -p work :core:compileKotlin :core:compileJava -x :core:patchGeneratedSources
  • ./gradlew.bat core:classes

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances user control over map visualization and schematic functionality by introducing independent toggles for floor, ore, and building layers. This refactoring allows for more precise customization of what is rendered on screen and what is included in terrain schematics, improving both the visual experience and the utility of map editing tools.

Highlights

  • Independent Layer Toggles: Introduced separate toggles for rendering and schematic inclusion of floor, ore, and building layers, replacing the previous single 'blockRenderLevel' control.
  • Rendering Logic Refinement: Updated the core rendering system to dynamically draw floor, ore, and building elements based on the new individual layer visibility settings, including adjustments to light calculations.
  • Schematic System Integration: Modified the schematic creation and application logic to respect the new layer toggles, allowing users to include or exclude specific layers when capturing or pasting terrain schematics.
  • User Interface Enhancements: Added new dedicated toggle buttons for 'Floor', 'Ore', and 'Building' layers to the advanced toolbox, providing direct control over their visibility.
  • Localization Updates: Added new English localization strings for 'Floor', 'Ore', 'Block', and 'Building Detail' to support the new UI elements.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • patches/client/0074-core-split-floor-ore-and-building-layer-toggles.patch
    • Added a new patch file to implement the layer splitting functionality.
  • src/mindustryX/bundles/UiTextBundleEn.kt
    • Added new English translations for 'Floor', 'Block', 'Building Detail', and 'Ore'.
  • src/mindustryX/features/BindingExt.kt
    • Updated the 'toggle_block_render' keybind to use the new 'cycleBuildingVisibility' method.
  • src/mindustryX/features/LogicExt.java
    • Introduced a 'BlockLayer' enum and new boolean flags ('floorLayerEnabled', 'oreLayerEnabled', 'blockLayerEnabled') with corresponding 'CheckPref' settings.
    • Added utility methods to classify blocks by layer and check if a layer is enabled for rendering or schematic inclusion.
  • src/mindustryX/features/RenderExt.java
    • Implemented new methods ('shouldDrawFloorLayer', 'shouldDrawOreLayer', 'shouldDrawBuildingLayer', 'shouldDrawBuildingBase') to determine layer visibility based on 'LogicExt' settings.
    • Modified 'onBlockDraw' to use 'shouldDrawBuildingBase' for conditional rendering.
    • Added 'cycleBuildingVisibility' to manage the state of building layer visibility.
  • src/mindustryX/features/ui/toolTable/AdvanceToolTable.kt
    • Added new toggle buttons for 'Floor', 'Ore', and 'Building' layers to the advanced toolbox.
  • src/mindustryX/features/ui/toolTable/NewToolTable.kt
    • Updated the 'Block' toggle to reflect the new building layer visibility logic and changed its label to 'Building Detail'.
Activity
  • Two independent GPT-5.4-high review passes were conducted, with the second pass reporting no findings.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively splits the rendering and schematic functionality for floor, ore, and building layers, introducing independent toggles for each. The changes are extensive, touching rendering, schematic creation, and various block drawing implementations. The logic for conditional rendering and schematic inclusion based on the new layer toggles seems correct and well-implemented.

I've found a few areas where the code can be simplified to improve maintainability and readability, particularly in some of the block drawing methods where there's a bit of duplicated logic. I've also made a suggestion regarding redundant alias methods. Overall, this is a solid implementation of a useful feature.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable feature by splitting rendering and schematic creation into distinct floor, ore, and building layers. The implementation is comprehensive and well-integrated throughout the codebase. I've identified a few opportunities to enhance maintainability by refactoring some of the new rendering logic to reduce redundancy. Overall, this is a solid contribution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a powerful feature to toggle the visibility of different map layers (floor, ore, buildings). The changes are extensive, touching rendering, schematics, and UI. The implementation is solid, with clear separation of logic in LogicExt and RenderExt. I have a couple of suggestions to improve code clarity and reduce redundancy in some of the drawing methods and helper functions. Overall, this is a great addition.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces independent toggles for floor, ore, and building layers, which is a great feature for improving user control over visibility. The changes are extensive, touching rendering, schematics, and UI components. The implementation correctly separates the layers and applies the visibility toggles across the system. I've found a couple of places with duplicated code in the drawing logic for Cliff and StaticTree blocks which could be refactored for better maintainability, similar to how TiledWall was refactored in a subsequent patch. Overall, this is a solid feature addition.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces independent toggles for floor, ore, and building layers, enhancing rendering control. The changes are well-implemented across the rendering pipeline, schematic creation, and UI. The logic is centralized in LogicExt and RenderExt through helper methods, which is good practice. I've found one area for improvement regarding code duplication in the initial implementation within one of the patch files, which could be refactored for better readability and maintainability.

@Wind-DeterMination-backup Wind-DeterMination-backup changed the title feat: split floor ore and building layer toggles 为建筑工具箱实现地板/矿物/建筑图层独立开关 Mar 15, 2026
@Wind-DeterMination-backup
Copy link
Copy Markdown
Author

补充说明 Gemini 建议的处理结果:

  • 已采纳:TiledWall 的矿层绘制去重;移除未使用的 RenderExt.shouldRender* 别名;将 Cliff / StaticTree 的矿层绘制流程与现有 wall draw flow 对齐。
  • 未采纳:更大范围的抽象/基类重构。当前收益有限,而且会明显扩大改动面,因此本 PR 不处理。

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

此 PR 实现了建筑工具箱中地板、矿物和建筑图层的独立开关,并相应地调整了渲染和蓝图逻辑。这是一个很棒的功能增强。

代码整体结构清晰,改动也很合理。我发现了一个可能破坏常规蓝图功能的严重问题,并提供了一个修复建议。此外,还有一个关于移除未使用变量的小建议,以提高代码整洁度。

请查看具体的审查评论。

@Wind-DeterMination-backup
Copy link
Copy Markdown
Author

这轮 Gemini 建议处理结果补充如下:

  • 已采纳:已修正 shouldIncludeInSchematicPlan 在非地形蓝图模式下对 schematic plans 的过滤逻辑,避免普通蓝图误删 floor / ore 等 plan。
  • 未采纳:drawBlocks()renderFloor / renderOre “未使用”的建议未采纳。这两个变量仍用于环境光绘制分支,并不是死代码。

@Wind-DeterMination-backup
Copy link
Copy Markdown
Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

本次 PR 为建筑工具箱实现了地板、矿物和建筑图层的独立开关,这影响了渲染、蓝图创建/放置和建造规划。这些改动范围很广,涉及渲染和游戏逻辑的许多部分,但结构良好且实现一致。将方块分类到不同图层并根据设置条件性地渲染或包含在蓝图中的逻辑看起来是正确的。UI 也已更新,为这些图层添加了新的开关。总的来说,这是一个很棒的功能实现,同时也重构和澄清了相关代码。我有一个关于移除几个未使用方法以提高代码整洁度的小建议。

@Wind-DeterMination-backup Wind-DeterMination-backup marked this pull request as ready for review March 15, 2026 09:49
@Wind-DeterMination-backup
Copy link
Copy Markdown
Author

进度同步:

  • gh-87 当前已推送到最新提交 59adddee7e5748f477a682a391412cc3206a69df
  • 本地已完成多轮 gpt-5.4-high 复核
  • 最新一轮本地清理已删除 LogicExt.java 中两个未使用的 terrain schematic helper
  • 本地 reviewer 最终结论:无新的阻塞问题
  • 这次不再继续触发 GitHub AI 审核

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.

[Feature] 地蓝 图层增强

1 participant