diff --git a/resources/scripts/script_editor.as b/resources/scripts/script_editor.as index d6969edaa8..671ce76461 100644 --- a/resources/scripts/script_editor.as +++ b/resources/scripts/script_editor.as @@ -37,6 +37,7 @@ const int BUFFER_MIN_SIZE = 10000; const int BUFFER_INCREMENT_SIZE = 2500; const color LINKCOLOR = color(0.3, 0.5, 0.9, 1.0); ScriptEditorWindow editorWindow; +const uint FILEINFO_COMPRESSEDSIZE_UNKNOWN = uint(-1); // Config: // ------- @@ -461,7 +462,10 @@ class ScriptEditorWindow ImGui::Bullet(); hovered = hovered || ImGui::IsItemHovered(); ImGui::SameLine(); ImGui::Text(filename); hovered = hovered || ImGui::IsItemHovered(); - ImGui::SameLine(); ImGui::TextDisabled("("+formatFloat(float(size)/1000.f, "", 3, 2)+" KB)"); hovered = hovered || ImGui::IsItemHovered(); + if(size != FILEINFO_COMPRESSEDSIZE_UNKNOWN) + { + ImGui::SameLine(); ImGui::TextDisabled("("+formatFloat(float(size)/1000.f, "", 3, 2)+" KB)"); hovered = hovered || ImGui::IsItemHovered(); + } ImGui::SameLine(); if (hovered && (@scriptinfo != null)) { @@ -510,7 +514,10 @@ class ScriptEditorWindow // if we got here, the name isn't in the list yet. // Construct a pseudo-FileInfo format so we can use common helper. - recentScriptsRecord.fileinfos.insertLast({ {'filename', fnameBuf}, {'compressedSize',-1} } ); + recentScriptsRecord.fileinfos.insertLast({ + {'filename', fnameBuf}, + {'compressedSize',FILEINFO_COMPRESSEDSIZE_UNKNOWN} + } ); } }