summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-09-26 10:53:33 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-09-26 10:53:33 -0400
commit30c6a82fcc50e8fed61550f2cf27bbf4e28338ba (patch)
tree8bf7d2a35114197926440c1f39f452cdb60dd9ab
parente6b76d8828af8cda7fd094f815815aba2d939a3d (diff)
pke-editor: print active player control sets
-rw-r--r--editor/editor.cpp14
-rw-r--r--src/player-input.cpp4
-rw-r--r--src/player-input.hpp1
3 files changed, 18 insertions, 1 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index bf17860..12bc9d0 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -1126,6 +1126,19 @@ void RecordImGuiPlayerInput() {
ImGuiTableFlags_RowBg
};
+
+ pk_arr_t<pke_input_set> &input_sets = pke_input_get_input_sets();
+ pk_arr_t<pke_input_action_set_handle> &active_handles = pke_input_get_active_input_action_set_handles();
+
+ if (ImGui::BeginTable("Active Sets", 1, tableFlags)) {
+ for (u = 0; u < active_handles.next; ++u) {
+ ImGui::TableNextRow();
+ ImGui::TableSetColumnIndex(0);
+ ImGui::Text("Active: %hhu", static_cast<pke_input_action_set_handle_T>(active_handles[u]));
+ }
+ ImGui::EndTable();
+ }
+
if (ImGui::BeginTable("Player Inputs", 9, tableFlags)) {
ImGui::TableSetupColumn("Set Index/Title");
ImGui::TableSetupColumn("Set Flags");
@@ -1138,7 +1151,6 @@ void RecordImGuiPlayerInput() {
ImGui::TableSetupColumn("1 Mods");
ImGui::TableHeadersRow();
- pk_arr_t<pke_input_set> input_sets = pke_input_get_input_sets();
for (u = 0; u < input_sets.next; ++u) {
set = &input_sets[u];
for (i = 0; i < set->actionCount; ++i) {
diff --git a/src/player-input.cpp b/src/player-input.cpp
index 7687b89..c62c957 100644
--- a/src/player-input.cpp
+++ b/src/player-input.cpp
@@ -717,6 +717,10 @@ pk_arr_t<pke_input_set> &pke_input_get_input_sets() {
return registeredInputSets;
}
+pk_arr_t<pke_input_action_set_handle> &pke_input_get_active_input_action_set_handles() {
+ return activeInputSetStack;
+}
+
void pke_input_teardown() {
glfwSetWindowFocusCallback(window, prevWindowFocusCallback);
glfwSetScrollCallback(window, prevScrollCallback);
diff --git a/src/player-input.hpp b/src/player-input.hpp
index 6145a22..eae5f8b 100644
--- a/src/player-input.hpp
+++ b/src/player-input.hpp
@@ -125,6 +125,7 @@ void pke_input_activate_set(pke_input_action_set_handle handle);
void pke_input_deactivate_set(pke_input_action_set_handle handle);
void pke_input_unregister_set(pke_input_action_set_handle handle);
pk_arr_t<pke_input_set> &pke_input_get_input_sets();
+pk_arr_t<pke_input_action_set_handle> &pke_input_get_active_input_action_set_handles();
void pke_input_teardown();
#endif /* PKE_PLAYER_INPUT_HPP */