Skip to content

Commit 2b3f2b0

Browse files
committed
property_ui now uses custom layout instead of tables based - ImGui theme now uses style from ocornut/imgui#707 (comment)
1 parent 8b47ccf commit 2b3f2b0

File tree

5 files changed

+232
-90
lines changed

5 files changed

+232
-90
lines changed

current_notes.txt

+10-3
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,24 @@ Written down thoughts to remember stuff:
8686
- There will be a "main" function (not named main) that cs_interface will automatically look for
8787
- This "main" is where all of the real action occurs
8888

89-
- figure out how to move tables vertically in properties
89+
- figure out how to move child windows vertically in properties
9090

9191

92+
- now that property_ui layout has been figured out for the most part, it is time to finally work on attach/remove component
93+
- when attach option selected, a popup will come up with all built-in components (maybe even some hover text)
94+
- when remove option selected, a popup will come up asking if the user is sure (checkbox will be added somewhere to turn this off maybe)
95+
96+
- There should be 2 more options for attaching/removing scripts
97+
- maybe user will also be able to attach scripts through the asset_ui
98+
-
99+
92100

93101

94102
# cs-script - release install
95103
RUN dotnet add package CS-Script --version 4.8.27
96104

97105
dotnet build -o ../../../../../build/source/scripting/cs_interface
98-
99-
106+
100107

101108

102109
- You want a folder with 6 images (.exr, .png, .jpg, .e.tc...)

source/editor/asset/asset_ui.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,14 @@ namespace Yurrgoht {
313313
ImGui::SetNextWindowSize(ImVec2(500.f*m_res_scale, 250.f*m_res_scale), ImGuiCond_Appearing);
314314
char str[import_file.length() + 1]; // Ensure enough space
315315
std::strcpy(str, import_file.c_str());
316-
float file_path_length = ImGui::CalcTextSize((import_file + "....").c_str()).x ;
316+
float file_path_length = ImGui::CalcTextSize((import_file + "....").c_str()).x; // "...." is just for spacing
317317

318318
ImGui::OpenPopup("Import Asset");
319319
if (ImGui::BeginPopupModal("Import Asset", nullptr, ImGuiWindowFlags_NoScrollbar)) {
320320
ImGui::BeginChild("import_option_area", ImVec2(0, -button_pos_y), ImGuiChildFlags_AutoResizeY);
321321
ImGui::Text("Importing gltf:");
322322
//ImGui::SameLine();
323-
(ImGui::GetWindowWidth() > file_path_length) ?
324-
ImGui::PushItemWidth(file_path_length):
325-
ImGui::PushItemWidth(ImGui::GetWindowWidth());
323+
ImGui::PushItemWidth( std::min(ImGui::GetWindowWidth(), file_path_length) );
326324
ImGui::InputText("##import_gltf", str, IM_ARRAYSIZE(str), ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_ElideLeft);
327325
ImGui::PopItemWidth();
328326
ImGui::Separator();

0 commit comments

Comments
 (0)