Base+Snake: Capitalize snake skin names

In Snake, the menu for choosing a skin looked messy due to
inconsistent capitalization. Two skins names were entirely lowercase.
For the sprite-based skins, the menu takes the name of each skin's
directory, so I have capitalized these.

Capitalizing the original snake skin required more change than simply
renaming a directory.
This commit is contained in:
Cubic Love 2023-05-06 16:31:07 +01:00 committed by Jelle Raaijmakers
parent 4b7639c3b5
commit a7600caea1
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00
33 changed files with 5 additions and 5 deletions

View file

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View file

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 210 B

View file

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 191 B

View file

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View file

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View file

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View file

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 168 B

View file

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

View file

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

View file

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View file

@ -68,7 +68,7 @@ ErrorOr<NonnullRefPtr<Game>> Game::try_create()
}
auto color = Color::from_argb(Config::read_u32("Snake"sv, "Snake"sv, "BaseColor"sv, Color(Color::Green).value()));
auto skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "classic"sv);
auto skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Classic"sv);
auto skin = TRY(SnakeSkin::create(skin_name, color));
return adopt_nonnull_ref_or_enomem(new (nothrow) Game(move(food_bitmaps), color, skin_name, move(skin)));

View file

@ -14,7 +14,7 @@ namespace Snake {
ErrorOr<NonnullOwnPtr<SnakeSkin>> SnakeSkin::create(StringView skin_name, Color color)
{
if (skin_name == "classic"sv)
if (skin_name == "Classic"sv)
return try_make<ClassicSkin>(color);
// Try to find an image-based skin matching the name.

View file

@ -59,7 +59,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
game.set_focus(true);
auto high_score = Config::read_u32("Snake"sv, "Snake"sv, "HighScore"sv, 0);
auto snake_skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "classic"sv);
auto snake_skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Classic"sv);
auto& statusbar = *widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar"sv);
statusbar.set_text(0, "Score: 0"sv);
@ -110,7 +110,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (!was_paused)
game.start();
});
change_snake_color->set_enabled(snake_skin_name == "classic"sv);
change_snake_color->set_enabled(snake_skin_name == "Classic"sv);
TRY(game_menu->try_add_action(change_snake_color));
GUI::ActionGroup skin_action_group;
@ -137,7 +137,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(add_skin_action(entry.name, false));
return IterationDecision::Continue;
}));
TRY(add_skin_action("classic"sv, true));
TRY(add_skin_action("Classic"sv, true));
TRY(game_menu->try_add_separator());
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {