19 void loadGameTable(std::filesystem::path game_table_file_path);
92 ImGuiIO& io = ImGui::GetIO();
96 if ((io.MouseClicked[0] || io.MouseClicked[1] || io.MouseClicked[2]) && !is_mouse_within_image_bounds && is_map_window_hovered)
100 if (io.MouseReleased[0] || io.MouseReleased[1] || io.MouseReleased[2])
110 if (is_mouse_within_image_bounds && is_map_window_hovered)
112 if (io.MouseClicked[0])
116 if (io.MouseClicked[1])
120 if (io.MouseClicked[2])
127 if (io.MouseReleased[0])
131 if (io.MouseReleased[1])
135 if (io.MouseReleased[2])
144 ImGui::TextUnformatted(label);
146 ImGui::TextUnformatted(value.c_str());
151 const char* toastId,
float seconds = 1.5f)
153 static std::unordered_map<std::string, double> s_toasts;
154 bool clicked = ImGui::Button(btnId);
157 ImGui::SetClipboardText(toCopy.c_str());
158 s_toasts[toastId] = ImGui::GetTime() + seconds;
160 if (
auto it = s_toasts.find(toastId); it != s_toasts.end())
162 if (ImGui::GetTime() < it->second)
165 ImGui::TextColored(ImVec4(0.4f, 1.f, 0.4f, 1.f),
"Copied!");
177 const char* text,
float seconds = 2.0f)
179 static std::unordered_map<std::string, double> s_until;
181 s_until[key] = ImGui::GetTime() + seconds;
182 if (
auto it = s_until.find(key); it != s_until.end())
184 if (ImGui::GetTime() < it->second)
186 ImGui::TextColored(color,
"%s", text);
197 char* passBuf,
size_t passBufSize)
199 ImGui::InputText(
"Password", passBuf, passBufSize, ImGuiInputTextFlags_Password);
201 ImGui::InputText(
"Port", portBuf, portBufSize, ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsNoBlank);
209 bool confirmed =
false;
210 ImVec2 center = ImGui::GetMainViewport()->GetCenter();
211 ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
212 if (ImGui::BeginPopupModal(popupId,
nullptr, ImGuiWindowFlags_AlwaysAutoResize))
214 ImGui::TextUnformatted(title);
216 ImGui::TextWrapped(
"%s", text);
218 if (ImGui::Button(
"Yes"))
221 ImGui::CloseCurrentPopup();
224 if (ImGui::Button(
"No"))
226 ImGui::CloseCurrentPopup();
264 boardEnt.children([&](flecs::entity child)
267 if (
auto id = child.get<
Identifier>();
id &&
id->id == markerId)
274 using Clock = std::chrono::steady_clock;
275 using namespace std::chrono;
276 return duration_cast<milliseconds>(Clock::now().time_since_epoch()).count();
std::chrono::steady_clock Clock