diff --git a/Chalutier.lua b/Chalutier.lua index 36d32b3..7924aa7 100644 --- a/Chalutier.lua +++ b/Chalutier.lua @@ -66,6 +66,8 @@ function Chalutier_OnAction() if additionalInfo == ADDITIONAL_INTERACT_INFO_FISHING_NODE then currentInteractableName = interactableName + + ProvCha.UI.blocInfo:SetHidden(false) elseif currentInteractableName == interactableName then if currentState > FSH_STATE_FISHING then return end @@ -73,7 +75,6 @@ function Chalutier_OnAction() end changeState(state) - ProvCha.UI.blocInfo:SetHidden(false) elseif currentState ~= FSH_STATE_WAITING then changeState(FSH_STATE_WAITING) ProvCha.UI.blocInfo:SetHidden(true) @@ -104,6 +105,7 @@ local function Chalutier_OnAddOnLoad(eventCode, addOnName) ProvCha.UI.blocInfo:SetDimensions(64, 6) ProvCha.UI.blocInfo:SetColor(0.396, 0.27, 0) ProvCha.UI.blocInfo:SetAnchor(TOP, ProvCha.UI, TOP, 0, blocInfo) + ProvCha.UI.blocInfo:SetHidden(true) ProvCha.UI.blocInfo:SetDrawLevel(2) ProvCha.UI.Icon = WINDOW_MANAGER:CreateControl(nil, ProvCha.UI, CT_TEXTURE) @@ -121,7 +123,7 @@ local function Chalutier_OnAddOnLoad(eventCode, addOnName) EVENT_MANAGER:UnregisterForEvent(ProvCha.name, EVENT_ADD_ON_LOADED) - EVENT_MANAGER:RegisterForUpdate(ProvCha.name .. "Update", 1500, function() + EVENT_MANAGER:RegisterForUpdate(ProvCha.name .. "Update", 3000, function() ProvCha.vars.posy = ProvCha.UI:GetTop() ProvCha.vars.posx = ProvCha.UI:GetLeft() end) diff --git a/ProvisionsChalutier.txt b/ProvisionsChalutier.txt index df93edb..d9a47e5 100644 --- a/ProvisionsChalutier.txt +++ b/ProvisionsChalutier.txt @@ -1,9 +1,9 @@ -## Title: |c00C000Prov|r's Chalutier 1.0.1 (Fishing) +## Title: |c00C000Prov|r's Chalutier 1.0.2 (Fishing) ## Description: Pour la pĂȘche. (For fishing) ## Author: |c00C000Provision|r ## SavedVariables: ProvChaSV ## APIVersion: 100025, 100026 -## Version: 1.0.1 +## Version: 1.0.2 ; Trawler header.lua diff --git a/README.md b/README.md index 920e9a5..8faebc7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -ProvisionsChalutier 1.0.1 +ProvisionsChalutier 1.0.2 ============= [![Esoui Prov's Chalutier page](https://img.shields.io/badge/esoui.com-Provision%27s%20Chalutier-green.svg)](https://www.esoui.com/downloads/info2203-ProvisionsChalutierFishing.html) diff --git a/builderGulp/Gulpfile.js b/builderGulp/Gulpfile.js index 833e7c5..ad166be 100644 --- a/builderGulp/Gulpfile.js +++ b/builderGulp/Gulpfile.js @@ -43,23 +43,32 @@ function getFileContent(filename) { return fs.readFileSync(filename).toString(); } +function indexesIn(str, pattern) { + const result = []; + for (let i = 0; i < str.length; ++i) + if (str.substring(i, i + pattern.length) == pattern) + result.push(i); + + return result; +} + function getVersion() { const txtFile = getFileContent(addonConfig.modName + ".txt"); const version = (txtFile.match(/\n\#\# Version\: (\d{1,3}\.\d{1,3}\.\d{1,3}[a-z]?)/) || [])[1]; if (!version) { - console.log("Bad version in header of " + addonConfig.modName + ".txt"); + log("Bad version in header of " + addonConfig.modName + ".txt"); process.exit(); } for (let i = 0, content, match, file; i < addonConfig.filesWithVersionNumber.length; i++) { file = addonConfig.filesWithVersionNumber[i]; content = getFileContent(file[0]); - match = content.match(new RegExp(version, "g")) || []; + match = indexesIn(content, version) || []; if (match.length !== file[1]) { - console.log(`Error: Version not find. ${file[0]} ${match.length}/${file[1]}`); - console.log(`Current version: ${version}`); + log(`Error: Version not find. ${file[0]} ${match.length}/${file[1]}`); + log(`Current version: ${version}`); process.exit(); } } diff --git a/header.lua b/header.lua index bb320a5..b2057ef 100644 --- a/header.lua +++ b/header.lua @@ -4,7 +4,7 @@ ProvCha = namePublic = "Prov's Chalutier", nameColor = "|c3BC6DCChalutier|r", author = "|c00C000Provision|r", - version = "1.0.1", --4 endroits + version = "1.0.2", --4 endroits CPL = nil, defaults = { --Don't forget header.lua