Browse Source

some changes, PoC code

SaltyMonkey 6 years ago
parent
commit
92b4084a67

+ 17 - 0
README.md

@@ -26,6 +26,23 @@ FPS Manager is modern and extremely customizable module for Tera Toolbox which c
 - Interactive messages (Want to know details about mod automation decisions? Just use interactive mode)
 - Manual mode (can apply your custom settings in middle of combat - use advanced commands to overwrite automation)
 
+## FAQ
+
+Q: Why this mod do not allow change settings individually?
+A: I can agree, for newbie preset based idea can be slightly harder at start to understand but in long run it allows forget about quadrillion commands.
+
+Q: I don't want to use automatic presets. Can i just switch them manually?
+A: Yes
+
+Q: Why some features missing compared to fps utils?
+A: I believe they are useless ones :)
+
+Q: Can i use this mod with fps utils?
+A: Theoretically you can but i can't recommend this.
+
+Q: I tried to edit presets and errors everywhere :(
+A: Presets must be in JSON format without comments
+
 ## Installation
 
 Manual installation:

+ 62 - 0
data/UI/fastaccess.html

@@ -0,0 +1,62 @@
+<html>
+
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<style>
+		body {
+			margin: 0px;
+			overflow: hidden;
+			background-color: rgba(53, 61, 66, 0.8);
+			-webkit-touch-callout: none;
+			-webkit-user-select: none;
+			-khtml-user-select: none;
+			-moz-user-select: none;
+			-ms-user-select: none;
+		}
+
+		.ui {
+			display: flex;
+			flex-grow: 1;
+			flex-flow: row;
+		}
+
+		.ui>button {
+			font-size: larger;
+			margin-left: 4px;
+			margin-top: 4px;
+			margin-bottom: 4px;
+			border: 0px;
+			background-color: #292F33;
+			color: white;
+			transition: background ease 0.3s;
+		}
+
+		.ui>button:focus {
+			outline: 0;
+		}
+
+		.ui>button:hover {
+			background-color: red;
+		}
+		.dragger {
+			margin-left: 4px;
+			width: 16px;
+		}
+	</style>
+	<script>
+
+	</script>
+</head>
+
+<body>
+	<div class="ui">
+		<button>1</button>
+		<button>2</button>
+		<button>3</button>
+		<button>4</button>
+		<button>5</button>
+		<div class="dragger" style="-webkit-app-region: drag"></div>
+	</div>
+</body>
+
+</html>

+ 14 - 0
data/UI/fastaccess.js

@@ -0,0 +1,14 @@
+"use strict";
+/* eslint-disable node/no-missing-require */
+/* eslint-disable global-require */
+/* eslint-disable default-case */
+/* eslint-disable no-undef */
+document.addEventListener("DOMContentLoaded", () => {
+	//-----------------------
+	// IMPORTS
+	//-----------------------
+	const { Renderer } = require("tera-mod-ui");
+	let mod = new Renderer;
+
+	mod.send("ready");
+});

+ 6 - 4
data/migrationData.js

@@ -1,12 +1,14 @@
 "use strict";
 
 const DefaultSettings = {
-	"enableCommands": true,
-	"customCommandTag": "",
-	"interactiveMode": true,
+	"registerCommands": true,
+	"customCommandsTag": "",
+	"registerUI": false,
+	"registerFastAccessUI": false,
+	"interactive": false,
 	"debugMode": false,
 	"classBasedPresets": false,
-	"applyTriggers": false,
+	"enableEvents": false,
 	"trackPresetsChanges": false
 };
 

+ 6 - 6
docs/commands.md

@@ -4,9 +4,9 @@ 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.|
-| `/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|
+| /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.|
+| /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|

+ 2 - 2
docs/presets.md

@@ -21,12 +21,12 @@ Example: you can create custom preset for your `warrior` with custom modes, anot
 
 ### Naming:
 
-FPS Manager using internal client data instead of hardcoded strings and it leads to some differences in game class naming scheme.
+FPS Manager using internal client data instead of hardcoded strings and it leads to some differences in game class naming scheme. Presets MUST HAVE names from expected preset names list.
+
 
 |  Expected preset name         | Game class           |
 | ------------------------------| ---------------------|
 
-
 ## `Preset` structure
 
 Preset structure MUST HAVE `directives` `object` and `modes` `object`.

+ 2 - 2
docs/settings.md

@@ -4,8 +4,8 @@ Description for all main mod settings.
 
 Settings file path: `<modfolder>/settings/settings.json`. Can be opened with any text editor.
 
-|  Setting             |  Type   | Description                      |
-| ------------------   | -----   | ---------------------------------|
+|  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   |

+ 2 - 2
fpsManager.js

@@ -14,7 +14,7 @@
 * @property {import('./lib/unitState')} data
 * @property {import('./lib/unitTracker')} tracker
 * @property {import('./lib/unitFps')} fps
-* @property {import('./lib/unitControl')} cmd
+* @property {import('./lib/unitCommands')} cmd
 * @property {*} mod
 */
 
@@ -29,7 +29,7 @@ const units = [
 	["data", require("./lib/unitState")],
 	["tracker", require("./lib/unitTracker")],
 	["fps", require("./lib/unitFps")],
-	["cmd", require("./lib/unitControl")]
+	["cmd", require("./lib/unitCommands")]
 ];
 
 class FpsManager {

+ 1 - 1
lib/helpers/watchdog.js

@@ -20,7 +20,7 @@ class Watchdog {
 		fs.watch(path, listener);
 	}
 
-	close() {
+	destructor() {
 		if (this.fsWatcher) this.fsWatcher.close();
 	}
 }

+ 0 - 0
lib/unitControl.js → lib/unitCommands.js


+ 0 - 1
lib/unitFps.js

@@ -296,7 +296,6 @@ class unitFps {
 				event.noctEffect = 0;
 
 				return true;
-
 			}
 		};
 

+ 0 - 0
lib/unitUI.js


+ 1 - 0
settings/presets/common.json

@@ -58,6 +58,7 @@
 			"blockPlayers": false,
 			"blockPlayersOptions": {
 				"all": false,
+				"exceptParty": false,
 				"class": [],
 				"name": []
 			}

+ 5 - 3
settings/settings.json

@@ -1,9 +1,11 @@
 {
 	"registerCommands": true,
 	"customCommandsTag": "",
+	"registerUI": false,
+	"registerFastAccessUI": false,
 	"interactive": false,
 	"debugMode": false,
-	"classBasedPresets": true,
-	"enableEvents": true,
-	"trackPresetsChanges": true
+	"classBasedPresets": false,
+	"enableEvents": false,
+	"trackPresetsChanges": false
 }