From 3511aff224b3ce440ffc363745db5cabb1c5bad6 Mon Sep 17 00:00:00 2001
From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com>
Date: Thu, 10 Nov 2022 15:42:27 +0100
Subject: [PATCH] Execute "bind.cfg" on startup

Users could put custom binds in here.
I also unbound all dev-only binds by default to suppress warnings or prevent issues.
---
 r5dev/engine/host_state.cpp |  3 +++
 r5dev/resource/cfg/bind.cfg | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 r5dev/resource/cfg/bind.cfg

diff --git a/r5dev/engine/host_state.cpp b/r5dev/engine/host_state.cpp
index b1152788..559dcfc4 100644
--- a/r5dev/engine/host_state.cpp
+++ b/r5dev/engine/host_state.cpp
@@ -329,6 +329,9 @@ FORCEINLINE void CHostState::LoadConfig(void) const
 #endif // !DEDICATED
 			Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_dev.cfg\"", cmd_source_t::kCommandSrcCode);
 		}
+#ifndef DEDICATED
+		Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"bind.cfg\"", cmd_source_t::kCommandSrcCode);
+#endif // !DEDICATED
 		Cbuf_Execute();
 	}
 }
diff --git a/r5dev/resource/cfg/bind.cfg b/r5dev/resource/cfg/bind.cfg
new file mode 100644
index 00000000..e559c5b8
--- /dev/null
+++ b/r5dev/resource/cfg/bind.cfg
@@ -0,0 +1,15 @@
+///////////////// input_system configuration file.
+// This file is executed automatically on startup.
+
+////////////////////////////////
+//// DO NOT SHIP (DEV-ONLY) ////
+////////////////////////////////
+unbind_US_standard      "`"                                             //  "toggleconsole"              (script-only).
+unbind_US_standard      "f10"                                           //  "screenshotDevNet_noRPROF"   (dev-only).
+unbind_US_standard      "f12"                                           //  "screenshotDevNet"           (dev-only).
+
+//////////////////////////
+//// UTILITY          ////
+//////////////////////////
+bind_US_standard        "f11"           "screenshot"                0	// Take screenshot TGA screenshot.
+bind_US_standard        "f12"           "jpeg"                      0	// Take screenshot JPG screenshot.