Tactics as a pencil sketch on the page, after the design
The pitch, the own eleven, the runs of the forwards, the passes and the goal kick are drawn in pencil; their shape follows the settings. Wide players and arrow heads are dragged, the two boxes and the exclamation marks are clicked, the list at the right steps every setting. The question before a change is the same cream note as the other dialogs. The chalkboard picture stays in the library for its tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
03b46a32f7
commit
1af53ec26a
7 files changed
+253
-45
No files matched your search
@@ -141,45 +141,3 @@ std::string App::render_training() {
|
||||
}
|
||||
return body + "</div>" + (engine_mode_ ? engine_sports_footer() : "");
|
||||
}
|
||||
std::string App::render_tactics() {
|
||||
const auto t = engine_mode_ ? engine_tactics_draft_ : snap().state.at("tactics");
|
||||
const std::array<std::string, 8> names = engine_mode_ ? t.at("labels").get<std::array<std::string, 8>>() : std::array<std::string, 8>{
|
||||
"Defensiv / offensiv", "Pass-/Schussbild unten",
|
||||
"Pass-/Schussbild Mitte", "Pass-/Schussbild links",
|
||||
"Flache / hohe Bälle", "Flügelbild links",
|
||||
"Flügelbild rechts", "Einsatz"};
|
||||
const std::array<int, 8> limits = engine_mode_ ? t.at("limits").get<std::array<int, 8>>() : std::array<int, 8>{3, 3, 3, 3, 1, 1, 1, 11};
|
||||
// the board is drawn at 8dp a unit (tactics_diagram: 320 x 200 units); the pitch of the
|
||||
// attitude and the six tiles are its click areas, each with its name underneath
|
||||
const auto tile = [](size_t i) { return std::array<int, 2>{168 + int((i - 1) % 3) * 46, i <= 3 ? 30 : 80}; };
|
||||
std::string body =
|
||||
"<div class=\"tactics-board\">" +
|
||||
picture(renderer_.diagram("tactics", tactics_diagram(t, theme_, engine_mode_ ? t.at("board").at("points") : snap().state.value("lineup", Json::object()).value("points", Json()), engine_mode_ ? t.at("board").at("depth_max").get<int>() : 18, engine_mode_ ? t.at("board").at("lane_max").get<int>() : 8)), 2560, 1600);
|
||||
static const std::array<const char *, 7> chalk_names{"GRUNDAUSRICHTUNG", "FLÜGELSPIEL", "STEILPÄSSE", "ABSCHLAG", "FLACH / HOCH", "ABSEITSFALLE", "PRESSING"};
|
||||
for (size_t i = 0; i < 7; ++i) {
|
||||
const std::array<int, 4> a = i ? std::array<int, 4>{tile(i)[0], tile(i)[1], 40, 46} : std::array<int, 4>{20, 30, 132, 96};
|
||||
const bool off = i >= 5 && t["values"][i].get<int>() == 0;
|
||||
body += "<div class=\"tactic-chalk-name" + std::string(off ? " off" : "") + "\" style=\"position:absolute;" +
|
||||
rect((a[0] - 6) * 8, (a[1] + a[3] - 11) * 8, (a[2] + 12) * 8, 80) + "\"><span>" + chalk_names[i] + "</span></div>";
|
||||
body += btn("tactic-cycle", "", "tactic-hotspot",
|
||||
"id=\"tactic-cycle-" + std::to_string(i) + "\" data-id=\"" +
|
||||
std::to_string(i) + "\" aria-label=\"" + esc(names[i]) +
|
||||
"\" style=\"position:absolute;" + rect(a[0] * 8, a[1] * 8, a[2] * 8, a[3] * 8) + "\"");
|
||||
}
|
||||
const int effort = t["values"][7].get<int>();
|
||||
body +=
|
||||
"<div class=\"tactic-effort\"><div "
|
||||
"class=\"tactic-effort-label\"><span>EINSATZ</span><span "
|
||||
"id=\"tactic-effort-value\" class=\"tactic-effort-marks\">" +
|
||||
std::string(size_t(effort), '!') +
|
||||
"</span></div><input type=\"range\" id=\"tactic-effort\" "
|
||||
"data-input=\"tactic-effort\" min=\"" + std::to_string(engine_mode_ ? t.at("minima")[7].get<int>() : 0) + "\" max=\"" + std::to_string(limits[7]) + "\" step=\"1\" value=\"" +
|
||||
std::to_string(effort) +
|
||||
"\"/><div class=\"tactic-effort-ends\"><span>LOCKER</span><span>VOLLGAS</span></div></div><p id=\"tactic-hint\" class=\"tactic-hint\">" +
|
||||
(engine_mode_
|
||||
? "<strong>" + esc(names[size_t(last_tactic_)] + ": " + tactic_value_text(size_t(last_tactic_), t["values"][size_t(last_tactic_)].get<int>(), limits[size_t(last_tactic_)])) + "</strong><span>" + esc(tactic_effect_text(size_t(last_tactic_))) + "</span>"
|
||||
: esc(names[size_t(last_tactic_)]) + ": " +
|
||||
std::to_string(t["values"][size_t(last_tactic_)].get<int>()) + " / " +
|
||||
std::to_string(limits[size_t(last_tactic_)])) + "</p></div>";
|
||||
return body + (engine_mode_ ? engine_sports_footer() : "");
|
||||
}
|
||||
Reference in new issue
Block a user