Skip to content

Commit

Permalink
Added mag filter to character reader.
Browse files Browse the repository at this point in the history
Removed Mags addon
  • Loading branch information
Solybum committed May 18, 2017
1 parent 170f610 commit 6237b70
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 129 deletions.
3 changes: 3 additions & 0 deletions Character Reader/configuration.lua
Expand Up @@ -14,6 +14,8 @@ local magShowPBs = true
local magShortPBs = true
-- Shows the feed timer mags
local magShowFeedTimer = true
-- Show mags only
local magFilter = false
-- Shows an [E] besides equipped items in the inventory
local itemsShowEquipped = true
-- new floor items are added by default on the top of the list, use this setting to add new items at the bottom
Expand Down Expand Up @@ -166,6 +168,7 @@ return
magShowPBs = magShowPBs,
magShortPBs = magShortPBs,
magShowFeedTimer = magShowFeedTimer,
magFilter = magFilter,
itemsShowEquipped = itemsShowEquipped,
invertFloorItemsFlow = invertFloorItemsFlow,
mainWindow = mainWindow,
Expand Down
29 changes: 16 additions & 13 deletions Character Reader/init.lua
Expand Up @@ -591,7 +591,7 @@ local readItemFromPool = function (index, iAddr, floor)

-- Where the magic happens

if magOnly then
if floor == false and cfg.magFilter == true then
if item[1] == 2 then
item[4] = pso.read_u8(iAddr + _ItemMagPB)
item[5] = pso.read_u8(iAddr + _ItemMagStats + 0)
Expand Down Expand Up @@ -904,28 +904,31 @@ local readBank = function(save)
end
end

local getDefaultSelection = function()
local default = cfg.defaultSelection or 1
if default < 1 or default > 3 then
default = 1
end
return default
end

local selection = getDefaultSelection()
local status = true
local selection = cfg.defaultSelection
local magFilter = cfg.magFilter

local present = function()
if cfg.mainWindow then
local save = false
imgui.Begin("Character Reader")
imgui.SetWindowFontScale(cfg.fontSize)

local list = { "Inventory", "Bank", "Floor" }
local list = { "Inventory", "Bank", "Floor", }
imgui.PushItemWidth(150)
status, selection = imgui.Combo(" ", selection, list, table.getn(list))
imgui.PopItemWidth()

if cfg.showSaveToFile then
if selection == 1 then
magFilter = cfg.magFilter
imgui.SameLine(0, 5)
if imgui.Checkbox("Mags only", magFilter) then
cfg.magFilter = not cfg.magFilter
end
end

if cfg.showSaveToFile then
imgui.SameLine(0, 20)
if imgui.Button("Save to file") then
save = true
-- Write nothing to it so its cleared works for appending
Expand Down Expand Up @@ -963,7 +966,7 @@ local init = function()
return
{
name = "Character Reader",
version = "1.4.9",
version = "1.4.10",
author = "Solybum",
description = "Read inventory and bank items",
present = present,
Expand Down
25 changes: 0 additions & 25 deletions Mags/configuration.lua

This file was deleted.

91 changes: 0 additions & 91 deletions Mags/init.lua

This file was deleted.

0 comments on commit 6237b70

Please sign in to comment.