25 const ImVec2 display = ImGui::GetIO().DisplaySize;
26 ImGui::SetNextWindowPos({display.x / 2, display.y * 0.75f},
27 ImGuiCond_Appearing, {0.5f, 0.5f});
28 ImGui::SetNextWindowSize({
Ui(380.0f), 0.0f});
31 ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings);
32 ImGui::TextWrapped(
"%s",
33 Tr(
"Give me a few words, and I'll tell you a story."));
36 ImGui::SetKeyboardFocusHere();
39 ImGui::SetNextItemWidth(-FLT_MIN);
40 const bool entered = ImGui::InputTextWithHint(
41 "##words",
Tr(
"dragon, castle, gold"), words_.data(), words_.size(),
42 ImGuiInputTextFlags_EnterReturnsTrue);
43 const bool asked =
GameButton(
"Tell me a story", {-1.0f, 0.0f},
true);
44 std::optional<protocol::Talk> talk;
45 if ((entered || asked) && words_[0] !=
'\0') {
48 talk->set_words(words_.data());