1
0

Fix current project

This commit is contained in:
otya128
2016-12-25 14:15:54 +09:00
parent 60e51e4493
commit 5ba4424bb7
3 changed files with 8 additions and 9 deletions

View File

@@ -2223,7 +2223,7 @@ class BuiltinFunction
} }
if(projectname == "") if(projectname == "")
{ {
projectname = p.currentProject; projectname = p.project.currentProject;
} }
if(resname == "TXT") if(resname == "TXT")
{ {
@@ -2256,7 +2256,7 @@ class BuiltinFunction
} }
if(projectname == "") if(projectname == "")
{ {
projectname = p.currentProject; projectname = p.project.currentProject;
} }
if(resname == "" || resname.indexOf("PRG") == 0) if(resname == "" || resname.indexOf("PRG") == 0)
{ {
@@ -2294,20 +2294,20 @@ class BuiltinFunction
{ {
throw new IllegalFunctionCall("PROJECT"); throw new IllegalFunctionCall("PROJECT");
} }
p.currentProject = name; p.project.currentProject = name;
return; return;
} }
throw new CantUseInProgram("PROJECT"); throw new CantUseInProgram("PROJECT");
} }
static void PROJECT(PetitComputer p, out Array!wchar name) 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$ //FILES TYPE$
//((TXT|DAT):)?\w+/? //((TXT|DAT):)?\w+/?
static void FILES(PetitComputer p) 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) static void FILES(PetitComputer p, Value nameOrArray)
{ {
@@ -2340,7 +2340,7 @@ class BuiltinFunction
} }
else if (nameOrArray.type == ValueType.StringArray) else if (nameOrArray.type == ValueType.StringArray)
{ {
FILES(p, p.currentProject, nameOrArray); FILES(p, p.project.currentProject, nameOrArray);
} }
else else
{ {

View File

@@ -296,10 +296,8 @@ class PetitComputer
} }
int[2] bgpage; int[2] bgpage;
Projects project; Projects project;
wstring currentProject;
void init() void init()
{ {
currentProject = "";
project = new Projects("."); project = new Projects(".");
// DerelictGL.load(); // DerelictGL.load();
if(!exists(resourcePath)) if(!exists(resourcePath))
@@ -1035,7 +1033,7 @@ class PetitComputer
} }
void printPrompt() void printPrompt()
{ {
if(currentProject.length) console.print("[", currentProject, "]"); if(project.currentProject.length) console.print("[", project.currentProject, "]");
console.print("OK\n"); console.print("OK\n");
} }
Console console; Console console;

View File

@@ -17,6 +17,7 @@ enum DialogResult
class Projects class Projects
{ {
wstring currentProject;
wstring rootPath; wstring rootPath;
wstring projectPath; wstring projectPath;
string projectPathU8; string projectPathU8;