diff --git a/generate.bat b/generate.bat new file mode 100644 index 0000000..6534cb3 --- /dev/null +++ b/generate.bat @@ -0,0 +1,6 @@ +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_BossWindow +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_BuffsWindow +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_CharacterWindow +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_FlightGauge +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_LfgWindow +node D:\Repos\tcc-stub\manifest-generator.js D:\Repos\toolbox-client-mods\UI-Remover\remove_PartyWindow \ No newline at end of file diff --git a/remove_BossWindow/S1UI_GageBoss.gpk b/remove_BossWindow/S1UI_GageBoss.gpk index 9799537..582df9c 100644 Binary files a/remove_BossWindow/S1UI_GageBoss.gpk and b/remove_BossWindow/S1UI_GageBoss.gpk differ diff --git a/remove_BossWindow/S1UI_TargetInfo.gpk b/remove_BossWindow/S1UI_TargetInfo.gpk index 9799537..9d6c85f 100644 Binary files a/remove_BossWindow/S1UI_TargetInfo.gpk and b/remove_BossWindow/S1UI_TargetInfo.gpk differ diff --git a/remove_BossWindow/config.json b/remove_BossWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_BossWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_BossWindow/index.js b/remove_BossWindow/index.js index 833338e..b759dfc 100644 --- a/remove_BossWindow/index.js +++ b/remove_BossWindow/index.js @@ -1,10 +1,14 @@ -const config = require('./config.json'); -module.exports = function BossWindow(m) { - let disabled = config.disabled; - if(!disabled) +exports.ClientMod = class +{ + constructor(mod) { - m.installGPK("S1UI_GageBoss.gpk"); - m.installGPK("S1UI_TargetInfo.gpk"); + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + + this.install = function(installer) + { + installer.gpk("S1UI_GageBoss.gpk"); + installer.gpk("S1UI_TargetInfo.gpk"); + }; } - return; } \ No newline at end of file diff --git a/remove_BossWindow/manifest.json b/remove_BossWindow/manifest.json index d659737..1b353be 100644 --- a/remove_BossWindow/manifest.json +++ b/remove_BossWindow/manifest.json @@ -1,12 +1,8 @@ { - "files": { - "S1UI_GageBoss.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "S1UI_TargetInfo.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "d56c771d66b66863fbf4d07d0f70c38549453b1a74827c4cb03ea5625818bdcb", - "module.json": "bc4becd657d3fe54b91d9da3613151dd454d264c25a6f260083b23fe5aab2f33" - } + "files": { + "S1UI_GageBoss.gpk": "7e3fad36d8b96a14d2663694de6d71e7d29b34cbcee850cc700641dcf3946e6d", + "S1UI_TargetInfo.gpk": "0cca883d6a8ca8a07fc336288c5629623983b4e67dbd6292437c83cf03078d91", + "index.js": "c36022123e8cacd69fae0a66bb9bde125942c40ab294f62c626f8c89bb71807b", + "module.json": "2aae4be8802e56f0a13d625079ba43602b7c373449bad207dfed7cda1425576e" + } } \ No newline at end of file diff --git a/remove_BossWindow/module.json b/remove_BossWindow/module.json index f832587..95cc856 100644 --- a/remove_BossWindow/module.json +++ b/remove_BossWindow/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-BossWindow", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { "guiName": "UI Remover: Boss Window", - "niceName": "UI Remover: Boss Window" + "cliName": "UI Remover: Boss Window" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_BossWindow/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_BossWindow/"], + "description": "Hides boss and mobs HP bars." } \ No newline at end of file diff --git a/remove_BuffsWindow/S1UI_Abnormality.gpk b/remove_BuffsWindow/S1UI_Abnormality.gpk index 9799537..2f11451 100644 Binary files a/remove_BuffsWindow/S1UI_Abnormality.gpk and b/remove_BuffsWindow/S1UI_Abnormality.gpk differ diff --git a/remove_BuffsWindow/config.json b/remove_BuffsWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_BuffsWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_BuffsWindow/index.js b/remove_BuffsWindow/index.js index b403a26..375ac7a 100644 --- a/remove_BuffsWindow/index.js +++ b/remove_BuffsWindow/index.js @@ -1,9 +1,13 @@ -const config = require('./config.json'); -module.exports = function BossWindow(m) { - let disabled = config.disabled; - if(!disabled) +exports.ClientMod = class +{ + constructor(mod) { - m.installGPK("S1UI_Abnormality.gpk"); + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + + this.install = function(installer) + { + installer.gpk("S1UI_Abnormality.gpk"); + }; } - return; } \ No newline at end of file diff --git a/remove_BuffsWindow/manifest.json b/remove_BuffsWindow/manifest.json index caf3ee2..7e02262 100644 --- a/remove_BuffsWindow/manifest.json +++ b/remove_BuffsWindow/manifest.json @@ -1,11 +1,7 @@ { - "files": { - "S1UI_Abnormality.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "6fcb895ddb15b055a67e7b52b614c3bf149baa5686c8edcc7f59a0da9b270356", - "module.json": "b9ebc35624697ee1be3a3bc45ddffc7c599e0f2f7289b6b9d81584b5a8ace5e5" - } + "files": { + "S1UI_Abnormality.gpk": "c80e5a537068cddc020d4182ba8d4b074c875f2bd1c30c8c29b58df4a42614b7", + "index.js": "122ec7a9a59d1e7380c7ef19b30cfd6cce30046848972491d96adf10c6b47a67", + "module.json": "f687eb418edbf0e9dc47268c567840555beaf44b2a75d3d36556139ad76b3f08" + } } \ No newline at end of file diff --git a/remove_BuffsWindow/module.json b/remove_BuffsWindow/module.json index 34a9d34..aabf012 100644 --- a/remove_BuffsWindow/module.json +++ b/remove_BuffsWindow/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-Buffs", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { "guiName": "UI Remover: Buff Window", - "niceName": "UI Remover: Buff Window" + "cliName": "UI Remover: Buff Window" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_BuffsWindow/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_BuffsWindow/"], + "description": "Hides buff bar." } \ No newline at end of file diff --git a/remove_CharacterWindow/S1UI_CharacterWindow.gpk b/remove_CharacterWindow/S1UI_CharacterWindow.gpk index 9799537..03a735d 100644 Binary files a/remove_CharacterWindow/S1UI_CharacterWindow.gpk and b/remove_CharacterWindow/S1UI_CharacterWindow.gpk differ diff --git a/remove_CharacterWindow/index.js b/remove_CharacterWindow/index.js index d2ecb99..98cd35d 100644 --- a/remove_CharacterWindow/index.js +++ b/remove_CharacterWindow/index.js @@ -1,9 +1,13 @@ -const config = require('./config.json'); -module.exports = function CharacterWindow(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_CharacterWindow.gpk"); - } - return; +exports.ClientMod = class +{ + constructor(mod) + { + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + + this.install = function(installer) + { + installer.gpk("S1UI_CharacterWindow.gpk"); + }; + } } \ No newline at end of file diff --git a/remove_CharacterWindow/manifest.json b/remove_CharacterWindow/manifest.json index 38e57a2..48fea1a 100644 --- a/remove_CharacterWindow/manifest.json +++ b/remove_CharacterWindow/manifest.json @@ -1,11 +1,11 @@ { - "files": { - "S1UI_CharacterWindow.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "40976a53630397e2c89845d14cfc98e6fb2b8a70c0fffbb0281842c5544e7944", - "module.json": "48f149d8dc2c2fcceb42a90ed9ac46c5c4323bf39abc6e6d2771610055fd1528" - } + "files": { + "S1UI_CharacterWindow.gpk": "8887f3934cc18ebe1d1d483980d50fbd500818c313ca3f16e016908aca03ea53", + "config.json": { + "overwrite": false, + "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" + }, + "index.js": "b8c3e640973eb89c2bfbbd0498cc4265d55020402673b51131c91094199c5903", + "module.json": "fb26d1c98fe9b016253debe17023edf73db4426f1295e676349718ce2236e93d" + } } \ No newline at end of file diff --git a/remove_CharacterWindow/module.json b/remove_CharacterWindow/module.json index ec178dd..a0b0a4f 100644 --- a/remove_CharacterWindow/module.json +++ b/remove_CharacterWindow/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-CharacterWindow", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { "guiName": "UI Remover: Character Window", - "niceName": "UI Remover: Character Window" + "cliName": "UI Remover: Character Window" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_CharacterWindow/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_CharacterWindow/"], + "description": "Removes player HP/MP bars." } \ No newline at end of file diff --git a/remove_ChatWindow/S1UI_Chat2.gpk b/remove_ChatWindow/S1UI_Chat2.gpk deleted file mode 100644 index 58d7dd1..0000000 Binary files a/remove_ChatWindow/S1UI_Chat2.gpk and /dev/null differ diff --git a/remove_ChatWindow/S1UI_ProgressBar.gpk b/remove_ChatWindow/S1UI_ProgressBar.gpk deleted file mode 100644 index 01fc2b0..0000000 Binary files a/remove_ChatWindow/S1UI_ProgressBar.gpk and /dev/null differ diff --git a/remove_ChatWindow/config.json b/remove_ChatWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_ChatWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_ChatWindow/index.js b/remove_ChatWindow/index.js deleted file mode 100644 index 454653f..0000000 --- a/remove_ChatWindow/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const config = require('./config.json'); -module.exports = function Chat(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_Chat2.gpk"); - } - return; -} \ No newline at end of file diff --git a/remove_ChatWindow/manifest-generator.js b/remove_ChatWindow/manifest-generator.js deleted file mode 100644 index 3d323a4..0000000 --- a/remove_ChatWindow/manifest-generator.js +++ /dev/null @@ -1,300 +0,0 @@ -'use strict' - -//////////////////// -// CONFIG // -//////////////////// - -const forceUnixLineEndings = true //force \n instead of \r\n (default: true) - -const removeOldDefs = true // remove undetected defs (default: true) - -const onlyHighestDefVer = false // only greatest def version added to manifest (default: false) - -const addAutoUpdateDisableBool = true // add ("disableAutoUpdate": false) to module.json if missing (default: true) - -const addFolderNameAsName = true // add ("name": ) to module.json if missing (default: true) - -const addAuthorName = "" // add ("author": ) to module.json if missing (default: "") - -const addDescription = "Description goes here." // add ("description": ) to module.json if missing (default: "Description goes here.") - -const addServers = [""] // add ("servers": ) to module.json if missing (default: [""]) - -const addSupportUrl = "" // add ("supportURL": ) to module.json if missing (default: "") - -//////////////////// -// LISTS // -//////////////////// - -// ignore these files for making manifest -const IGNORED_FILES = [ - 'manifest.json', - 'manifest-generator.js', - 'manifest-generator.bat', - 'manifest-generator.exe', - 'node.exe' -] - -// ignore files/folders which start with these characters: i.e. ".git" or "_old" -const IGNORED_CHARACTERS = [ - '.', - '_' -] - -// filetypes to force unix line ending if enabled -const FORCE_UNIX_FILE_TYPES = [ - '.txt', - '.text', - '.js', - '.json', - '.jsn', - '.xml', - '.md', - '.htm', - '.html', - '.css', - '.csv', - '.php', - '.cfg', - '.ini', - '.list', - '.lst' -] - -//////////////////// -// CODE // -//////////////////// - -const crypto = require('crypto'), - fs = require('fs'), - path = require('path') - -// set directory to launch argument or local directory -let directory = __dirname -if (process.argv[2]) { - directory = process.argv[2] - // check if valid directory - try { - fs.readdirSync(directory, 'utf8') - } - catch (err) { - console.log(`"${directory}" is not a valid folder.`) - return - } -} - -// read existing module.json -let modulejson -try { - modulejson = require(path.join(directory, 'module.json')) -} -catch (error) { - modulejson = {} -} -if (addAutoUpdateDisableBool && modulejson.disableAutoUpdate === undefined) { - modulejson.disableAutoUpdate = false -} -if (addFolderNameAsName && modulejson.name === undefined) { - modulejson.name = path.basename(directory) -} -if (addAuthorName && modulejson.author === undefined) { - modulejson.author = addAuthorName -} -if (addDescription && modulejson.description === undefined) { - modulejson.description = addDescription -} -if (addServers && addServers[0] && modulejson.servers === undefined) { - modulejson.servers = addServers -} -if (addSupportUrl && modulejson.supportUrl === undefined) { - modulejson.supportUrl = addSupportUrl -} -fs.writeFileSync(path.join(directory, 'module.json'), jsonify(modulejson), 'utf8') - -// read existing manifest.json -let manifest -try { - // sanitize input - manifest = require(path.join(directory, 'manifest.json')) - if (manifest && typeof manifest === 'object') { - if (!manifest.files) manifest.files = {} - if (removeOldDefs) delete manifest.defs - } - else { - manifest = { - files: {} - } - } -} -catch (error) { - // make new manifest - manifest = { - files: {} - } -} - -// delete removed file entries -let checking = 0 -for (let entry of Object.keys(manifest.files)) { - // check if file exists - checking += 1 - fs.access(path.join(directory, entry), fs.constants.F_OK, (err) => { - checking -= 1 - if (err) delete manifest.files[entry] - checkProg() - return - }) -} - -let reading = 0 -getFiles() - -// get all files in folder and subfolder -function getFiles(relativePath = '', files) { - let dir = path.join(directory, relativePath) - if (!files) files = fs.readdirSync(dir, 'utf8') - for (let file of files) { - // if not ignored file or begins with ignored character - if (!IGNORED_FILES.includes(file) && !IGNORED_CHARACTERS.includes(file[0])) { - reading += 1 - fs.readdir(path.join(dir, file), 'utf8', (err, moreFiles) => { - if (moreFiles) { - getFiles(path.join(relativePath, file), moreFiles) - } - else { - getHash(path.join(relativePath, file)) - } - reading -= 1 - checkProg() - }) - } - } -} - -// get sha256 hash -function getHash(file, type = 'sha256') { - file = file.replace(/\\/g, '/') - // force unix line endings - if (forceUnixLineEndings) forceUnix(file) - // get defs - getDefs(file) - if (manifest.files[file] && typeof manifest.files[file] === 'object') { - manifest.files[file].hash = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } - else { - manifest.files[file] = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } -} - -// get defs -function getDefs(file) { - if (file.slice(-4).includes('.js')) { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - // ignore comments - data = data.replace(/\/\/.*\/\*(?!.*\*\/)/g,'') // ignore: // ... /* ... - data = data.replace(/\/\*[^]*?\*\//gm,'') // ignore: /* ... */ - data = data.replace(/\/\/.*/g,'') // ignore: // ... - data = data.replace(/[A-Z\.]+\.majorPatchVersion/igm,'majorPatchVersion') - let packets = data.match(/['"`][CS]_[A-Z_]+['"`][ \t]*,([ \t\n]*\d+|[ \t\n]*[`'"]raw[`'"`]|[^\n,\]]+)/igm) - //console.log(packets) - if (packets) { - if (!Array.isArray(packets)) packets = [packets] - for (let packet of packets) { - // make defs object for manifest - if (!manifest.defs) manifest.defs = {} - // get def versions - packet = packet.split(',') - let versions = [] - for (let majorPatchVersion = 60; majorPatchVersion <= 100; majorPatchVersion += 1) { - let v - try {v = eval(packet[1])} - catch (err) { - console.log(`eval(${packet[1]})`) - console.log(err) - majorPatchVersion = 101 - } - if (v && !versions.includes(v)) versions.push(v) - } - for (let packetVer of versions) { - // if NaN - if (isNaN(packetVer)) packetVer = String(packetVer).toLowerCase() - // if in manifest - packet[0] = packet[0].replace(/['"` \t\n]/igm, '') - if (manifest.defs[packet[0]]) { - // add to list - if (Array.isArray(manifest.defs[packet[0]])) { - if (!manifest.defs[packet[0]].includes(packetVer)) { - manifest.defs[packet[0]].push(packetVer) - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - } - // change to list - else if (['number', 'string'].includes(typeof manifest.defs[packet[0]]) && manifest.defs[packet[0]] != packetVer) { - manifest.defs[packet[0]] = [manifest.defs[packet[0]], packetVer] - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - // delete other versions - if (onlyHighestDefVer && Array.isArray(manifest.defs[packet[0]])) { - let index = manifest.defs[packet[0]].length - 1 - if (typeof manifest.defs[packet[0]][index] == "string") index -= 1 - manifest.defs[packet[0]] = manifest.defs[packet[0]][index] - } - } - else { - manifest.defs[packet[0]] = packetVer - } - } - } - } - } -} - -// force unix line endings -function forceUnix(file) { - // check if read and writable - for (let type of FORCE_UNIX_FILE_TYPES) { - if (file.slice(-6).includes(type)) { - try { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - data = data.replace(/\r\n/g, '\n') - fs.writeFileSync(path.join(directory, file), data, 'utf8') - } - catch (err) { - //console.log(err) - console.log('Cannot edit protected file: ' + file) - } - return - } - } -} - -// alphabetize object keys -function alphabetizeObject(obj) { - let keys = Object.keys(obj) - keys.sort() - let newObj = {} - for (let key of keys) { - newObj[key] = obj[key] - } - return newObj -} - -// JSON.stringify but make lists single line -function jsonify(obj) { - obj = JSON.stringify(obj, null, ' ') - let lists = obj.match(/\[[^]+?\].*/igm) - if (lists) for (let list of lists) { - obj = obj.substring(0,obj.indexOf(list)) + list.replace(/[ \n\t]*/igm, '') + obj.substring(obj.indexOf(list) + list.length) - } - return obj -} - -// check if process completed -function checkProg() { - if (reading === 0 && checking === 0) { - manifest.files = alphabetizeObject(manifest.files) - if (manifest.defs) manifest.defs = alphabetizeObject(manifest.defs) - fs.writeFileSync(path.join(directory, 'manifest.json'), jsonify(manifest), 'utf8') - console.log('"manifest.json" generation complete.') - } -} \ No newline at end of file diff --git a/remove_ChatWindow/manifest.json b/remove_ChatWindow/manifest.json deleted file mode 100644 index 2b10bc1..0000000 --- a/remove_ChatWindow/manifest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "files": { - "S1UI_Chat2.gpk": "5e6d4efa2d8375cd7029d4d48c91fad1de6e817b64ffe889d6a88a46684a4887", - "S1UI_ProgressBar.gpk": "f269f57e7889046a386ad1a6029738a30ea777402ae12ab3860fe380d018fd2f", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "3a3d0e08d54f7ff301565595008fab9ac75864ff0a22bee96adf3458b1bec9c8", - "module.json": "870ca6a043f5aa2208e95856916b8c2d582ab97b2aac7878d528fcc7dc91c812" - } -} \ No newline at end of file diff --git a/remove_ChatWindow/module.json b/remove_ChatWindow/module.json deleted file mode 100644 index f2c20df..0000000 --- a/remove_ChatWindow/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, - "name": "remove-PartyRaidWindow", - "category": "client", - "author": "Yang", - "options": { - "guiName": "UI Remover: Chat Window", - "niceName": "UI Remover: Chat Window" - }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_ChatWindow/"], - "description": "Description goes here." -} \ No newline at end of file diff --git a/remove_FlightGauge/config.json b/remove_FlightGauge/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_FlightGauge/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_FlightGauge/index.js b/remove_FlightGauge/index.js index eb929db..2bfc487 100644 --- a/remove_FlightGauge/index.js +++ b/remove_FlightGauge/index.js @@ -1,9 +1,13 @@ -const config = require('./config.json'); -module.exports = function ProgressBar(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_ProgressBar.gpk"); - } - return; +exports.ClientMod = class +{ + constructor(mod) + { + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + + this.install = function(installer) + { + installer.gpk("S1UI_ProgressBar.gpk"); + }; + } } \ No newline at end of file diff --git a/remove_FlightGauge/manifest-generator.js b/remove_FlightGauge/manifest-generator.js deleted file mode 100644 index 3d323a4..0000000 --- a/remove_FlightGauge/manifest-generator.js +++ /dev/null @@ -1,300 +0,0 @@ -'use strict' - -//////////////////// -// CONFIG // -//////////////////// - -const forceUnixLineEndings = true //force \n instead of \r\n (default: true) - -const removeOldDefs = true // remove undetected defs (default: true) - -const onlyHighestDefVer = false // only greatest def version added to manifest (default: false) - -const addAutoUpdateDisableBool = true // add ("disableAutoUpdate": false) to module.json if missing (default: true) - -const addFolderNameAsName = true // add ("name": ) to module.json if missing (default: true) - -const addAuthorName = "" // add ("author": ) to module.json if missing (default: "") - -const addDescription = "Description goes here." // add ("description": ) to module.json if missing (default: "Description goes here.") - -const addServers = [""] // add ("servers": ) to module.json if missing (default: [""]) - -const addSupportUrl = "" // add ("supportURL": ) to module.json if missing (default: "") - -//////////////////// -// LISTS // -//////////////////// - -// ignore these files for making manifest -const IGNORED_FILES = [ - 'manifest.json', - 'manifest-generator.js', - 'manifest-generator.bat', - 'manifest-generator.exe', - 'node.exe' -] - -// ignore files/folders which start with these characters: i.e. ".git" or "_old" -const IGNORED_CHARACTERS = [ - '.', - '_' -] - -// filetypes to force unix line ending if enabled -const FORCE_UNIX_FILE_TYPES = [ - '.txt', - '.text', - '.js', - '.json', - '.jsn', - '.xml', - '.md', - '.htm', - '.html', - '.css', - '.csv', - '.php', - '.cfg', - '.ini', - '.list', - '.lst' -] - -//////////////////// -// CODE // -//////////////////// - -const crypto = require('crypto'), - fs = require('fs'), - path = require('path') - -// set directory to launch argument or local directory -let directory = __dirname -if (process.argv[2]) { - directory = process.argv[2] - // check if valid directory - try { - fs.readdirSync(directory, 'utf8') - } - catch (err) { - console.log(`"${directory}" is not a valid folder.`) - return - } -} - -// read existing module.json -let modulejson -try { - modulejson = require(path.join(directory, 'module.json')) -} -catch (error) { - modulejson = {} -} -if (addAutoUpdateDisableBool && modulejson.disableAutoUpdate === undefined) { - modulejson.disableAutoUpdate = false -} -if (addFolderNameAsName && modulejson.name === undefined) { - modulejson.name = path.basename(directory) -} -if (addAuthorName && modulejson.author === undefined) { - modulejson.author = addAuthorName -} -if (addDescription && modulejson.description === undefined) { - modulejson.description = addDescription -} -if (addServers && addServers[0] && modulejson.servers === undefined) { - modulejson.servers = addServers -} -if (addSupportUrl && modulejson.supportUrl === undefined) { - modulejson.supportUrl = addSupportUrl -} -fs.writeFileSync(path.join(directory, 'module.json'), jsonify(modulejson), 'utf8') - -// read existing manifest.json -let manifest -try { - // sanitize input - manifest = require(path.join(directory, 'manifest.json')) - if (manifest && typeof manifest === 'object') { - if (!manifest.files) manifest.files = {} - if (removeOldDefs) delete manifest.defs - } - else { - manifest = { - files: {} - } - } -} -catch (error) { - // make new manifest - manifest = { - files: {} - } -} - -// delete removed file entries -let checking = 0 -for (let entry of Object.keys(manifest.files)) { - // check if file exists - checking += 1 - fs.access(path.join(directory, entry), fs.constants.F_OK, (err) => { - checking -= 1 - if (err) delete manifest.files[entry] - checkProg() - return - }) -} - -let reading = 0 -getFiles() - -// get all files in folder and subfolder -function getFiles(relativePath = '', files) { - let dir = path.join(directory, relativePath) - if (!files) files = fs.readdirSync(dir, 'utf8') - for (let file of files) { - // if not ignored file or begins with ignored character - if (!IGNORED_FILES.includes(file) && !IGNORED_CHARACTERS.includes(file[0])) { - reading += 1 - fs.readdir(path.join(dir, file), 'utf8', (err, moreFiles) => { - if (moreFiles) { - getFiles(path.join(relativePath, file), moreFiles) - } - else { - getHash(path.join(relativePath, file)) - } - reading -= 1 - checkProg() - }) - } - } -} - -// get sha256 hash -function getHash(file, type = 'sha256') { - file = file.replace(/\\/g, '/') - // force unix line endings - if (forceUnixLineEndings) forceUnix(file) - // get defs - getDefs(file) - if (manifest.files[file] && typeof manifest.files[file] === 'object') { - manifest.files[file].hash = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } - else { - manifest.files[file] = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } -} - -// get defs -function getDefs(file) { - if (file.slice(-4).includes('.js')) { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - // ignore comments - data = data.replace(/\/\/.*\/\*(?!.*\*\/)/g,'') // ignore: // ... /* ... - data = data.replace(/\/\*[^]*?\*\//gm,'') // ignore: /* ... */ - data = data.replace(/\/\/.*/g,'') // ignore: // ... - data = data.replace(/[A-Z\.]+\.majorPatchVersion/igm,'majorPatchVersion') - let packets = data.match(/['"`][CS]_[A-Z_]+['"`][ \t]*,([ \t\n]*\d+|[ \t\n]*[`'"]raw[`'"`]|[^\n,\]]+)/igm) - //console.log(packets) - if (packets) { - if (!Array.isArray(packets)) packets = [packets] - for (let packet of packets) { - // make defs object for manifest - if (!manifest.defs) manifest.defs = {} - // get def versions - packet = packet.split(',') - let versions = [] - for (let majorPatchVersion = 60; majorPatchVersion <= 100; majorPatchVersion += 1) { - let v - try {v = eval(packet[1])} - catch (err) { - console.log(`eval(${packet[1]})`) - console.log(err) - majorPatchVersion = 101 - } - if (v && !versions.includes(v)) versions.push(v) - } - for (let packetVer of versions) { - // if NaN - if (isNaN(packetVer)) packetVer = String(packetVer).toLowerCase() - // if in manifest - packet[0] = packet[0].replace(/['"` \t\n]/igm, '') - if (manifest.defs[packet[0]]) { - // add to list - if (Array.isArray(manifest.defs[packet[0]])) { - if (!manifest.defs[packet[0]].includes(packetVer)) { - manifest.defs[packet[0]].push(packetVer) - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - } - // change to list - else if (['number', 'string'].includes(typeof manifest.defs[packet[0]]) && manifest.defs[packet[0]] != packetVer) { - manifest.defs[packet[0]] = [manifest.defs[packet[0]], packetVer] - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - // delete other versions - if (onlyHighestDefVer && Array.isArray(manifest.defs[packet[0]])) { - let index = manifest.defs[packet[0]].length - 1 - if (typeof manifest.defs[packet[0]][index] == "string") index -= 1 - manifest.defs[packet[0]] = manifest.defs[packet[0]][index] - } - } - else { - manifest.defs[packet[0]] = packetVer - } - } - } - } - } -} - -// force unix line endings -function forceUnix(file) { - // check if read and writable - for (let type of FORCE_UNIX_FILE_TYPES) { - if (file.slice(-6).includes(type)) { - try { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - data = data.replace(/\r\n/g, '\n') - fs.writeFileSync(path.join(directory, file), data, 'utf8') - } - catch (err) { - //console.log(err) - console.log('Cannot edit protected file: ' + file) - } - return - } - } -} - -// alphabetize object keys -function alphabetizeObject(obj) { - let keys = Object.keys(obj) - keys.sort() - let newObj = {} - for (let key of keys) { - newObj[key] = obj[key] - } - return newObj -} - -// JSON.stringify but make lists single line -function jsonify(obj) { - obj = JSON.stringify(obj, null, ' ') - let lists = obj.match(/\[[^]+?\].*/igm) - if (lists) for (let list of lists) { - obj = obj.substring(0,obj.indexOf(list)) + list.replace(/[ \n\t]*/igm, '') + obj.substring(obj.indexOf(list) + list.length) - } - return obj -} - -// check if process completed -function checkProg() { - if (reading === 0 && checking === 0) { - manifest.files = alphabetizeObject(manifest.files) - if (manifest.defs) manifest.defs = alphabetizeObject(manifest.defs) - fs.writeFileSync(path.join(directory, 'manifest.json'), jsonify(manifest), 'utf8') - console.log('"manifest.json" generation complete.') - } -} \ No newline at end of file diff --git a/remove_FlightGauge/manifest.json b/remove_FlightGauge/manifest.json index 7d1a66a..6ab40e4 100644 --- a/remove_FlightGauge/manifest.json +++ b/remove_FlightGauge/manifest.json @@ -1,11 +1,7 @@ { - "files": { - "S1UI_ProgressBar.gpk": "f269f57e7889046a386ad1a6029738a30ea777402ae12ab3860fe380d018fd2f", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "46b89215699c1ba518446a12ea0d718b6e224425b4d1ae2ac7e07bcf31cfd1e7", - "module.json": "6915d8d2d23364713c1bd334a9bc095b979b5fd1410b6c7f819ed57bc1dd85ce" - } + "files": { + "S1UI_ProgressBar.gpk": "f269f57e7889046a386ad1a6029738a30ea777402ae12ab3860fe380d018fd2f", + "index.js": "db337f18f13ef51bb9e204f1d9b1156c932efc4c212ff0811ca45475d0e20d81", + "module.json": "75e8001e5b225b66c6de5296fb7330bd3aaae83d8fd6c4bef412bf4a2664063a" + } } \ No newline at end of file diff --git a/remove_FlightGauge/module.json b/remove_FlightGauge/module.json index 7792585..1dc26c5 100644 --- a/remove_FlightGauge/module.json +++ b/remove_FlightGauge/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-FlightGauge", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { "guiName": "UI Remover: Flight Gauge Window", - "niceName": "UI Remover: Flight Gauge Window" + "cliName": "UI Remover: Flight Gauge Window" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_FlightGauge/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_FlightGauge/"], + "description": "Hides flight gauge." } \ No newline at end of file diff --git a/remove_LfgWindow/S1UI_PartyBoard.gpk b/remove_LfgWindow/S1UI_PartyBoard.gpk index 9799537..7d887df 100644 Binary files a/remove_LfgWindow/S1UI_PartyBoard.gpk and b/remove_LfgWindow/S1UI_PartyBoard.gpk differ diff --git a/remove_LfgWindow/S1UI_PartyBoardMemberInfo.gpk b/remove_LfgWindow/S1UI_PartyBoardMemberInfo.gpk index 9799537..a2bfd65 100644 Binary files a/remove_LfgWindow/S1UI_PartyBoardMemberInfo.gpk and b/remove_LfgWindow/S1UI_PartyBoardMemberInfo.gpk differ diff --git a/remove_LfgWindow/config.json b/remove_LfgWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_LfgWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_LfgWindow/index.js b/remove_LfgWindow/index.js index 3f6ffc6..9933b0f 100644 --- a/remove_LfgWindow/index.js +++ b/remove_LfgWindow/index.js @@ -1,10 +1,13 @@ -const config = require('./config.json'); -module.exports = function PartyBoard(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_PartyBoard.gpk"); - m.installGPK("S1UI_PartyBoardMemberInfo.gpk"); - } - return; +exports.ClientMod = class +{ + constructor(mod) + { + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + this.install = function(installer) + { + installer.gpk("S1UI_PartyBoard.gpk"); + installer.gpk("S1UI_PartyBoardMemberInfo.gpk"); + }; + } } \ No newline at end of file diff --git a/remove_LfgWindow/manifest.json b/remove_LfgWindow/manifest.json index a584b48..0a2f945 100644 --- a/remove_LfgWindow/manifest.json +++ b/remove_LfgWindow/manifest.json @@ -1,12 +1,8 @@ { - "files": { - "S1UI_PartyBoard.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "S1UI_PartyBoardMemberInfo.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "37dca3e181179da2f69ee3348ba8f0f73530ba555a3e10e97eff181bcae7b5b3", - "module.json": "afa90e8fc0d9f6b1923db8fe23cc8f82c0538914c34291d12fe3e31292838840" - } + "files": { + "S1UI_PartyBoard.gpk": "a9143c1dfe7bac9607068ab2acda6369bcf698fd78962a430be7b17fdbff30fc", + "S1UI_PartyBoardMemberInfo.gpk": "61127050fbd52a686a0bdc3affc66f86795cd85ccb136f361b43511a72258f57", + "index.js": "b6cb6c3899dfb0e2d600bd2a0fbb979e38e3499775cd4cfae131c58744e23a65", + "module.json": "1f4abd82a728844a1d38791c94f8b09b09de5d7f4173ec03fa653ab8ecc3a1c7" + } } \ No newline at end of file diff --git a/remove_LfgWindow/module.json b/remove_LfgWindow/module.json index eac535e..afc1d21 100644 --- a/remove_LfgWindow/module.json +++ b/remove_LfgWindow/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-LFG window", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { "guiName": "UI Remover: LFG Window", - "niceName": "UI Remover: LFG Window" + "cliName": "UI Remover: LFG Window" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_LfgWindow/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_LfgWindow/"], + "description": "Hides LFG window and applicants window." } \ No newline at end of file diff --git a/remove_PartyWindow/S1UI_PartyWindow.gpk b/remove_PartyWindow/S1UI_PartyWindow.gpk index 9799537..51d5fa4 100644 Binary files a/remove_PartyWindow/S1UI_PartyWindow.gpk and b/remove_PartyWindow/S1UI_PartyWindow.gpk differ diff --git a/remove_PartyWindow/S1UI_PartyWindowRaidInfo.gpk b/remove_PartyWindow/S1UI_PartyWindowRaidInfo.gpk new file mode 100644 index 0000000..6b51e63 Binary files /dev/null and b/remove_PartyWindow/S1UI_PartyWindowRaidInfo.gpk differ diff --git a/remove_PartyWindow/config.json b/remove_PartyWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_PartyWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_PartyWindow/index.js b/remove_PartyWindow/index.js index ccda61f..7a76eaf 100644 --- a/remove_PartyWindow/index.js +++ b/remove_PartyWindow/index.js @@ -1,9 +1,14 @@ -const config = require('./config.json'); -module.exports = function PartyWindow(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_PartyWindow.gpk"); - } - return; +exports.ClientMod = class +{ + constructor(mod) + { + mod.log("This mod has been merged into TCC main module and can be uninstalled."); + return; + + this.install = function(installer) + { + installer.gpk("S1UI_PartyWindow.gpk"); + installer.gpk("S1UI_PartyWindowRaidInfo.gpk"); + }; + } } \ No newline at end of file diff --git a/remove_PartyWindow/manifest-generator.js b/remove_PartyWindow/manifest-generator.js deleted file mode 100644 index 3d323a4..0000000 --- a/remove_PartyWindow/manifest-generator.js +++ /dev/null @@ -1,300 +0,0 @@ -'use strict' - -//////////////////// -// CONFIG // -//////////////////// - -const forceUnixLineEndings = true //force \n instead of \r\n (default: true) - -const removeOldDefs = true // remove undetected defs (default: true) - -const onlyHighestDefVer = false // only greatest def version added to manifest (default: false) - -const addAutoUpdateDisableBool = true // add ("disableAutoUpdate": false) to module.json if missing (default: true) - -const addFolderNameAsName = true // add ("name": ) to module.json if missing (default: true) - -const addAuthorName = "" // add ("author": ) to module.json if missing (default: "") - -const addDescription = "Description goes here." // add ("description": ) to module.json if missing (default: "Description goes here.") - -const addServers = [""] // add ("servers": ) to module.json if missing (default: [""]) - -const addSupportUrl = "" // add ("supportURL": ) to module.json if missing (default: "") - -//////////////////// -// LISTS // -//////////////////// - -// ignore these files for making manifest -const IGNORED_FILES = [ - 'manifest.json', - 'manifest-generator.js', - 'manifest-generator.bat', - 'manifest-generator.exe', - 'node.exe' -] - -// ignore files/folders which start with these characters: i.e. ".git" or "_old" -const IGNORED_CHARACTERS = [ - '.', - '_' -] - -// filetypes to force unix line ending if enabled -const FORCE_UNIX_FILE_TYPES = [ - '.txt', - '.text', - '.js', - '.json', - '.jsn', - '.xml', - '.md', - '.htm', - '.html', - '.css', - '.csv', - '.php', - '.cfg', - '.ini', - '.list', - '.lst' -] - -//////////////////// -// CODE // -//////////////////// - -const crypto = require('crypto'), - fs = require('fs'), - path = require('path') - -// set directory to launch argument or local directory -let directory = __dirname -if (process.argv[2]) { - directory = process.argv[2] - // check if valid directory - try { - fs.readdirSync(directory, 'utf8') - } - catch (err) { - console.log(`"${directory}" is not a valid folder.`) - return - } -} - -// read existing module.json -let modulejson -try { - modulejson = require(path.join(directory, 'module.json')) -} -catch (error) { - modulejson = {} -} -if (addAutoUpdateDisableBool && modulejson.disableAutoUpdate === undefined) { - modulejson.disableAutoUpdate = false -} -if (addFolderNameAsName && modulejson.name === undefined) { - modulejson.name = path.basename(directory) -} -if (addAuthorName && modulejson.author === undefined) { - modulejson.author = addAuthorName -} -if (addDescription && modulejson.description === undefined) { - modulejson.description = addDescription -} -if (addServers && addServers[0] && modulejson.servers === undefined) { - modulejson.servers = addServers -} -if (addSupportUrl && modulejson.supportUrl === undefined) { - modulejson.supportUrl = addSupportUrl -} -fs.writeFileSync(path.join(directory, 'module.json'), jsonify(modulejson), 'utf8') - -// read existing manifest.json -let manifest -try { - // sanitize input - manifest = require(path.join(directory, 'manifest.json')) - if (manifest && typeof manifest === 'object') { - if (!manifest.files) manifest.files = {} - if (removeOldDefs) delete manifest.defs - } - else { - manifest = { - files: {} - } - } -} -catch (error) { - // make new manifest - manifest = { - files: {} - } -} - -// delete removed file entries -let checking = 0 -for (let entry of Object.keys(manifest.files)) { - // check if file exists - checking += 1 - fs.access(path.join(directory, entry), fs.constants.F_OK, (err) => { - checking -= 1 - if (err) delete manifest.files[entry] - checkProg() - return - }) -} - -let reading = 0 -getFiles() - -// get all files in folder and subfolder -function getFiles(relativePath = '', files) { - let dir = path.join(directory, relativePath) - if (!files) files = fs.readdirSync(dir, 'utf8') - for (let file of files) { - // if not ignored file or begins with ignored character - if (!IGNORED_FILES.includes(file) && !IGNORED_CHARACTERS.includes(file[0])) { - reading += 1 - fs.readdir(path.join(dir, file), 'utf8', (err, moreFiles) => { - if (moreFiles) { - getFiles(path.join(relativePath, file), moreFiles) - } - else { - getHash(path.join(relativePath, file)) - } - reading -= 1 - checkProg() - }) - } - } -} - -// get sha256 hash -function getHash(file, type = 'sha256') { - file = file.replace(/\\/g, '/') - // force unix line endings - if (forceUnixLineEndings) forceUnix(file) - // get defs - getDefs(file) - if (manifest.files[file] && typeof manifest.files[file] === 'object') { - manifest.files[file].hash = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } - else { - manifest.files[file] = crypto.createHash(type).update(fs.readFileSync(path.join(directory, file))).digest('hex') - } -} - -// get defs -function getDefs(file) { - if (file.slice(-4).includes('.js')) { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - // ignore comments - data = data.replace(/\/\/.*\/\*(?!.*\*\/)/g,'') // ignore: // ... /* ... - data = data.replace(/\/\*[^]*?\*\//gm,'') // ignore: /* ... */ - data = data.replace(/\/\/.*/g,'') // ignore: // ... - data = data.replace(/[A-Z\.]+\.majorPatchVersion/igm,'majorPatchVersion') - let packets = data.match(/['"`][CS]_[A-Z_]+['"`][ \t]*,([ \t\n]*\d+|[ \t\n]*[`'"]raw[`'"`]|[^\n,\]]+)/igm) - //console.log(packets) - if (packets) { - if (!Array.isArray(packets)) packets = [packets] - for (let packet of packets) { - // make defs object for manifest - if (!manifest.defs) manifest.defs = {} - // get def versions - packet = packet.split(',') - let versions = [] - for (let majorPatchVersion = 60; majorPatchVersion <= 100; majorPatchVersion += 1) { - let v - try {v = eval(packet[1])} - catch (err) { - console.log(`eval(${packet[1]})`) - console.log(err) - majorPatchVersion = 101 - } - if (v && !versions.includes(v)) versions.push(v) - } - for (let packetVer of versions) { - // if NaN - if (isNaN(packetVer)) packetVer = String(packetVer).toLowerCase() - // if in manifest - packet[0] = packet[0].replace(/['"` \t\n]/igm, '') - if (manifest.defs[packet[0]]) { - // add to list - if (Array.isArray(manifest.defs[packet[0]])) { - if (!manifest.defs[packet[0]].includes(packetVer)) { - manifest.defs[packet[0]].push(packetVer) - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - } - // change to list - else if (['number', 'string'].includes(typeof manifest.defs[packet[0]]) && manifest.defs[packet[0]] != packetVer) { - manifest.defs[packet[0]] = [manifest.defs[packet[0]], packetVer] - manifest.defs[packet[0]].sort((a,b)=>{return a-b}) - } - // delete other versions - if (onlyHighestDefVer && Array.isArray(manifest.defs[packet[0]])) { - let index = manifest.defs[packet[0]].length - 1 - if (typeof manifest.defs[packet[0]][index] == "string") index -= 1 - manifest.defs[packet[0]] = manifest.defs[packet[0]][index] - } - } - else { - manifest.defs[packet[0]] = packetVer - } - } - } - } - } -} - -// force unix line endings -function forceUnix(file) { - // check if read and writable - for (let type of FORCE_UNIX_FILE_TYPES) { - if (file.slice(-6).includes(type)) { - try { - let data = fs.readFileSync(path.join(directory, file), 'utf8') - data = data.replace(/\r\n/g, '\n') - fs.writeFileSync(path.join(directory, file), data, 'utf8') - } - catch (err) { - //console.log(err) - console.log('Cannot edit protected file: ' + file) - } - return - } - } -} - -// alphabetize object keys -function alphabetizeObject(obj) { - let keys = Object.keys(obj) - keys.sort() - let newObj = {} - for (let key of keys) { - newObj[key] = obj[key] - } - return newObj -} - -// JSON.stringify but make lists single line -function jsonify(obj) { - obj = JSON.stringify(obj, null, ' ') - let lists = obj.match(/\[[^]+?\].*/igm) - if (lists) for (let list of lists) { - obj = obj.substring(0,obj.indexOf(list)) + list.replace(/[ \n\t]*/igm, '') + obj.substring(obj.indexOf(list) + list.length) - } - return obj -} - -// check if process completed -function checkProg() { - if (reading === 0 && checking === 0) { - manifest.files = alphabetizeObject(manifest.files) - if (manifest.defs) manifest.defs = alphabetizeObject(manifest.defs) - fs.writeFileSync(path.join(directory, 'manifest.json'), jsonify(manifest), 'utf8') - console.log('"manifest.json" generation complete.') - } -} \ No newline at end of file diff --git a/remove_PartyWindow/manifest.json b/remove_PartyWindow/manifest.json index e089360..760949f 100644 --- a/remove_PartyWindow/manifest.json +++ b/remove_PartyWindow/manifest.json @@ -1,11 +1,8 @@ { - "files": { - "S1UI_PartyWindow.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "040199a3ed2c3a19bb47b81baf5561b30ce3c2253f1dbf4f2e8718a2b92369b7", - "module.json": "415d8b0f8ebaf6c89f6188b828e335d547fe8dbea44c10d069b7c8b14524f717" - } + "files": { + "S1UI_PartyWindow.gpk": "4d5beabb5ce39180cbbdc70f24f0584d8b1a30170dd5ff22b0fdb24e9a7de296", + "S1UI_PartyWindowRaidInfo.gpk": "7c68b115f5240b6f8af76685feba6439e3baf5c39013aadaf8b1ba95cbe3b0ca", + "index.js": "baeade8a438c1ea2038d84b286e6f531191cc13701ea9a775a2cd943141ce239", + "module.json": "4570ec4412e80b6e2663d4934589ae38b59fb6ce1acf9e25b307fb0874e761fd" + } } \ No newline at end of file diff --git a/remove_PartyWindow/module.json b/remove_PartyWindow/module.json index 73b8be1..122b008 100644 --- a/remove_PartyWindow/module.json +++ b/remove_PartyWindow/module.json @@ -1,15 +1,12 @@ { "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, "name": "remove-PartyWindow", - "category": "client", - "author": "Yang", + "keywords" : ["client"], + "author": "Yang, Foglio", "options": { - "guiName": "UI Remover: Party Window", - "niceName": "UI Remover: Party Window" + "guiName": "UI Remover: Party/Raid Windows", + "cliName": "UI Remover: Party/Raid Windows" }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_PartyWindow/"], - "description": "Description goes here." + "servers": ["https://raw.githubusercontent.com/Foglio1024/UI-Remover/master/remove_PartyWindow/"], + "description": "Hides party members and raid members." } \ No newline at end of file diff --git a/remove_QuestTracker/S1UI_QuestTaskInfo.gpk b/remove_QuestTracker/S1UI_QuestTaskInfo.gpk deleted file mode 100644 index 01fc2b0..0000000 Binary files a/remove_QuestTracker/S1UI_QuestTaskInfo.gpk and /dev/null differ diff --git a/remove_QuestTracker/config.json b/remove_QuestTracker/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_QuestTracker/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_QuestTracker/index.js b/remove_QuestTracker/index.js deleted file mode 100644 index c471854..0000000 --- a/remove_QuestTracker/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const config = require('./config.json'); -module.exports = function QuestTracker(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_QuestTaskInfo.gpk"); - } - return; -} \ No newline at end of file diff --git a/remove_QuestTracker/manifest.json b/remove_QuestTracker/manifest.json deleted file mode 100644 index 771a00e..0000000 --- a/remove_QuestTracker/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "files": { - "S1UI_QuestTaskInfo.gpk": "f269f57e7889046a386ad1a6029738a30ea777402ae12ab3860fe380d018fd2f", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "fadc0848ea11970a32d6941e1ee1c73a6f6813201d7b37cb98d47d0c4a40ab55", - "module.json": "30574c3c80e65eb70000ab61b4a29649260efaea9fbf42868683e3a7f6e8bde7" - } -} \ No newline at end of file diff --git a/remove_QuestTracker/module.json b/remove_QuestTracker/module.json deleted file mode 100644 index 8466124..0000000 --- a/remove_QuestTracker/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, - "name": "remove-QuestTask", - "category": "client", - "author": "Yang", - "options": { - "guiName": "UI Remover: Quest Tracker Window", - "niceName": "UI Remover: Quest Tracker Window" - }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_QuestTracker/"], - "description": "Description goes here." -} \ No newline at end of file diff --git a/remove_RaidWindow/S1UI_PartyWindowRaidInfo.gpk b/remove_RaidWindow/S1UI_PartyWindowRaidInfo.gpk deleted file mode 100644 index 9799537..0000000 Binary files a/remove_RaidWindow/S1UI_PartyWindowRaidInfo.gpk and /dev/null differ diff --git a/remove_RaidWindow/config.json b/remove_RaidWindow/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_RaidWindow/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_RaidWindow/index.js b/remove_RaidWindow/index.js deleted file mode 100644 index e8bda44..0000000 --- a/remove_RaidWindow/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const config = require('./config.json'); -module.exports = function RaidWindow(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_PartyWindowRaidInfo.gpk"); - } - return; -} \ No newline at end of file diff --git a/remove_RaidWindow/manifest.json b/remove_RaidWindow/manifest.json deleted file mode 100644 index 314dac9..0000000 --- a/remove_RaidWindow/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "files": { - "S1UI_PartyWindowRaidInfo.gpk": "c2c7bbda47e48d9345c88926fdae7e18e44a8b01b1aa5e0ae21aa888de3cf1ca", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "e9285f4c38128492c8ce5b44b6baeeedc13ef206418f9bd3ca4b7036916064ca", - "module.json": "366439f0c66527c599d13fe5b162e7c0366d33f2365bc7e7cdcd6c301fbca335" - } -} \ No newline at end of file diff --git a/remove_RaidWindow/module.json b/remove_RaidWindow/module.json deleted file mode 100644 index 30cb13c..0000000 --- a/remove_RaidWindow/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, - "name": "remove-RaidWindow", - "category": "client", - "author": "Yang", - "options": { - "guiName": "UI Remover: Raid Window", - "niceName": "UI Remover: Raid Window" - }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_RaidWindow/"], - "description": "Description goes here." -} \ No newline at end of file diff --git a/remove_TeraRewards/S1UI_Benefit.gpk b/remove_TeraRewards/S1UI_Benefit.gpk deleted file mode 100644 index 01fc2b0..0000000 Binary files a/remove_TeraRewards/S1UI_Benefit.gpk and /dev/null differ diff --git a/remove_TeraRewards/config.json b/remove_TeraRewards/config.json deleted file mode 100644 index ba9418f..0000000 --- a/remove_TeraRewards/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "disabled": false -} \ No newline at end of file diff --git a/remove_TeraRewards/index.js b/remove_TeraRewards/index.js deleted file mode 100644 index 2b2d068..0000000 --- a/remove_TeraRewards/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const config = require('./config.json'); -module.exports = function TeraRewards(m) { - let disabled = config.disabled; - if(!disabled) - { - m.installGPK("S1UI_Benefit.gpk"); - } - return; -} \ No newline at end of file diff --git a/remove_TeraRewards/manifest.json b/remove_TeraRewards/manifest.json deleted file mode 100644 index 1c1bcd7..0000000 --- a/remove_TeraRewards/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "files": { - "S1UI_Benefit.gpk": "f269f57e7889046a386ad1a6029738a30ea777402ae12ab3860fe380d018fd2f", - "config.json": { - "overwrite": false, - "hash": "ebd3d3cb8ff6f281c7eadbf13104ced1c72b864363dc69a4225c3cb527d1c061" - }, - "index.js": "64c5854dd34ffd92bdac754e0f08915a0843238a49887949a00cf123a98b50e0", - "module.json": "78c07d97785194b582638acf5830c102748e9de58ddba4df217fd472092113f1" - } -} \ No newline at end of file diff --git a/remove_TeraRewards/module.json b/remove_TeraRewards/module.json deleted file mode 100644 index 139a579..0000000 --- a/remove_TeraRewards/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "disableAutoUpdate": false, - "dependencies": { - "modern-Resources": "https://raw.githubusercontent.com/Foglio1024/tera-modern-ui/master/Modern_Resources/module.json" - }, - "name": "remove-TeraRewards", - "category": "client", - "author": "Yang", - "options": { - "guiName": "UI Remover: Tera Rewards Window", - "niceName": "UI Remover: Tera Rewards Window" - }, - "servers": ["https://raw.githubusercontent.com/DeathDefying/UI-Remover/master/remove_TeraRewards/"], - "description": "Description goes here." -} \ No newline at end of file