Skip to content

Commit

Permalink
fix additional sky marking widget
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxor4d committed Feb 16, 2024
1 parent 2ea90da commit f0955a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/modules/rtx/rtx_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@ namespace components
{
static char edit_buffer[1024] = {};
static bool edit_buffer_update = *dvars::rtx_sky_materials->current.string;
static bool edit_buffer_update_init = false;

ImGui::Text("Sky Materials (editable). Format <string string string ...>");
ImGui::InputTextMultiline("##edit_mats", edit_buffer, IM_ARRAYSIZE(edit_buffer), ImVec2(ImGui::GetWindowWidth() - 54.0f, ImGui::GetTextLineHeight() * 3));

if (ImGui::Button("Refresh") || edit_buffer_update)
if ((ImGui::Button("Refresh") && edit_buffer_update) || (!edit_buffer_update_init && edit_buffer_update))
{
edit_buffer_update_init = true;
memset(&edit_buffer, 0, IM_ARRAYSIZE(edit_buffer));
memcpy(&edit_buffer, dvars::rtx_sky_materials->current.string, strlen(dvars::rtx_sky_materials->current.string));
}
Expand Down

0 comments on commit f0955a8

Please sign in to comment.