Unify Modern dropdown menus with Gold layout and safe keyboard selection (by Codex)
This commit is contained in:
1 parent
e81ecf95f2
commit
fff2cc2f0b
18 files changed
+1361
-17
No files matched your search
@@ -216,7 +216,7 @@ void App::entry_confirm() {
|
||||
refresh();
|
||||
}
|
||||
bool App::entry_action(const std::string &action, Rml::Element *target) {
|
||||
if ((scene_ != "newgame" && scene_ != "manager") || !popup_.empty())
|
||||
if ((scene_ != "newgame" && scene_ != "manager") || !popup_.empty() || menu_ == "quit")
|
||||
return false;
|
||||
const auto id =
|
||||
target ? target->GetAttribute<Rml::String>("data-id", "") : std::string();
|
||||
@@ -339,7 +339,7 @@ bool App::entry_action(const std::string &action, Rml::Element *target) {
|
||||
refresh();
|
||||
return true;
|
||||
}
|
||||
bool App::entry_change(Rml::Element *target) {
|
||||
bool App::entry_change(Rml::Element *target, bool user_reselected) {
|
||||
if (scene_ != "manager" || manager_confirm_ || manager_success_)
|
||||
return false;
|
||||
const auto kind = target->GetAttribute<Rml::String>("data-change", "");
|
||||
@@ -357,16 +357,17 @@ bool App::entry_change(Rml::Element *target) {
|
||||
if (!manager_picker_)
|
||||
selections_["manager-name"] = field("manager-name");
|
||||
if (kind == "manager-country") {
|
||||
if (value == country_)
|
||||
if (value == country_ && !user_reselected)
|
||||
return true;
|
||||
country_ = value;
|
||||
league_.clear();
|
||||
} else {
|
||||
if (value == league_)
|
||||
if (value == league_ && !user_reselected)
|
||||
return true;
|
||||
league_ = value;
|
||||
}
|
||||
club_search_.clear();
|
||||
if (!manager_picker_ && user_reselected) selected_club_.clear();
|
||||
if (manager_picker_) {
|
||||
const auto leagues = entry_world()->leagues(country_);
|
||||
if (std::none_of(leagues.begin(), leagues.end(),
|
||||
@@ -406,7 +407,7 @@ bool App::entry_input(Rml::Element *target) {
|
||||
return true;
|
||||
}
|
||||
bool App::entry_event(Rml::Event &event) {
|
||||
if ((scene_ != "newgame" && scene_ != "manager") || !popup_.empty())
|
||||
if ((scene_ != "newgame" && scene_ != "manager") || !popup_.empty() || menu_ == "quit")
|
||||
return false;
|
||||
const auto type = event.GetType();
|
||||
auto *target = event.GetTargetElement();
|
||||
|
||||
Reference in new issue
Block a user