Allow selecting a biome in Atlas #7065

Merged
phosit merged 2 commits from phosit/0ad:atlas_biome_dropdown into main 2024-09-26 19:47:41 +02:00
Member

Now one can test how a random map looks with different biomes in Atlas.

This also simplifies map scripts a bit.

Continuation of https://code.wildfiregames.com/D4737

Now one can test how a random map looks with different biomes in Atlas. This also simplifies map scripts a bit. Continuation of https://code.wildfiregames.com/D4737
phosit added the
Theme
Atlas editor
label 2024-09-21 14:15:05 +02:00
phosit added 2 commits 2024-09-21 14:15:08 +02:00
Remove default biomes in map scripts
Some checks reported warnings
checkrefs / checkrefs (pull_request) Successful in 1m8s
pre-commit / build (pull_request) Successful in 1m25s
0ad-freebsd/pipeline/pr-main This commit is unstable
0ad-windows/pipeline/pr-main This commit looks good
0ad-linux/pipeline/pr-main This commit looks good
0ad-macos/pipeline/pr-main This commit is unstable
2a181351c5
Since Atlas didn't set a biome maps had to set it themself.
phosit requested review from vladislavbelov 2024-09-21 14:15:09 +02:00
phosit requested review from trompetin17 2024-09-21 14:15:09 +02:00
phosit requested review from smiley 2024-09-21 14:15:09 +02:00
phosit requested review from marder 2024-09-21 14:15:09 +02:00
Author
Member
@Stan
Stan reviewed 2024-09-22 10:42:07 +02:00
@ -15,3 +15,2 @@
{
// TODO: Replace ugly default for atlas by a dropdown
setBiome(g_MapSettings.Biome || "generic/alpine");
setBiome(g_MapSettings.Biome);
Owner

Wonder if we could replace setSelectedBiome() by direct calls to setBiome(g_MapSettings.Biome); now that it's no longer a hack.

Wonder if we could replace setSelectedBiome() by direct calls to `setBiome(g_MapSettings.Biome);` now that it's no longer a hack.
Author
Member

You mean setSelectedBiome was alo a hack - Likely possible. I'll replace it.

You mean `setSelectedBiome` was alo a hack - Likely possible. I'll replace it.
phosit marked this conversation as resolved
@ -57,6 +57,7 @@
#include "simulation2/components/ICmpVisual.h"
#include "simulation2/system/ParamNode.h"
#include <iostream>
Owner
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
```cpp #include <algorithm> #include <iostream> #include <string> #include <vector> ```
Author
Member

I included iostream for some logging and forgot to remove it. I'll remove it and include the other headers.

I included iostream for some logging and forgot to remove it. I'll remove it and include the other headers.
Author
Member

I included algorithm
iostream was a leftover
string and vector are included in messages.h

I included `algorithm` `iostream` was a leftover `string` and `vector` are included in messages.h
Owner

Shouldn't they be included in MapHandlers.h ?

Shouldn't they be included in MapHandlers.h ?
Owner

BTW missing copyright years updates

BTW missing copyright years updates
Author
Member

There is no MapHandlers.h
But yes i shouldn't depend on implicit inclusion.

There is no MapHandlers.h But yes i [shouldn't depend on implicit inclusion](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-implicit).
phosit marked this conversation as resolved
phosit force-pushed atlas_biome_dropdown from 2a181351c5 to 6abc9a1e29 2024-09-22 12:31:47 +02:00 Compare
phosit added a new dependency 2024-09-22 13:41:24 +02:00
phosit force-pushed atlas_biome_dropdown from 6abc9a1e29 to 30a63187ab 2024-09-22 14:54:02 +02:00 Compare
phosit force-pushed atlas_biome_dropdown from 30a63187ab to 472af5e5ef 2024-09-24 20:16:44 +02:00 Compare
Member

I checked this patch and I was able to play with it.

I tested with

  • random maps without supported biomes
  • random maps with string supported biomes like "generic/" and I validate that show me biomes from that folder
  • random maps with array of string supported biomes
I checked this patch and I was able to play with it. I tested with - random maps without supported biomes - random maps with string supported biomes like "generic/" and I validate that show me biomes from that folder - random maps with array of string supported biomes
phosit force-pushed atlas_biome_dropdown from 472af5e5ef to 3d20f80a09 2024-09-25 18:46:58 +02:00 Compare
trompetin17 approved these changes 2024-09-25 19:13:36 +02:00
trompetin17 left a comment
Member

I tested this option in multiple ways, to me looks like ready to go

I tested this option in multiple ways, to me looks like ready to go
Author
Member

@Stan Are the commitmessages ok? credits to lyv?

@Stan Are the commitmessages ok? credits to lyv?
Owner

I suppose it's okay. You might say @lyv (or is it @smiley on there) ?
Another option is to mark the first commit with --author but since it's not the exact version he made he is not really the full author.

I suppose it's okay. You might say @lyv (or is it @smiley on there) ? Another option is to mark the first commit with --author but since it's not the exact version he made he is not really the full author.
phosit merged commit a0a4ca56a5 into main 2024-09-26 19:47:41 +02:00
phosit deleted branch atlas_biome_dropdown 2024-09-26 19:47:42 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: 0ad/0ad#7065
No description provided.