Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Called from
- ; Uses fwatch to load/save certain user preferences
- ~0.02
- _nil = "scalar bool array string 0xfcffffef";
- @alive player
- _action = _this select 0
- ? _action == "Save" : goto "Save"
- ? _action == "Load" : goto "Load"
- exit
- #Save
- ; Set global vars to default values if first time running FWATCH
- ? Format ["%1", WW4EXT_menukey] == _nil : WW4EXT_menukey = "C"; hintC "WW4 EXT MENU\n-----------------------\nThis seems to be first time using this menu while having FWATCH active\n\nTo open the menu just press the C key.\n\nYou can change the key to be used inside the personal menu, through OPTIONS and then FWATCH."
- ? Format ["%1", WW4EXT_zeroingkey] == _nil : WW4EXT_zeroingkey = "END";
- ? Format ["%1", WW4EXT_switchsightkey] == _nil : WW4EXT_switchsightkey = "DELETE";
- ? Format ["%1", WW4EXT_VD] == _nil : WW4EXT_VD = (call loadFile ":mem getgraphics") select 12;
- call loadFile Format [{:file write WW4EXT.db WW4EXT_menukey "%1"} , WW4EXT_menukey]
- call loadFile Format [{:file write WW4EXT.db WW4EXT_zeroingkey "%1"} , WW4EXT_zeroingkey]
- call loadFile Format [{:file write WW4EXT.db WW4EXT_switchsightkey "%1"} , WW4EXT_switchsightkey]
- call loadFile Format [{:file write WW4EXT.db WW4EXT_VD %1} , WW4EXT_VD]
- player globalChat Format ["Menu key: %1 Zeroing key: %2 Switch sight key: %3 View Distance: %4", WW4EXT_menukey, WW4EXT_zeroingkey, WW4EXT_switchsightkey, WW4EXT_VD]
- exit
- #Load
- _fwatch_error = [true, 0, 0, ""]
- WW4EXT_menukey = call loadFile ":file read WW4EXT.db WW4EXT_menukey"
- WW4EXT_zeroingkey = call loadFile ":file read WW4EXT.db WW4EXT_zeroingkey"
- WW4EXT_switchsightkey = call loadFile ":file read WW4EXT.db WW4EXT_switchsightkey"
- WW4EXT_VD = call loadFile ":file read WW4EXT.db WW4EXT_VD"
- ? !(_fwatch_error select 0) : WW4EXT_menukey=nil; WW4EXT_zeroingkey=nil; WW4EXT_switchsightkey=nil; WW4EXT_VD=nil; goto "Save"
- ? WW4EXT_VD == 0 : WW4EXT_VD=900
- setViewDistance WW4EXT_VD
- ;player globalChat "WW4 EXT menu preferences loaded:"
- player globalChat format ["[WW4EXT Prefs] Menu key: %1 Zeroing key: %2 Switch sight key: %3 View Distance: %4", WW4EXT_menukey, WW4EXT_zeroingkey, WW4EXT_switchsightkey, WW4EXT_VD]
- exit
Add Comment
Please, Sign In to add comment