 |
RigsofRods
2023.09
Soft-body Physics Simulation
|
Go to the documentation of this file.
34 #include <fmt/format.h>
59 ImVec2 msg_size(width, (ImGui::GetIO().DisplaySize.y / 3.f) + (2*ImGui::GetStyle().WindowPadding.y));
60 ImVec2 chat_size(width, ImGui::GetTextLineHeightWithSpacing() + 20);
64 msg_pos.y -= chat_size.y;
71 ImGui::SetNextWindowPos(msg_pos);
72 ImGui::SetNextWindowSize(msg_size);
74 ImGui::Begin(
"ChatMessages",
nullptr, msg_flags);
96 ImGui::SetScrollFromPosY(9999);
133 ImGui::SetNextWindowSize(chat_size);
136 ImGui::Begin(
"ChatBottomBar",
nullptr, chat_flags);
145 ImGui::Text(
"%s",
_LC(
"ChatBox",
"Chat history (use mouse wheel to scroll)"));
146 ImGui::Text(
"%s",
_LC(
"ChatBox",
"Message"));
157 const ImGuiInputTextFlags cmd_flags = ImGuiInputTextFlags_EnterReturnsTrue;
171 ImGui::PopStyleColor(2);
172 ImGui::PopStyleVar();
185 const char* username = std::strtok(
nullptr,
" ");
186 const char* message = std::strtok(
nullptr,
" ");
187 if (username !=
nullptr && message !=
nullptr)
198 fmt::format(
_LC(
"ChatBox",
"Whisper message not sent, unknown username: {}"), username));
205 _LC(
"ChatBox",
"usage: /whisper username message"));
212 #endif // USE_SOCKETW
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoScrollbar
Disable scrollbars (window can still scroll with mouse or programmatically)
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoScrollWithMouse
Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to...
GUIManager * GetGuiManager()
void SetKeyboardFocusHere(int=0)
bool m_is_visible
Special: false means 'display only messages'.
bool cvw_filter_area_script
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoCollapse
Disable user collapsing window by double-clicking on it.
ImVec2 cvw_background_padding
Truck file format(technical spec)
void DrawConsoleMessages()
bool cvw_filter_type_notice
size_t GetCapacity() const
@ ImGuiStyleVar_WindowPadding
ImVec2 WindowPadding.
bool cvw_enable_scrolling
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoInputs
ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,...
size_t cvw_msg_duration_ms
Message expiration; 0 means unlimited.
void RequestReloadMessages()
bool cvw_filter_type_error
bool m_scheduled_move_textcursor_to_end
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoResize
Disable user resizing with the lower-right grip.
void BroadcastChatMsg(const char *msg)
Central state/object manager and communications hub.
void SubmitMessage()
Flush the user input box.
bool cvw_filter_area_actor
ImVec2 screen_edge_padding
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoTitleBar
Disable title-bar.
bool IsKeyPressed(int, bool=true)
InputEngine * GetInputEngine()
ConsoleView m_console_view
@ CONSOLE_MSGTYPE_INFO
Generic message.
bool cvw_smooth_scrolling
enum Script2Game::ImGuiStyleVar ImGuiCol_WindowBg
Background of normal windows.
bool cvw_filter_type_warning
bool ImMoveTextInputCursorToEnd(const char *label)
void WhisperChatMsg(RoRnet::UserInfo const &user, const char *msg)
enum Script2Game::ImGuiStyleVar ImGuiWindowFlags_NoMove
Disable user moving the window.