Skip to content

feat(editor): preview terrain#1692

Open
dderevjanik wants to merge 7 commits intoKeriew:masterfrom
dderevjanik:tweak/editor-terrain-preview
Open

feat(editor): preview terrain#1692
dderevjanik wants to merge 7 commits intoKeriew:masterfrom
dderevjanik:tweak/editor-terrain-preview

Conversation

@dderevjanik
Copy link
Copy Markdown

image image image image

@Johannes-callidus
Copy link
Copy Markdown
Collaborator

This looks really good.
I just have two requests.
First one is to implement the preview for custom earthkek as well.
Second one is to make the stone preview look more like they'll do when placed. That means they should also have the bigger stone images and should change their image when they are near cliffs.
I know second one is a bit more difficult but I'm sure you can do it.

@crudelios
Copy link
Copy Markdown
Collaborator

I'm not sure the bigger stone images are possible because they depend on the surrounding rocks and may require a full recalculation of a broader part of the map.

@Johannes-callidus
Copy link
Copy Markdown
Collaborator

It doesn't have to be exact.
We can just not calculate the surrounding stones in at all. But depending on the brush size the rocks inside the brush which is also what I thought of with custom earthkeks.

@crudelios
Copy link
Copy Markdown
Collaborator

Fair enough, that's likely doable

@dderevjanik
Copy link
Copy Markdown
Author

dderevjanik commented Mar 1, 2026

It's better than before, but still not perfect. I'd rather avoid adding unnecessary complexity just to perfect the preview

image image image

Copy link
Copy Markdown
Collaborator

@crudelios crudelios left a comment

Choose a reason for hiding this comment

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

Coding style changes

image_id = image_group(GROUP_TERRAIN_TREE);
if (ring >= 3) image_id += 24;
else if (ring >= 2) image_id += 16;
else if (ring >= 1) image_id += 8;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
else if (ring >= 1) image_id += 8;
if (ring >= 3) {
image_id += 24;
} else if (ring >= 2) {
image_id += 16;
} else if (ring >= 1) {
image_id += 8;
}

Coding guideline: always use braces.

Comment on lines +149 to +150
if (ring >= 2) image_id += 8;
else if (ring >= 1) image_id += 4;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (ring >= 2) image_id += 8;
else if (ring >= 1) image_id += 4;
if (ring >= 2) {
image_id += 8;
} else if (ring >= 1) {
image_id += 4;
}

Comment on lines +154 to +155
if (ring >= 1) image_id += 29;
else image_id += 24;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (ring >= 1) image_id += 29;
else image_id += 24;
if (ring >= 1) {
image_id += 29;
} else {
image_id += 24;
}

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.

3 participants