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

[Minor] Add separate tag for grid transparency when PlacementPreview is enabled #1194

Merged
merged 2 commits into from
Jan 21, 2024

Conversation

Belonit
Copy link
Member

@Belonit Belonit commented Jan 16, 2024

[AudioVisual]
PlacementGrid.TranslucencyWithPreview=  ; translucency level (0/25/50/75), defaults to [AudioVisual]->PlacementGrid.Translucency

Summary by CodeRabbit

  • New Features

    • Enhanced building placement previews with customization options for the grid's appearance.
    • Added setting for adjusting grid translucency during building placement.
  • Documentation

    • Updated user interface documentation with new placement preview features.
    • Added details on the latest features to the "What's New" documentation.

[AudioVisual]->PlacementPreview.Grid.Translucency=
Copy link

coderabbitai bot commented Jan 16, 2024

Walkthrough

The recent update enhances the building placement preview in the user interface, allowing users to customize the appearance, including translucency, of the placement grid both globally and for individual buildings. The code now supports setting grid transparency with a new tag and adjusts rendering based on the translucency level. This involves changes to the handling of placement grid properties in the codebase, including the introduction of a new property for controlling the translucency level of the placement preview grid.

Changes

Files Change Summary
docs/User-Interface.md, docs/Whats-New.md Enhanced building placement preview features with translucency settings.
src/Ext/BuildingType/Hooks.cpp, src/Ext/Rules/Body.cpp, src/Ext/Rules/Body.h Modified hooks and added new property for translucency control of placement grid.

🐇✨
To build with ease, the grid now clears,
A translucent guide, through the code it sheers.
The rabbit hops high, with a code in its teeth,
Celebrating the change, underneath. 🏗️🌟

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added the Minor Documentation is not required label Jan 16, 2024
@Belonit Belonit removed the Minor Documentation is not required label Jan 16, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8250ad1 and b8b7e82.
Files selected for processing (5)
  • docs/User-Interface.md (1 hunks)
  • docs/Whats-New.md (1 hunks)
  • src/Ext/BuildingType/Hooks.cpp (1 hunks)
  • src/Ext/Rules/Body.cpp (2 hunks)
  • src/Ext/Rules/Body.h (2 hunks)
Additional comments: 8
src/Ext/BuildingType/Hooks.cpp (1)
  • 142-151: The changes to the CellClass_Draw_It_SetPlacementGridTranslucency hook correctly implement the conditional setting of blitFlags based on the new PlacementPreview settings. Ensure that the new PlacementPreview.Grid.Translucency setting is being tested in various scenarios to confirm its behavior matches the expected outcomes.
src/Ext/Rules/Body.h (1)
  • 55-56: The addition of the PlacementPreview_Grid_Translucency member variable to the RulesExt class is correct. Verify that this new setting is being utilized correctly wherever the RulesExt class is instantiated or used.
src/Ext/Rules/Body.cpp (2)
  • 88-89: The code correctly reads the new PlacementPreview_Grid_Translucency property from the INI file and includes it in the serialization process. Ensure that the property is being read and saved correctly in various configurations and that it interacts correctly with other related properties.
  • 228-228: The serialization process for the PlacementPreview_Grid_Translucency property is correctly implemented. Verify that the serialization and deserialization work as expected across different game sessions and that the property retains its value.
docs/User-Interface.md (3)
  • 181-193: The documentation updates for the PlacementPreview feature are clear and well-detailed, providing users with the necessary information to utilize the new translucency settings.
  • 189-190: The default value for PlacementGrid.Translucency is correctly documented as 0, which aligns with the PR's objective to allow customization of the building placement grid's translucency.
  • 193-193: The addition of PlacementPreview.Grid.Translucency to the documentation is consistent with the PR's objective to introduce a new configuration option for grid translucency during building placement previews.
docs/Whats-New.md (1)
  • 352-352: The addition of the PlacementPreview.Grid.Translucency tag is correctly documented under the "New" section for the upcoming version. This aligns with the PR's objective to enhance the building placement preview feature.

@Belonit Belonit added the Minor Documentation is not required label Jan 16, 2024
@Belonit Belonit requested a review from Metadorius January 16, 2024 06:29
Copy link

github-actions bot commented Jan 16, 2024

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b8b7e82 and 1f73286.
Files selected for processing (5)
  • docs/User-Interface.md (1 hunks)
  • docs/Whats-New.md (1 hunks)
  • src/Ext/BuildingType/Hooks.cpp (1 hunks)
  • src/Ext/Rules/Body.cpp (2 hunks)
  • src/Ext/Rules/Body.h (2 hunks)
Files skipped from review as they are similar to previous changes (5)
  • docs/User-Interface.md
  • docs/Whats-New.md
  • src/Ext/BuildingType/Hooks.cpp
  • src/Ext/Rules/Body.cpp
  • src/Ext/Rules/Body.h

@Belonit Belonit merged commit d5a9018 into develop Jan 21, 2024
8 checks passed
@Belonit Belonit deleted the feature/PlacementPreview.Grid.Translucency branch January 21, 2024 06:33
Belonit added a commit that referenced this pull request Jan 24, 2024
…ed (#1194)

* Add separate tag for grid transparency when PlacementPreview is enabled

[AudioVisual]->PlacementGrid.TranslucencyWithPreview=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor Documentation is not required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant