36 const std::vector<Figure>& figures,
const protocol::World& world) {
40 const auto you = std::ranges::find_if(figures, &
Figure::you);
41 const int level = you != figures.end() ? you->level : 0;
42 const ImVec2 display = ImGui::GetIO().DisplaySize;
43 ImGui::SetNextWindowPos({display.x / 2, display.y * 0.7f},
44 ImGuiCond_Appearing, {0.5f, 0.5f});
45 ImGui::SetNextWindowSize({
Ui(360.0f), 0.0f});
48 ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings);
49 ImGui::TextWrapped(
"%s",
50 Tr(
"I can teach you these, once you're ready for them."));
52 std::optional<protocol::Learn> learn;
53 for (
const uint32_t
id : teaches_) {
54 const skills::Skill& skill = skills_.by_id.at(
id);
55 ImGui::PushID(
static_cast<int>(
id));
56 ImGui::AlignTextToFramePadding();
57 ImGui::Text(
"%s %s",
Icon(skill.look().icon()).c_str(),
NameOf(skill));
58 ImGui::SameLine(
Ui(kButtons));
59 if (std::ranges::find(world.skills(),
id) != world.skills().end()) {
60 ImGui::TextDisabled(
"%s",
Tr(
"Known"));
61 }
else if (level <
static_cast<int>(skill.level())) {
63 "%s", absl::Substitute(
Tr(
"From level $0"), skill.level()).c_str());
66 learn->set_npc(*npc_);