Skip to content

Commit

Permalink
Merge pull request #18 from opussf/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
opussf authored Sep 2, 2022
2 parents 8b56011 + cea01be commit 2c521e5
Show file tree
Hide file tree
Showing 13 changed files with 805 additions and 144 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/normal_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ jobs:
# Runs a single command using the runners shell
- name: Build with ant
run: ant package

# https://github.com/marketplace/actions/test-reporter
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Ineed Tests # Name of the check run which will be created
path: target/reports/testOut.xml # Path to test results
reporter: java-junit # Format of test results
46 changes: 45 additions & 1 deletion FEATURE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Feature

## ExpandedOptions

Fix the options panel.
SetValue error is happening.

Expand the options.

Add options to control:
* number of bars to show (Already part of it, set up in options panel)
* to fill bars (with older items) (limit of older items?)
- 5 of the oldest items would reduce the size of the window.
* to use added (oldest first) or to use updated (oldest still drops off)
* Height and width of bars (possible)
* Header info (name and account amount)

Add options to panel:
* How long to show an updated item
* Number of bars to show
* Height and width of bars

* Slush fund
* Autorepair from the slush fund
* Autopurchase receipt


[x] showProgress
[ ] showSuccess
[ ] audibleSuccess
[ ] doEmote
[ ] emote
[ ] playSoundFile
[ ] soundFile
[ ] showGlobal
[ ] barCount
[ ] hideInCombat
[ ] displayUIList
[ ] displayUIListDisplaySeconds
[ ] autoRepair
[ ] autoTrain
[ ] fillBars
[ ] displayUIListFillbarsSeconds



## othersNeedUI

After looking at some possible changes, this one seemed to be best.
Expand Down Expand Up @@ -246,4 +290,4 @@ function lib.isSoulbound(bag, slot)
end

ToolTip:SetHyperlink( <Link> )
Link = HyperLink or 'linktype:linkdata'
Link = HyperLink or 'linktype:linkdata'
Binary file modified Layout.monopic
Binary file not shown.
56 changes: 56 additions & 0 deletions OptionsLayout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
┌─────────────────────────────────────────────────────────────────────────────┐
│INeed - version │
│┌───────────────────────────────────────────────────────────────────────────┐│
││Progress: ││
││┌───────────────────┐┌─────────────────────────┐ ││
│││Show Where ││Show: │ ││
│││┌──┐ ││┌──┐ │ ││
││││ │Alert pane │││ │If others need item │ ││
│││└──┘ ││└──┘ │ ││
│││┌──┐ ││┌──┐ │ ││
││││ │General Chat │││ │Amount Changed │ ││
│││└──┘ ││└──┘ │ ││
││└───────────────────┘└─────────────────────────┘ ││
│└───────────────────────────────────────────────────────────────────────────┘│
│┌───────────────────────────────────────────────────────────────────────────┐│
││Success: ││
││┌───────────────────┐┌──────────────────────────────────────────────────┐ ││
│││Show Where ││Actions: │ ││
│││┌──┐ ││┌──┐ ┌──┐ │ ││
││││ │Alert pane │││ │Alert pane │ │General Chat │ ││
│││└──┘ ││└──┘ └──┘ │ ││
│││┌──┐ ││┌──┐ ┌──┐ ┌────────────────────┐│ ││
││││ │General Chat │││ │ScreenShot │ │Emote │ ││ ││
│││└──┘ ││└──┘ └──┘ └────────────────────┘│ ││
││└───────────────────┘└──────────────────────────────────────────────────┘ ││
││ ┌─────────────────────────┐ ││
││ │ Test Success Alert │ ││
││ └─────────────────────────┘ ││
│└───────────────────────────────────────────────────────────────────────────┘│
│┌───────────────────────────────────────────────────────────────────────────┐│
││UI: ││
││ ┌──┐ ┌──┐┌──┐┌──┐ ││
││ │ │Hide in combat Show │<<││10││>>│Bars ││
││ └──┘ └──┘└──┘└──┘ ││
││ ┌────┐ ┌──┐ ┌──┐ ┌──┐ ││
││ Display Updated items for: │ │Days│ │Hours│ │Minutes│ │Seconds ││
││ └────┘ └──┘ └──┘ └──┘ ││
││ ┌──┐ ┌────┐ ┌──┐ ┌──┐ ┌──┐ ││
││ │ │Show oldest │ │Days│ │Hours│ │Minutes│ │Seconds ││
││ └──┘ └────┘ └──┘ └──┘ └──┘ ││
│└───────────────────────────────────────────────────────────────────────────┘│
│┌───────────────────────────────────────────┐ │
││Account (per char): │ │
││ ┌──────┐ ┌───────┐┌────┐┌────┐│ ┌──┐ │
││Slush│ │ % up to:│ G││ S││ C││ │ │Auto Repair from account │
││ └──────┘ └───────┘└────┘└────┘│ └──┘ │
││ ┌───────┐┌────┐┌────┐│ │
││ Current:│ G││ S││ C││ │
││ └───────┘└────┘└────┘│ │
│└───────────────────────────────────────────┘ │
│ │
│ │
│ │
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# INeed

[![Build Status](https://travis-ci.org/opussf/INeed.svg?branch=master)](https://travis-ci.org/opussf/INeed)
[![Build Status](https://github.com/opussf/INeed/actions/workflows/ontag.yml/badge.svg)](https://github.com/opussf/INeed/actions/workflows/ontag.yml)
[INeed on CurseForge.com](https://www.curseforge.com/wow/addons/ineed)

This addon is a shopping list, item fulfillment addon for World of Warcraft.
Expand Down Expand Up @@ -33,6 +33,12 @@ Optional iterface is "/in".
/ineed account 1g -- sets account to 1 Gold
/ineed account 1g20s5c -- sets account to 1 Gold, 20 Silver, and 5 Copper
/ineed remove <charName>-<realmName> -- removes tracking of all items for a specific character
/ineed options -- open the options panel
/ineed arch -- add all archaeology currencies you are currently tracking
/ineed slush [percent%] [MaxAmount] -- Sets a slush % and max amount to slush off of your income to the account.
/ineed combat -- Toggle showing during combat
/ineed prune <itemLink> -- Prune an item from all characters (say if it is removed from the game)
/ineed oldest -- Show the oldest items in your list
```

## Goals:
Expand Down Expand Up @@ -115,6 +121,14 @@ Some macro ideas:

## Versions:
```
0.22 Adding interaction to UI window - click bars
-- Can now shift-click, ctrl-click, left-click, right-click.
-- only right clicking will drag the window.
Adding expanded options for showing items.
-- updated options will still show for a period of time
-- older items can be set to fill the given bars after the updated items time out
Updating the options screen (HUGE rewrite)
Minor breaking functionality, percent is stored as 0-100%, not 0-1. Reset the percentages.
0.10 Crontab feature scrapped.
Create a "toMake" field for items made from an enchant(profession)
-- not listed in fulfillment list
Expand Down
19 changes: 19 additions & 0 deletions runmany.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
ant clean
mkdir -p target/reports
for n in $(seq -f "%05g" 9999 1) ; do
#echo "Running run $n"
reportFile="target/reports/testOut.xml"
ant test > target/reports/antout.txt
if [ ! "$?" == "0" ]; then
cp target/reports/antout.txt target/reports/antOut$n.txt
#mv $reportFile target/reports/testOut$n.xml
ls -alt $reportFile
until $(~/Scripts/checkFileChanged.sh ./test/test.lua); do
sleep 1
done
else
#ls -alt $reportFile
sleep 1
fi
done
27 changes: 24 additions & 3 deletions src/INEED.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function INEED.Print( msg, showName)
end
DEFAULT_CHAT_FRAME:AddMessage( msg )
end
-- https://wowpedia.fandom.com/wiki/AddOn_loading_process
function INEED.OnLoad()
SLASH_INEED1 = "/IN"
SLASH_INEED2 = "/INEED"
Expand Down Expand Up @@ -210,7 +211,15 @@ function INEED.ADDON_LOADED( _, arg1 )

-- Load Options panel
INEED.OptionsPanel_Reset()
-- Clear unknown list
for ts, _ in pairs(INEED_unknown) do
if time()-ts > 86400 then
INEED_unknown[ts] = nil
end
end
INEED.oldest() -- @TODO, make this an option.

INEED.variables_loaded = true
INEED.Print( INEED_MSG_VERSION .. " Loaded" )
end
end
Expand Down Expand Up @@ -445,7 +454,7 @@ function INEED.PLAYER_MONEY()
-- PLAYER_MONEY has changed
if INEED_account.percent then -- look to see if need to add to balance
local change = GetMoney() - (INEED_account.current or 0)
change = change * INEED_account.percent
change = change * ( INEED_account.percent / 100 )
if ((not INEED_account.max) or ((INEED_account.balance or 0) < INEED_account.max)) and change>0 then
INEED_account.balance = (INEED_account.balance or 0) + change
if INEED_account.max and (INEED_account.balance > INEED_account.max) then
Expand Down Expand Up @@ -1099,12 +1108,12 @@ function INEED.slush( strIn )
--print( "Slush( "..(percent or "nil")..", "..(maxValue or "nil").." )" )
--print( percent.."::"..(maxValue or "nil").." -> "..value.."::"..(modify and "true" or "false") )

INEED_account.percent = percent / 100
INEED_account.percent = tonumber( percent )
INEED_account.max = (modify) and (INEED_account.max and INEED_account.max + maxValue) or maxValue
INEED_account.current = GetMoney()
end
INEED.updateTitleText( )
INEED.Print( "Slush: "..(INEED_account.percent and ((INEED_account.percent * 100).."%") or "")..
INEED.Print( "Slush: "..(INEED_account.percent and ((INEED_account.percent).."%") or "")..
(INEED_account.max and (" max: "..GetCoinTextureString(INEED_account.max)) or "") )
end
function INEED.updateTitleText( )
Expand All @@ -1125,8 +1134,16 @@ function INEED.prune( paramIn )
end
end
INEED_data[itemID] = nil
elseif itemID and not INEED_options[itemID] then
INEED.Print( "Seems like no one needs this item.")
elseif not itemID then
INEED.Print( "This cannot be pruned." )
end
end
function INEED.oldest()
INEED.highestUpdatedTS = time() + INEED_options["displayUIListFillbarsSeconds"]
INEEDUIListFrame:Show()
end

-- Testing functions

Expand Down Expand Up @@ -1207,6 +1224,10 @@ INEED.CommandList = {
["func"] = INEED.prune,
["help"] = { "<link>", "Prune [link] from all character." },
},
["oldest"] = {
["func"] = INEED.oldest,
["help"] = { "", "Show the oldest needed items."}
},
["test"] = {
["func"] = INEED.test,
["help"] = {"","Do something helpful"},
Expand Down
13 changes: 0 additions & 13 deletions src/INEED.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">

<Frame name="INEED_Frame" frameStrata="BACKGROUND" toplevel="false" enableMouse="false" movable="false" parent="UIParent">
<!--
<Size x="512" y="96" />
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color r="0.0" g="0.0" b="0.0" a="0.25" />
</Texture>
</Layer>
</Layers>
-->
<Scripts>
<OnLoad>
INEED.OnLoad();
Expand Down
Loading

0 comments on commit 2c521e5

Please sign in to comment.