summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2019-12-16 22:27:25 +0000
committerIan C <ianc@noddybox.co.uk>2019-12-16 22:27:25 +0000
commitad5ea75d2c5cb1dae81b29f94b26a6fd429f7cf9 (patch)
treef039c60812bf67015e97456b535a1e6f213b19c0
parent0cdd3d106b542c4f7e04aea56390363d2cb2a93d (diff)
Moved config file to global settings dir.
-rw-r--r--global.bmx18
1 files changed, 16 insertions, 2 deletions
diff --git a/global.bmx b/global.bmx
index ed55299..131799d 100644
--- a/global.bmx
+++ b/global.bmx
@@ -23,6 +23,7 @@
Strict
Import brl.pngloader
Import brl.timerdefault
+Import brl.volumes
Import noddybox.bitmapfont
Import noddybox.gfxmenu
@@ -113,9 +114,20 @@ Type GameConfig
Global hiscore:Int
Global maxlevel:Int
Global accepted:Int
+ Global path:String
+
+ Function InitPath()
+ If path = "" Then
+ path = GetUserAppDir() + "/MissileLock"
+ CreateDir path
+ path = path + "/missile_lock.config"
+ End If
+ End Function
Function Load()
- Local s:TStream=ReadStream("mlock.config")
+ InitPath()
+
+ Local s:TStream=ReadStream(path)
If s=Null
kleft=KEY_LEFT
@@ -142,7 +154,9 @@ Type GameConfig
End Function
Function Save()
- Local s:TStream=WriteStream("mlock.config")
+ InitPath()
+
+ Local s:TStream=WriteStream(path)
If s=Null
Return