generated from Jonathan-Greve/GuildWarsMapBrowser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ShowUpdateOptionsPanel.h
51 lines (44 loc) · 2 KB
/
ShowUpdateOptionsPanel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include "ConnectionData.h"
#include "ImGuiStates.h"
class ShowUpdateOptionsPanel
{
public:
ShowUpdateOptionsPanel()
{
}
void draw(ImGuiStates& imgui_states, ConnectionData& connection_data)
{
if (!ImGui::Begin("Update Options"))
{
// Early out if the window is collapsed, as an optimization.
ImGui::End();
return;
}
for (const auto& connection_id : connection_data.get_connected_client_ids())
{
ImGui::Text("Connection: %s", connection_id.c_str());
const auto update_options = connection_data.get_update_options_for_connection(connection_id);
if (update_options != nullptr)
{
bool only_send_active_quest_description = update_options->only_send_active_quest_description();
bool only_send_active_quest_objectives = update_options->only_send_active_quest_objectives();
bool should_update_client_data = update_options->should_update_client_data();
bool should_render = update_options->should_render();
if (ImGui::Checkbox((connection_id + ": only send active quest description").c_str(), &only_send_active_quest_description) ||
ImGui::Checkbox((connection_id + ": only send active quest objectives").c_str(), &only_send_active_quest_objectives) ||
ImGui::Checkbox((connection_id + ": should update client data").c_str(), &should_update_client_data) ||
ImGui::Checkbox((connection_id + ": should render").c_str(), &should_render ))
{
connection_data.set_update_options_for_connection(
connection_id,
only_send_active_quest_description,
only_send_active_quest_objectives,
should_update_client_data,
should_render);
}
}
}
ImGui::End();
}
};