-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.coffee
72 lines (65 loc) · 2.63 KB
/
index.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{CompositeDisposable} = require 'atom'
copyNewer = require 'copy-newer'
buildProject = require './lib/build-project'
openLatestRptFile = require './lib/open-latest-rpt-file'
optionalAutocomplete = require './lib/optional-autocomplete'
module.exports =
subscriptions: null
config:
appDataFolder:
title: "Arma 3 AppData Folder",
description: "Location of the Arma 3 Application Data Folder (location of RPT files)",
type: "string",
default: "%LOCALAPPDATA%\\Arma 3\\"
order: 1
buildDevScript:
title: "Development Build Script",
description: "Location of the Development Build Script (requires a compatible script, such as CBA's or ACE3's build.py)",
type: "string",
default: "<current-project>/tools/build.py"
order: 2
buildReleaseScript:
title: "Release Build Script"
description: "Location of the Release Build Script (requires a compatible script, such as CBA's or ACE3's make.py)"
type: "string"
default: "<current-project>/tools/make.py"
order: 3
autocomplete:
title: "Autocomplete"
type: "object"
order: 4
properties:
includeCba:
title: "Include CBA"
description: "Include CBA commands and snippets in autocomplete suggestions (requires restart)"
type: "boolean"
default: true
order: 1
includeAce:
title: "Include ACE3"
description: "Include ACE3 commands and snippets in autocomplete suggestions (requires restart)"
type: "boolean"
default: true
order: 2
activate: ->
@subscriptions = new CompositeDisposable
@subscriptions.add atom.commands.add 'atom-workspace',
'language-arma-atom:build-dev': => buildProject.dev()
@subscriptions.add atom.commands.add 'atom-workspace',
'language-arma-atom:build-release': => buildProject.release()
@subscriptions.add atom.commands.add 'atom-workspace',
'language-arma-atom:open-latest-RPT-file': => openLatestRptFile.open()
# If package is updated, copy required autosuggest files
copyNewer "language-sqf-native*", "#{__dirname}/snippets", {
cwd: "#{__dirname}/snippetsAvailable"
}
copyNewer "language-sqf-native*", "#{__dirname}/settings", {
cwd: "#{__dirname}/settingsAvailable"
}
# Copy optional autosuggest files
atom.config.observe 'language-arma-atom.autocomplete.includeCba', (checked) ->
optionalAutocomplete.set('cba', checked)
atom.config.observe 'language-arma-atom.autocomplete.includeAce', (checked) ->
optionalAutocomplete.set('ace', checked)
deactivate: ->
@subscriptions.dispose()