vrtc / flowerpicker (public) (License: GPLv3) (since 2019-11-07) (hash sha1)
Flowerpicker is a GUI extension, that is an add-on, for World of Warcraft game client. It is under development and not yet ready for usage by players.
List of commits:
Subject Hash Author Date (UTC)
Add page edit box 29145203c22b9da8098138abfa32c76b16fcde3f Vladyslav Bondarenko 2019-11-15 17:38:28
Add draggable desktop icon af19ebc80cbfba6c60e955d508d5de8724f510cc Vladyslav Bondarenko 2019-11-15 16:17:34
Fix build script to package documentation add58a0668c2d726f2cb7a06ab44890308961f9b Vladyslav Bondarenko 2019-11-12 17:05:08
Add Luacheck static analysis with Gradle b9274ae52d8de1c6f3be31cd967d09d6f3ae1cf8 Vladyslav Bondarenko 2019-11-12 16:50:47
Apply LDoc with Gradle 3643910c9413638c6c5ef0224fe106758dcf18eb Vladyslav Bondarenko 2019-11-12 14:08:46
Add report at runtime mock 1401862377ee083669c51fb850c8b0a97154b68b Vladyslav Bondarenko 2019-11-11 20:30:53
Add basic fishing registration ec6c45c1c89890cad3ae591d2483c47b94cacf86 Vladyslav Bondarenko 2019-11-08 18:57:30
Add world resource node harvest registration 2c7e1542abf677efc70a616291921f92ed9c04dd Vladyslav Bondarenko 2019-11-07 12:16:39
Update registration of money operations f0b4ec71099900dd51b5a4c35ce688586d6ddbfe Vladyslav Bondarenko 2019-11-06 19:49:01
Add basic money income via looting registration 9cfb08138268bb6985db1729c160b444a5e4e56a Vladyslav Bondarenko 2019-11-06 14:07:53
Update event format 554e63f3490dc48befe37fbfacf5c8c9ad188451 Vladyslav Bondarenko 2019-11-06 09:59:18
Initial commit f014031ddd4b2422ef5d000f33ad6602e64c9b36 Vladyslav Bondarenko 2019-11-05 20:29:14
Commit 29145203c22b9da8098138abfa32c76b16fcde3f - Add page edit box
Suboptimal pagination algorithm is implemented. A player can now
enter a number in an edit box in the report frame, that will be
used to render desired page of the report.
Author: Vladyslav Bondarenko
Author date (UTC): 2019-11-15 17:38
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2019-11-15 17:38
Parent(s): dc8cbc7a570b5b87ced1106a8b1898651f660e70
Signer:
Signing key:
Signing status: N
Tree: c3bb89752767d16c839180cd8f4c8ae05f0156b5
File Lines added Lines deleted
.luacheckrc 1 0
Flowerpicker.lua 69 9
File .luacheckrc changed (mode: 100644) (index ca05b1e..e7f217c)
... ... stds.flowerpicker = {
38 38 globals = { globals = {
39 39 "FlowerpickerAddOnFrame", "FlowerpickerAddOnFrame",
40 40 "FlowerpickerLootCache", "FlowerpickerLootCache",
41 "FlowerpickerPageEditBox",
41 42 "FlowerpickerReportFrame", "FlowerpickerReportFrame",
42 43 "FlowerpickerSavedVariables", "FlowerpickerSavedVariables",
43 44 }, },
File Flowerpicker.lua changed (mode: 100644) (index c9c8640..f8ae1ef)
... ... Event registry accessor.
491 491 @param dao a table that is the entire event registry to query @param dao a table that is the entire event registry to query
492 492 @return table that is the result set of the query @return table that is the result set of the query
493 493 ]] ]]
494 local function query(dao)
494 local function query(dao, pageNumber)
495 495 assert (dao ~= nil) assert (dao ~= nil)
496 496 assert ('table' == type(dao)) assert ('table' == type(dao))
497 497
498 local p = sanitiseShort(pageNumber)
499 assert (validatePositiveAndNonZero(p))
500 local maxEntryQuantityPerPage = 16
501
498 502 table.sort(dao, function(a, b) table.sort(dao, function(a, b)
499 503 return getEventItemName(a) < getEventItemName(b) return getEventItemName(a) < getEventItemName(b)
500 504 end) end)
 
... ... local function query(dao)
525 529 r = nil r = nil
526 530 end end
527 531 end end
528 if nil == r and #resultTable < 16 then
532 if nil == r and #resultTable then
529 533 r = {eventType, itemName, itemQuantity} r = {eventType, itemName, itemQuantity}
530 534 table.insert(resultTable, r) table.insert(resultTable, r)
531 535 end end
532 536 end end
533 537
534 assert (resultTable ~= nil)
535 assert ('table' == type(resultTable))
536 return resultTable
538 local finalResultTable = {}
539 local s = math.max((p - 1), 0)*maxEntryQuantityPerPage
540 local t = math.max(p, 0)*maxEntryQuantityPerPage
541 local w
542 while (s < t) do
543 s = s + 1
544 w = resultTable[s]
545 if w ~= nil and 'table' == type(w) then
546 table.insert(finalResultTable, w)
547 end
548 end
549 assert (finalResultTable ~= nil)
550 assert ('table' == type(finalResultTable))
551 return finalResultTable
537 552 end end
538 553
539 554 --[[-- --[[--
 
... ... local function reportRefresh()
1008 1023 --[[ Lookup global table instead of reference frame table. --[[ Lookup global table instead of reference frame table.
1009 1024 -- Frame table can be changed by the user easily. -- Frame table can be changed by the user easily.
1010 1025 -- Declared global cannot be nullified by the user maybe??]]-- -- Declared global cannot be nullified by the user maybe??]]--
1011 local reportEntryTableSize = 16
1012 1026 local i = 0 local i = 0
1013 1027 local e local e
1014 1028 local et local et
1015 1029 local dao = FlowerpickerSavedVariables local dao = FlowerpickerSavedVariables
1016 local resultTable = query(dao)
1030 local pageEditBox = FlowerpickerPageEditBox
1031 assert (pageEditBox ~= nil)
1032 assert ('table' == type(pageEditBox))
1033 local pageNumber = sanitiseShort(pageEditBox:GetNumber())
1034 if not validatePositiveAndNonZero(pageNumber) then
1035 pageNumber = 1
1036 end
1037 local resultTable = query(dao, pageNumber)
1038 local reportEntryTableSize = sanitiseShort(#resultTable)
1039 assert (reportEntryTableSize ~= nil)
1040 assert (reportEntryTableSize >= 0)
1041 local maxEntryQuantityPerPage = 16
1017 1042 local r local r
1018 while (i < reportEntryTableSize) do
1043 while (i < maxEntryQuantityPerPage) do
1019 1044 i = i + 1 i = i + 1
1020 1045 e = _G[string.format('FlowerpickerEntry%02d', i)] e = _G[string.format('FlowerpickerEntry%02d', i)]
1021 1046 assert (e ~= nil) assert (e ~= nil)
 
... ... local function reportRefresh()
1024 1049 assert (et ~= nil) assert (et ~= nil)
1025 1050 assert ('table' == type(et)) assert ('table' == type(et))
1026 1051 r = resultTable[i] r = resultTable[i]
1027 if 'Money' == r[2] then
1052 if nil == r or 'table' ~= type(r) then
1053 et:SetText(nil)
1054 elseif 'Money' == r[2] then
1028 1055 et:SetText(r[1] .. ': Gold x ' .. (r[3] / 10000)) et:SetText(r[1] .. ': Gold x ' .. (r[3] / 10000))
1029 1056 else else
1030 1057 et:SetText(r[1] .. ': ' .. r[2] .. ' x ' .. r[3]) et:SetText(r[1] .. ': ' .. r[2] .. ' x ' .. r[3])
 
... ... local function reportHide()
1047 1074 f:Hide() f:Hide()
1048 1075 end end
1049 1076
1077 local function createInputBox(newInputBoxName, newInputBoxParent, newInputBoxLengthChars)
1078 local newInputBox = CreateFrame("EditBox", newInputBoxName, newInputBoxParent, "InputBoxTemplate");
1079 newInputBox:SetPoint("CENTER", 0, 0);
1080 newInputBox:SetSize(16*newInputBoxLengthChars, 16);
1081 newInputBox:SetNumeric(true);
1082 newInputBox:SetMaxLetters(newInputBoxLengthChars);
1083 local historyLineQuantity = 4
1084 newInputBox:SetHistoryLines(historyLineQuantity);
1085 newInputBox:SetBackdrop({
1086 bgFile="Interface\\ChatFrame\\ChatFrameBackground",
1087 edgeFile="Interface\\ChatFrame\\ChatFrameBackground",
1088 tile=true,
1089 tileSize=5,
1090 edgeSize= 2,
1091 });
1092 newInputBox:SetBackdropColor(0, 0, 0, 0.5);
1093 newInputBox:SetBackdropBorderColor(0, 0, 0, 0.5);
1094 newInputBox:SetAutoFocus(false);
1095 newInputBox:ClearFocus();
1096 newInputBox:SetFocus(false);
1097
1098 return newInputBox;
1099 end
1100
1101 local function initGUIPagination(reportFrame)
1102 local pageEditBoxLenght = 2
1103 local pageEditBox = createInputBox('FlowerpickerPageEditBox', reportFrame, pageEditBoxLenght)
1104 pageEditBox:SetPoint('BOTTOMRIGHT', -8, 8)
1105 pageEditBox:SetNumber(1)
1106 pageEditBox:SetScript('OnEnterPressed', reportRefresh)
1107 end
1108
1050 1109 local function initGUIMinimise() local function initGUIMinimise()
1051 1110 local showBtnW = 32 local showBtnW = 32
1052 1111 local showBtnH = showBtnW local showBtnH = showBtnW
 
... ... local function initGUI(addonFrame)
1152 1211
1153 1212 reportFrame:Show() reportFrame:Show()
1154 1213 initGUIMinimise() initGUIMinimise()
1214 initGUIPagination(reportFrame)
1155 1215 reportHide() reportHide()
1156 1216 end end
1157 1217
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/flowerpicker

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/flowerpicker

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/flowerpicker

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main