Browse Source

basic docs

SaltyMonkey 6 years ago
parent
commit
973b49747d
5 changed files with 111 additions and 7 deletions
  1. 12 0
      docs/commands.md
  2. 84 0
      docs/presets.md
  3. 14 0
      docs/settings.md
  4. 0 6
      lib/unitControl.js
  5. 1 1
      lib/unitFps.js

+ 12 - 0
docs/commands.md

@@ -0,0 +1,12 @@
+## FPS Manager chat commands
+
+Full list for all in-game chat commands
+
+|  Command         | Alias        | Description                                        |
+| --------------   | -------------| ---------------------------------------------------|
+| `/8 fm help`     | `/8 fn h`    | Print compact command list in Toolbox chat |
+| `/8 fm auto`     | `/8 fn a`    | Enable/Disable automatic mode changes based on events. `Keeps current activated mode!` |
+| `/8 fm mode <name>` | `/8 fn m <name>`| Forcefully enable desired `mode` from active `preset`|
+| `/8 fm class <name>` | `/8 fn c <name>`| Enable/Disable per-class `presets`. Will need relog|
+| `/8 fm debug` | `/8 fn d`| Enable/Disable some inbuild debug features|
+| `/8 fm interactive` | `/8 fn i`| Enable/Disable interactive messages in chat when `modes` changes|

+ 84 - 0
docs/presets.md

@@ -0,0 +1,84 @@
+## FPS Manager presets
+
+`Presets` are main part of FPS Manager functionality. Every preset is JSON formatted file with included information about settings and available behaviors.
+
+Path for preset folder: `<modfolder>/settings/presets/`
+
+### Vocabulary:
+
+* `Preset` - JSON formatted file, includes `directives` and `modes`
+* `Mode` - concrete set of setting
+* `Directives` - service part in every `preset`. Describes started point, and events behavior.
+
+## `Preset` structure
+
+Preset structure MUST HAVE `directives` `object` and `modes` `object`.
+
+Simplified example below:
+
+```json
+{
+	
+	"directives": {
+
+		...
+	
+	},
+	"modes": {
+
+		...
+	
+	}
+}
+```
+
+### `directives` object fields
+
+Every `directives` field except `default` can be removed or have value `false` - leads to "no jobs needed by event" state.
+
+Value must be valid key from `modes` object.
+
+Simplified example with explanation (WARNING: you can't place comments as below in real file).
+
+```json
+{
+	...
+	"directives": {
+		"default": "basicMode", //applies mode (NAME) after first login [REQUIRED]
+		"triggerGuardians": "basicMode", //applies mode (NAME) as guardians detected [OPTIONAL]
+		"triggerDungeons": { 
+			"all": "basicMode", //applies mode (NAME) as any dungeon detected [OPTIONAL]
+			"9000": "basicMode" //applies mode (NAME) as dungeon with specified id detected [OPTIONAL]
+		},
+		"triggerCU": "basicMode", //applies mode (NAME) as CU detected [OPTIONAL]
+		"triggerBG": "basicMode", //applies mode (NAME) as battlegrounds detected [OPTIONAL]
+		"triggerOW": "basicMode" //applies mode (NAME) as Open world location detected [OPTIONAL]
+	}
+	...
+
+}
+```
+
+### `modes` object fields
+
+Every `modes` field explains `MODE NAME` and contains ` desired options` as object. This name can be used in in-game commands to forcefully switch mode and can be added to directives as value for options.
+
+
+Value must be valid key from `modes` object.
+Simplified example below: (WARNING: you can't place comments as below in real file)
+
+```JSON
+{	...
+
+	"modes": {
+		"basicMode": { //mode name, can be applied in directives (look example above)
+			...
+		},
+		"myCustomModeName" : { //custom user mode name, can be applied in directives (look example above) or called with commands (as example: /8 fm m myCustomModeName)
+			...
+		}
+	}
+
+	...
+}
+```

+ 14 - 0
docs/settings.md

@@ -0,0 +1,14 @@
+## FPS Manager setting
+
+Description for all main mod settings.
+
+Settings file path: `<modfolder>/settings/settings.json`. Can be opened with any text editor.
+
+|  Setting             |  Type   | Description                      |
+| ------------------   | -----   | ---------------------------------|
+| `registerCommands`   | Boolean | Enable/Disable ingame commands   |
+| `customCommandsTag`  | String  | If not empty string adds additional custom tag for ingame commands   |
+| `interactive`        | Boolean | Enable/Disable additional ingame messages from mod   |
+| `classBasedPresets`  | Boolean | Enable/Disable per-class `presets` usage   |
+| `enableEvents`       | Boolean | Enable/Disable ingame commands   |
+| `enableEvents`       | Boolean | Enable/Disable realtime class presets changes monitoring and reloading  |

+ 0 - 6
lib/unitControl.js

@@ -22,10 +22,6 @@ class unitControl {
 
 
 		console.log("DEBUG: unitControl -> constructor");
 		console.log("DEBUG: unitControl -> constructor");
 
 
-		const infoHandler = () => {
-			deps.mod.command.message("FPS Manager information.");
-		};
-
 		const helpHandler = () => {
 		const helpHandler = () => {
 			deps.mod.command.message("FPS Manager help.");
 			deps.mod.command.message("FPS Manager help.");
 			
 			
@@ -59,8 +55,6 @@ class unitControl {
 		};
 		};
 
 
 		const commands = {
 		const commands = {
-			"i": infoHandler,
-			"info": infoHandler,
 			"a": autoSettingHandler,
 			"a": autoSettingHandler,
 			"auto": autoSettingHandler,
 			"auto": autoSettingHandler,
 			"c": classBasedPresetSettingHandler,
 			"c": classBasedPresetSettingHandler,

+ 1 - 1
lib/unitFps.js

@@ -107,7 +107,7 @@ class unitFps {
 					}
 					}
 				}
 				}
 				else if (data.activeMode.blockPlayersOptions.name) {
 				else if (data.activeMode.blockPlayersOptions.name) {
-					if (utils.arraysHasIntersect(event.name, data.activeMode.blockPlayersOptions.class)) {
+					if (utils.arraysHasIntersect(event.name, data.activeMode.blockPlayersOptions.name)) {
 						return true;
 						return true;
 					}
 					}
 				}
 				}