Improve project name handling

This commit is contained in:
luboslenco
2021-02-15 09:49:37 +01:00
parent 837d7835b8
commit 9d1a00476a
2 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import arm.ui.UIView2D;
import arm.ui.UIFiles;
import arm.ui.UINodes;
import arm.ui.UIToolbar;
import arm.sys.Path;
import arm.data.LayerSlot;
import arm.node.MakeMaterial;
@@ -420,7 +421,8 @@ class History {
}
static function push(name: String): TStep {
kha.Window.get(0).title = UIFiles.filename + "* - ArmorPaint";
var filename = Project.filepath == "" ? UIFiles.filename : Project.filepath.substring(Project.filepath.lastIndexOf(Path.sep) + 1, Project.filepath.length - 4);
kha.Window.get(0).title = filename + "* - ArmorPaint";
if (undos < Config.raw.undo_steps) undos++;
if (redos > 0) {
+3 -3
View File
@@ -104,7 +104,8 @@ class Project {
projectSaveAs();
return;
}
Window.get(0).title = UIFiles.filename + " - ArmorPaint";
var filename = Project.filepath.substring(Project.filepath.lastIndexOf(Path.sep) + 1, Project.filepath.length - 4);
Window.get(0).title = filename + " - ArmorPaint";
function _init() {
ExportArm.runProject();
@@ -476,8 +477,7 @@ class Project {
UIFiles.show("arm", true, function(path: String) {
var f = UIFiles.filename;
if (f == "") f = tr("untitled");
filepath = path + Path.sep + f;
ExportArm.runSwatches(filepath);
ExportArm.runSwatches(path + Path.sep + f);
});
}