diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index 90e215c..cfcccb1 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -2223,7 +2223,7 @@ class BuiltinFunction } if(projectname == "") { - projectname = p.currentProject; + projectname = p.project.currentProject; } if(resname == "TXT") { @@ -2256,7 +2256,7 @@ class BuiltinFunction } if(projectname == "") { - projectname = p.currentProject; + projectname = p.project.currentProject; } if(resname == "" || resname.indexOf("PRG") == 0) { @@ -2294,20 +2294,20 @@ class BuiltinFunction { throw new IllegalFunctionCall("PROJECT"); } - p.currentProject = name; + p.project.currentProject = name; return; } throw new CantUseInProgram("PROJECT"); } static void PROJECT(PetitComputer p, out Array!wchar name) { - name = new Array!wchar(cast(wchar[])p.currentProject.dup); + name = new Array!wchar(cast(wchar[])p.project.currentProject.dup); } //FILES TYPE$ //((TXT|DAT):)?\w+/? static void FILES(PetitComputer p) { - FILES(p, Value(cast(wchar[])p.currentProject)); + FILES(p, Value(cast(wchar[])p.project.currentProject)); } static void FILES(PetitComputer p, Value nameOrArray) { @@ -2340,7 +2340,7 @@ class BuiltinFunction } else if (nameOrArray.type == ValueType.StringArray) { - FILES(p, p.currentProject, nameOrArray); + FILES(p, p.project.currentProject, nameOrArray); } else { diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 0d7125e..3cd2e45 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -296,10 +296,8 @@ class PetitComputer } int[2] bgpage; Projects project; - wstring currentProject; void init() { - currentProject = ""; project = new Projects("."); // DerelictGL.load(); if(!exists(resourcePath)) @@ -1035,7 +1033,7 @@ class PetitComputer } void printPrompt() { - if(currentProject.length) console.print("[", currentProject, "]"); + if(project.currentProject.length) console.print("[", project.currentProject, "]"); console.print("OK\n"); } Console console; diff --git a/SMILEBASIC/project.d b/SMILEBASIC/project.d index 01231a5..fcda457 100644 --- a/SMILEBASIC/project.d +++ b/SMILEBASIC/project.d @@ -17,6 +17,7 @@ enum DialogResult class Projects { + wstring currentProject; wstring rootPath; wstring projectPath; string projectPathU8;