Dmitry S лет назад: 4
Родитель
Сommit
636e96cd0a
6 измененных файлов с 89 добавлено и 9 удалено
  1. 3 0
      README.md
  2. 33 0
      S_DIALOG.def
  3. 29 0
      config_generator.js
  4. 10 2
      index.js
  5. 5 3
      manifest.json
  6. 9 4
      module.json

+ 3 - 0
README.md

@@ -1,3 +1,6 @@
 # JustSpamF
 # JustSpamF
 
 
 Changes npc interactions to a form that let you hit `F` to progress including teleportals
 Changes npc interactions to a form that let you hit `F` to progress including teleportals
+
+# Commands
+toggle on/off with `/8 jsf`

+ 33 - 0
S_DIALOG.def

@@ -0,0 +1,33 @@
+uint64 gameId
+int32  type
+uint32 key1
+uint32 key2
+int32  questTaskId
+int32  textId
+uint32 id
+bool   autoClose
+uint32 unk5
+int32  unk6
+int32  unk7
+int32  unk8
+int32  maxRepeatCount
+byte   unk10
+
+array buttons
+- int32  id
+- int32  index
+- int32  type
+- string text
+
+array unkArray
+- uint32 unk1
+- uint32 unk2
+- uint32 unk3
+- uint32 unk4
+- uint32 unk5
+- uint32 unk6
+- uint32 unk7
+- uint32 unk8
+- uint32 unk9
+- uint32 unk10
+- uint32 unk11

+ 29 - 0
config_generator.js

@@ -0,0 +1,29 @@
+'use strict'
+
+const DefaultSettings = { enabled: true }//why am I using this bloat?
+
+module.exports = function MigrateSettings(from_ver, to_ver, settings) {
+  if (from_ver === undefined) {
+    return Object.assign(Object.assign({}, DefaultSettings), settings)
+  } else if (from_ver === null) {
+    return DefaultSettings
+  } else {
+    if (from_ver + 1 < to_ver) {
+      settings = MigrateSettings(from_ver, from_ver + 1, settings)
+      return MigrateSettings(from_ver + 1, to_ver, settings)
+    }
+    switch (to_ver) {
+      default:
+        let oldsettings = settings
+
+        settings = Object.assign(DefaultSettings, {})
+
+        for (let option in oldsettings) {
+          if (settings[option]) { settings[option] = oldsettings[option] }
+        }
+        break
+    }
+
+    return settings
+  }
+}

+ 10 - 2
index.js

@@ -1,7 +1,15 @@
 module.exports = function justspamf(d) {
 module.exports = function justspamf(d) {
-  d.hook('S_DIALOG', 2, (e) => {
-    for (let i = 0; i < e.options.length; i++) {e.options[i].style = 43}
+  if(d.majorPatchVersion == 92) d.dispatch.addDefinition('S_DIALOG', 99, __dirname + '/S_DIALOG.def', true)
+  d.hook('S_DIALOG', '*', (e) => {
+    if (!e.buttons.length || !d.settings.enabled) return
+    for (let i = 0; i < e.buttons.length; i++) { if ([1, 2, 3, 4, 5, 51, 53, 54, 55, 56, 63].includes(e.buttons[i].type)) e.buttons[i].type = 43 }
     e.type = 1
     e.type = 1
     return true
     return true
   })
   })
+  d.command.add('jsf', (arg) => {
+    if (!arg) {
+      d.settings.enabled = !d.settings.enabled
+      d.command.message(`${d.settings.enabled ? 'en' : 'dis'}abled`)
+    }
+  })
 }
 }

+ 5 - 3
manifest.json

@@ -1,7 +1,9 @@
 {
 {
     "files": {
     "files": {
-        "README.md": "316aa12aaf8aae78c3ff92ab4c97c75c1fa07872be1eed3e47b7853622317913",
-        "index.js": "927d90b15411759a56e4a177ae725ea39fa8a632aadec18176782d3abd46a4b0",
-        "module.json": "9651ea2208fdf2a840af6bb777ffc79c899aec0bed86aaf4ad6ef8533fb2fd41"
+        "README.md": "c188202dee9f587fdc405f021367b7bf7ea7469af9010610f943001c3fc8bd57",
+        "S_DIALOG.def": "86dedec41fdb60dcf55aa9fc8dc8dd1d6da294c7cf3c08fc0aa7ba865209fd9e",
+        "config_generator.js": "fd4ec54089ed0a66a8d85784d5d0f61fbe93e5b72ac33f765b86a432b98889b4",
+        "index.js": "3524d6d683e2ba5862066d8199c08d0b47670713a7de03668bbb95fa61543543",
+        "module.json": "44c7bc4a9df0c2aeb52c4e71f83ed71604ebdd52da7e95784317c25dc6764e06"
     }
     }
 }
 }

+ 9 - 4
module.json

@@ -2,11 +2,16 @@
     "disableAutoUpdate": false,
     "disableAutoUpdate": false,
     "options": {
     "options": {
         "niceName": "JustSpamF",
         "niceName": "JustSpamF",
-        "guiName": "JustSpamF"
+        "guiName": "JustSpamF",
+        "settingsVersion": 4,
+        "settingsFile": "config.json",
+        "settingsMigrator": "config_generator.js"
     },
     },
     "name": "JustSpamF",
     "name": "JustSpamF",
     "author": "Snug",
     "author": "Snug",
-    "description": "Changes npc interactions to a form that let you hit F to progress including teleportals",
-    "version": "1",
-    "servers": ["https://raw.githubusercontent.com/tera-private-mods/JustSpamF/master/"]
+    "donationUrl": "https://play.google.com/store/apps/details?id=com.CarvedGames.SD",
+    "description": "Changes npc interactions to a form that let you hit F to progress including teleportals(/8 jsf to toggle on/off)",
+    "version": "1.4",
+    "servers": ["https://raw.githubusercontent.com/tera-private-mods/JustSpamF/master/"],
+    "supportUrl": "https://github.com/tera-private-mods/JustSpamF/blob/master/README.md"
 }
 }