RigsofRods
2023.09
Soft-body Physics Simulation
Go to the documentation of this file.
32 #include <fmt/format.h>
44 Ogre::String keys_pressed;
47 if (num_nonmodifier_keys > 0)
62 ImGui::SetNextWindowPosCenter();
65 ImGui::Begin(
_LC (
"GameControls" ,
"Press a new key" ), &open, flags);
71 ImGui::Text(keys_pressed.c_str());
77 ImGui::TextDisabled(
"(?)" );
79 if (checkbox_hovered || hint_hovered)
82 ImGui::Text(
"%s" ,
_LC (
"GameControls" ,
83 "With EXPL tag, only exactly matching key combos will be triggered.\n"
84 "Without it, partial matches will trigger, too." ));
86 ImGui::Text(
"%s" ,
_LC (
"GameControls" ,
87 "Example: Pressing CTRL+F1 will trigger COMMANDS_03 and COMMANDS_01\n"
88 "but not COMMANDS_02 which has EXPL tag." ));
89 ImGui::TextDisabled(
" COMMANDS_01 Keyboard F1" );
90 ImGui::TextDisabled(
" COMMANDS_02 Keyboard EXPL+F1" );
91 ImGui::TextDisabled(
" COMMANDS_03 Keyboard CTRL+F1" );
107 bool keep_open =
true ;
108 ImGui::Begin(
_LC (
"GameControls" ,
"Game Controls" ), &keep_open);
116 if (ImGui::Button(
_LC (
"GameControls" ,
"Save changes" )))
121 if (ImGui::Button(
_LC (
"GameControls" ,
"Reset changes" )))
161 float cursor_x = ImGui::GetCursorPosX();
164 int display_count = 0;
169 if (display_count == 0)
184 int num_visible_commands = 0;
190 int num_drawn_commands = 0;
197 ImVec2 cursor_before_command = ImGui::GetCursorScreenPos();
211 num_drawn_commands++;
212 if (num_visible_commands > 1)
214 ImVec2 text_pos = cursor_before_command + ImGui::GetStyle().FramePadding;
216 ImGui::GetWindowDrawList()->AddText(text_pos, text_color,
fmt::format (
"{}." , num_drawn_commands).c_str());
258 ImGui::SetItemDefaultFocus();
265 int flags = ImGuiInputTextFlags_EnterReturnsTrue;
268 flags |= ImGuiInputTextFlags_CharsNoBlank;
272 flags |= ImGuiInputTextFlags_CharsUppercase;
280 if (ImGui::Button(
_LC (
"GameSettings" ,
"OK" )))
285 if (ImGui::Button(
_LC (
"GameSettings" ,
"Cancel" )))
290 if (ImGui::Button(
_LC (
"GameSettings" ,
"Delete" )))
308 if (ev_name.find(prefix) == 0)
329 ImGui::SetColumnWidth(0,
m_colum_widths [0] + ImGui::GetStyle().FramePadding.x + 1);
342 ImGui::BeginChild(
"scroll" );
367 std::string format_string;
370 format_string =
"{} {} {}" ;
374 format_string =
"{} {} 0 {}" ;
void Columns(int=1, const string &in=string(), bool=true)
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_AlwaysAutoResize
Resize every window to its content every frame.
float m_colum_widths[3]
body->header width sync
enum Script2Game::ImGuiStyleVar ImGuiCol_TextDisabled
Str< 1000 > m_active_buffer
GUIManager * GetGuiManager()
ImVec4 value_blue_text_color
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoCollapse
Disable user collapsing window by double-clicking on it.
eventtypes m_selected_evtype
Truck file format(technical spec)
int m_active_mapping_file
enum eventtypes eventtype
size_t GetCapacity() const
bool BeginTabBar(const string &in, int=0)
bool IsItemHovered(int=0)
bool m_interactive_keybinding_expl
void DrawControlsTab(const char *prefix)
Draws table with events matching prefix.
RoR::events m_active_event
event_trigger_t * m_active_trigger
void DrawControlsTabItem(const char *name, const char *prefix)
Wraps DrawControlsTab() with scrollbar and tabs-bar logic.
void DrawEvent(RoR::events ev_code)
One line in table.
enum Script2Game::ImGuiStyleVar ImGuiCond_FirstUseEver
Set the variable if the object/window has no persistently saved data (no entry in ....
int configDeviceID
For which device (which config file) was this binding defined?
void PushID(const string &in)
bool BeginTabItem(const string &in, int=0)
BeginTabItem() without X close button.
const char * ToCStr() const
Central state/object manager and communications hub.
const ImVec4 GRAY_HINT_TEXT
bool ShouldDisplay(event_trigger_t &trig)
InputEngine * GetInputEngine()
float GetColumnWidth(int=-1)
bool IsWindowHovered(int=0)
void SetVisible(bool visible)
void DrawEventEditBox()
Only the editing UI, embeddable.
GUI::GameMainMenu GameMainMenu
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoMove
Disable user moving the window.
bool m_interactive_keybinding_active