Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
1a20872c
Commit
1a20872c
authored
17 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Use try/throw/catch plus the Spidermonkey Error.fileName extension to get
the startup path.
parent
d1739e45
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xtrn/tw2/filename.js
+1
-1
1 addition, 1 deletion
xtrn/tw2/filename.js
xtrn/tw2/tw2.js
+6
-1
6 additions, 1 deletion
xtrn/tw2/tw2.js
xtrn/tw2/twint500.js
+6
-1
6 additions, 1 deletion
xtrn/tw2/twint500.js
with
13 additions
and
3 deletions
xtrn/tw2/filename.js
+
1
−
1
View file @
1a20872c
...
...
@@ -2,5 +2,5 @@ function fname(name)
{
if
(
name
.
search
(
/^
(?:[
A-Z
]
:
)?[\/\\]
/
)
!=-
1
)
return
(
name
);
return
(
"
../xtrn/tw2/
"
+
name
);
return
(
startup_path
+
name
);
}
This diff is collapsed.
Click to expand it.
xtrn/tw2/tw2.js
+
6
−
1
View file @
1a20872c
var
startup_path
=
'
.
'
;
try
{
throw
new
Error
()
}
catch
(
e
)
{
startup_path
=
e
.
fileName
}
startup_path
=
startup_path
.
replace
(
/
\/[^\/]
*$/
,
''
);
startup_path
=
backslash
(
startup_path
);
load
(
"
recordfile.js
"
);
load
(
"
lockfile.js
"
);
load
(
"
../xtrn/tw2/
filename.js
"
);
load
(
startup_path
+
"
filename.js
"
);
load
(
fname
(
"
gamesettings.js
"
));
var
Settings
=
new
GameSettings
();
...
...
This diff is collapsed.
Click to expand it.
xtrn/tw2/twint500.js
+
6
−
1
View file @
1a20872c
load
(
"
../xtrn/tw2/filename.js
"
);
var
startup_path
=
'
.
'
;
try
{
throw
new
Error
()
}
catch
(
e
)
{
startup_path
=
e
.
fileName
}
startup_path
=
startup_path
.
replace
(
/
\/[^\/]
*$/
,
''
);
startup_path
=
backslash
(
startup_path
);
load
(
startup_path
+
"
filename.js
"
);
load
(
fname
(
"
gamesettings.js
"
));
load
(
fname
(
"
sector_map.js
"
));
load
(
fname
(
"
ports_map.js
"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment