From feb7f1d01bc99295f26f9dfa3e87427319f88a5a Mon Sep 17 00:00:00 2001 From: Dean James Date: Mon, 9 Mar 2020 16:54:59 +0000 Subject: [PATCH] Fixed incorrect Chloris data. Allowed configurable text colours. --- addons/EmpyPopTracker/EmpyPopTracker.lua | 39 ++++++++++++++++-------- addons/EmpyPopTracker/README.md | 6 ++-- addons/EmpyPopTracker/nms/chloris.lua | 28 ++++++++--------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/addons/EmpyPopTracker/EmpyPopTracker.lua b/addons/EmpyPopTracker/EmpyPopTracker.lua index 751ea953f..797226ddb 100644 --- a/addons/EmpyPopTracker/EmpyPopTracker.lua +++ b/addons/EmpyPopTracker/EmpyPopTracker.lua @@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. _addon.name = 'Empy Pop Tracker' _addon.author = 'Dean James (Xurion of Bismarck)' _addon.commands = { 'ept', 'empypoptracker' } -_addon.version = '2.1.1' +_addon.version = '2.2.1' config = require('config') res = require('resources') @@ -57,15 +57,30 @@ defaults.text.text.size = 10 defaults.tracking = 'briareus' defaults.visible = true defaults.add_to_chat_mode = 8 +defaults.colors = {} +defaults.colors.needed = {} +defaults.colors.needed.red = 255 +defaults.colors.needed.green = 50 +defaults.colors.needed.blue = 50 +defaults.colors.obtained = {} +defaults.colors.obtained.red = 100 +defaults.colors.obtained.green = 255 +defaults.colors.obtained.blue = 100 +defaults.colors.pool = {} +defaults.colors.pool.red = 255 +defaults.colors.pool.green = 170 +defaults.colors.pool.blue = 0 +defaults.colors.bgall = {} +defaults.colors.bgall.red = 0 +defaults.colors.bgall.green = 75 +defaults.colors.bgall.blue = 0 EmpyPopTracker.settings = config.load(defaults) EmpyPopTracker.text = require('texts').new(EmpyPopTracker.settings.text, EmpyPopTracker.settings) -colors = {} -colors.success = '\\cs(100,255,100)' -colors.danger = '\\cs(255,50,50)' -colors.warning = '\\cs(255,170,0)' -colors.close = '\\cr' +function start_color(color) + return '\\cs(' .. EmpyPopTracker.settings.colors[color].red .. ',' .. EmpyPopTracker.settings.colors[color].green .. ',' .. EmpyPopTracker.settings.colors[color].blue .. ')' +end function owns_item(id, items) for _, bag in pairs(items) do @@ -149,16 +164,16 @@ function generate_text(data, key_items, items, depth) local item_colour if owns_pop then - item_colour = colors.success + item_colour = start_color('obtained') else - item_colour = colors.danger + item_colour = start_color('needed') end local pool_notification = '' if in_pool_count > 0 then - pool_notification = colors.warning .. ' [' .. in_pool_count .. ']' .. colors.close + pool_notification = start_color('pool') .. ' [' .. in_pool_count .. ']' .. '\\cr' end - text = text .. '\n' .. get_indent(depth) .. pop.dropped_from.name .. '\n' .. get_indent(depth) .. ' >> ' .. item_colour .. item_identifier .. pop_name .. colors.close .. pool_notification + text = text .. '\n' .. get_indent(depth) .. pop.dropped_from.name .. '\n' .. get_indent(depth) .. ' >> ' .. item_colour .. item_identifier .. pop_name .. '\\cr' .. pool_notification if pop.dropped_from.pops then text = text .. generate_text(pop.dropped_from, key_items, items, depth + 1) end @@ -269,9 +284,9 @@ EmpyPopTracker.update = function() local generated_info = EmpyPopTracker.generate_info(tracked_nm_data, key_items, items) EmpyPopTracker.text:text(generated_info.text) if generated_info.has_all_pops then - EmpyPopTracker.text:bg_color(0, 75, 0) + EmpyPopTracker.text:bg_color(EmpyPopTracker.settings.colors.bgall.red, EmpyPopTracker.settings.colors.bgall.green, EmpyPopTracker.settings.colors.bgall.blue) else - EmpyPopTracker.text:bg_color(0, 0, 0) + EmpyPopTracker.text:bg_color(EmpyPopTracker.settings.text.red, EmpyPopTracker.settings.text.green, EmpyPopTracker.settings.text.blue) end if EmpyPopTracker.settings.visible then EmpyPopTracker.text:visible(true) diff --git a/addons/EmpyPopTracker/README.md b/addons/EmpyPopTracker/README.md index 5fd2550af..5ff3d1214 100644 --- a/addons/EmpyPopTracker/README.md +++ b/addons/EmpyPopTracker/README.md @@ -6,6 +6,8 @@ An FFXI Windower 4 addon that tracks items and key items for popping various NMs Originally developed to track Abyssea Empyrean weapon NMs, hence the name. Key items are identified by the Zhe (Ж) character. Treasure pool counts for pop items are listed in amber after the item in the format of [3] (assuming 3 of that item in the pool). +All text colours are configurable via the auto-generated settings.xml file. + ## Load `//lua load empypoptracker` @@ -48,6 +50,6 @@ Fistule is a unique NM when compared to the others. It does not require KIs that ## Contributing -Notice something not quite right? [Raise an issue](https://github.com/xurion/ffxi-empy-pop-tracker/issues). +If there's an NM you want to have added, or if you notice something not quite right, please [raise an issue](https://github.com/xurion/ffxi-empy-pop-tracker/issues). -[Pull requests](https://github.com/xurion/ffxi-empy-pop-tracker/pulls) welcome! +Or better yet, [pull requests](https://github.com/xurion/ffxi-empy-pop-tracker/pulls) are welcome! diff --git a/addons/EmpyPopTracker/nms/chloris.lua b/addons/EmpyPopTracker/nms/chloris.lua index df7451eed..875b5bff2 100644 --- a/addons/EmpyPopTracker/nms/chloris.lua +++ b/addons/EmpyPopTracker/nms/chloris.lua @@ -78,6 +78,10 @@ return { dropped_from = { name = 'Ophanim, Forced (G-9)', pops = { { + id = 2917, --Bloodshot Hecteye + type = 'item', + dropped_from = { name = 'Beholder (G-9)' } + }, { id = 2946, --Tarnished Pincer type = 'item', dropped_from = { @@ -86,21 +90,17 @@ return { id = 2916, --High-quality Limule Pincer type = 'item', dropped_from = { name = 'Gulch Limule (H-10)' } - }, { - id = 2917, --Bloodshot Hecteye - type = 'item', - dropped_from = { name = 'Beholder (G-9)' } - }, { - id = 2945, --Shriveled Wing + } } + } + }, { + id = 2945, --Shriveled Wing + type = 'item', + dropped_from = { + name = 'Halimede, Forced (G-12)', + pops = { { + id = 2915, --High-quality Clionid Wing type = 'item', - dropped_from = { - name = 'Halimede, Forced (G-12)', - pops = { { - id = 2915, --High-quality Clionid Wing - type = 'item', - dropped_from = { name = 'Gully Clionid (G-12)' } - } } - } + dropped_from = { name = 'Gully Clionid (G-12)' } } } } } }