disable name entry on coolmath build, increase UI arrow visibility
This commit is contained in:
parent
280fc0e0b8
commit
91081b7900
20
config.json
20
config.json
|
@ -77,7 +77,9 @@
|
|||
"blink frequency": 0.35,
|
||||
"splash": [
|
||||
["resource/splash_spacebox.png", [110.0, 161.0, 201.0, 255.0], 2.0]
|
||||
]
|
||||
],
|
||||
"default initials": "AAA",
|
||||
"name entry enabled": true
|
||||
},
|
||||
|
||||
"configuration":
|
||||
|
@ -250,10 +252,10 @@
|
|||
"reset text": "SAVE & EXIT",
|
||||
"reset translation": [0.0, -0.25],
|
||||
"level decrement translation": [-0.67, -0.71],
|
||||
"level decrement text": "<",
|
||||
"level decrement text": "◀",
|
||||
"level decrement dimensions": [40.0, 40.0],
|
||||
"level increment translation": [0.67, -0.71],
|
||||
"level increment text": ">",
|
||||
"level increment text": "▶",
|
||||
"level select translation": [0.0, -0.71],
|
||||
"level select dimensions": [350.0, 22.0],
|
||||
"level select scale": [0.71, 0.04],
|
||||
|
@ -262,25 +264,25 @@
|
|||
"profile dimensions": [320.0, 22.0],
|
||||
"profile scale": [0.71, 0.04],
|
||||
"profile text": "",
|
||||
"profile decrement text": "<",
|
||||
"profile decrement text": "◀",
|
||||
"profile decrement translation": [-0.67, -0.82],
|
||||
"profile increment text": ">",
|
||||
"profile increment text": "▶",
|
||||
"profile increment translation": [0.67, -0.82],
|
||||
"challenge text": "",
|
||||
"challenge translation": [0.0, -0.6],
|
||||
"challenge dimensions": [320.0, 22.0],
|
||||
"challenge scale": [0.71, 0.04],
|
||||
"challenge decrement text": "<",
|
||||
"challenge decrement text": "◀",
|
||||
"challenge decrement translation": [-0.67, -0.6],
|
||||
"challenge increment text": ">",
|
||||
"challenge increment text": "▶",
|
||||
"challenge increment translation": [0.67, -0.6],
|
||||
"view text": "",
|
||||
"view translation": [0.0, -0.925],
|
||||
"view dimensions": [320.0, 22.0],
|
||||
"view scale": [0.71, 0.04],
|
||||
"view decrement text": "<",
|
||||
"view decrement text": "◀",
|
||||
"view decrement translation": [-0.67, -0.925],
|
||||
"view increment text": ">",
|
||||
"view increment text": "▶",
|
||||
"view increment translation": [0.67, -0.925],
|
||||
"volume on texture": "resource/vol.png",
|
||||
"volume off texture": "resource/vol_off.png",
|
||||
|
|
|
@ -104,6 +104,9 @@ Cakefoot::Cakefoot(std::initializer_list<std::string> configuration_merge) : Gam
|
|||
challenge_index = configuration()("progress", "current challenge");
|
||||
view_index = configuration()("progress", "current view");
|
||||
|
||||
/* Initialize name entry */
|
||||
name_entry = configuration()("display", "default initials");
|
||||
|
||||
/* Subscribe to events */
|
||||
delegate().subscribe(&Cakefoot::respond, this);
|
||||
delegate().subscribe(&Cakefoot::respond, this, SDL_MOUSEMOTION);
|
||||
|
@ -394,7 +397,7 @@ void Cakefoot::set_up_buttons()
|
|||
"challenge decrement", "view increment", "view decrement"
|
||||
})
|
||||
{
|
||||
sb::Text text {name == "start" ? fonts.at("glyph") : fonts.at("medium")};
|
||||
sb::Text text {name == "resume" || name == "reset" ? fonts.at("medium") : fonts.at("glyph")};
|
||||
float scale;
|
||||
glm::vec2 dimensions;
|
||||
if (name == "start" || name == "resume" || name == "reset")
|
||||
|
@ -754,6 +757,14 @@ void Cakefoot::set_up_buttons()
|
|||
name_entry[std::stoi(character_index) - 1] = current;
|
||||
set_up_buttons();
|
||||
});
|
||||
if (!configuration()("display", "name entry enabled"))
|
||||
{
|
||||
button.at("name " + character_index + " increment").enabled(false);
|
||||
button.at("name " + character_index + " increment").visible(false);
|
||||
button.at("name " + character_index + " decrement").enabled(false);
|
||||
button.at("name " + character_index + " decrement").visible(false);
|
||||
button.at("name " + character_index).enabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up fullscreen button */
|
||||
|
@ -1914,8 +1925,8 @@ void Cakefoot::respond(SDL_Event& event)
|
|||
}
|
||||
}
|
||||
|
||||
/* Custom keys for name entry */
|
||||
else if (static_cast<std::size_t>(level_index) == configuration()("levels").size() - 1)
|
||||
/* Custom keys for name entry. */
|
||||
else if (static_cast<std::size_t>(level_index) == configuration()("levels").size() - 1 && arcade() && configuration()("display", "name entry enabled"))
|
||||
{
|
||||
if (sb::Delegate::compare(event, "up"))
|
||||
{
|
||||
|
@ -2031,7 +2042,7 @@ void Cakefoot::respond(SDL_Event& event)
|
|||
} } }
|
||||
|
||||
/* Collide with name entry in arcade mode on end screen */
|
||||
else if (static_cast<std::size_t>(level_index) == configuration()("levels").size() - 1 && arcade())
|
||||
else if (static_cast<std::size_t>(level_index) == configuration()("levels").size() - 1 && arcade() && configuration()("display", "name entry enabled"))
|
||||
{
|
||||
for (const std::string& button_name : {std::string("name 1"), std::string("name 2"), std::string("name 3"),
|
||||
"name " + std::to_string(name_entry_index + 1) + " increment",
|
||||
|
|
|
@ -267,7 +267,7 @@ private:
|
|||
bool use_play_button = false, coin_collected = false, blinking_visible = true;
|
||||
ArcadeScores arcade_scores;
|
||||
ArcadeScores::Score arcade_score;
|
||||
std::string name_entry = "AAA";
|
||||
std::string name_entry;
|
||||
sb::Text scoreboard {fonts.at("large")}, thanks {fonts.at("medium")};
|
||||
std::vector<Flame> ending_coins;
|
||||
sb::Color rotating_hue {128, 0, 0, 0};
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
"fullscreen enabled": false,
|
||||
"splash": [
|
||||
["resource/splash_coolmath.png", [36.0, 36.0, 36.0, 255.0], 2.0]
|
||||
]
|
||||
],
|
||||
"default initials": "CMG",
|
||||
"name entry enabled": false
|
||||
},
|
||||
|
||||
"keys":
|
||||
|
|
Loading…
Reference in New Issue