From ad5ea75d2c5cb1dae81b29f94b26a6fd429f7cf9 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 16 Dec 2019 22:27:25 +0000 Subject: Moved config file to global settings dir. --- global.bmx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'global.bmx') 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 -- cgit v1.2.3