Skip to content

Commit

Permalink
7
Browse files Browse the repository at this point in the history
  • Loading branch information
xenon615 committed Dec 1, 2020
1 parent 47d5725 commit 46de938
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
3 changes: 2 additions & 1 deletion MiniMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<NormalTexture file="Interface\WorldStateFrame\ColumnIcon-FlagCapture1"/>
<!-- <NormalTexture file="Interface\WorldStateFrame\ColumnIcon-FlagCapture1"/> -->
<NormalTexture file="Interface\GLUES\MODELS\UI_MainMenu_BurningCrusade\glow_green"/> -->
</Button>
</Ui>
36 changes: 9 additions & 27 deletions Notes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local items = {}
local listFrame, formFrame;

-- local functions
local formatLocation, dump, sort, getPage, delete, edit, save, createForm, createList, getCoords
local formatLocation, dump, sort, getPage, delete, edit, save, createForm, createList

vm.Notes = {
display = function()
Expand Down Expand Up @@ -40,13 +40,17 @@ end
function getPage(page)
local notesCount = getn(VadeMecum_Notes)
pagesCount = ceil(notesCount / rowsPerPage)

pagesCount = pagesCount == 0 and 1 or pagesCount
print('pagesCount', pagesCount)
if (page < 1) or (page > pagesCount) then
return
end
print('page', page)
for i = 1, rowsPerPage do
local ii = rowsPerPage * (page - 1) + i
print('ii', ii)
if ii > notesCount then
print('hide', ii)
items[i].row:Hide()
else
items[i].row:Show()
Expand Down Expand Up @@ -124,15 +128,15 @@ function createForm()
-- ---

local cont = CreateFrame("Frame", nil, formFrame)
cont:SetSize(formFrame:GetWidth() - 20, 200)
cont:SetPoint("TOPLEFT", 10, -40)
cont:SetSize(formFrame:GetWidth() - 20, 250)
cont:SetPoint("TOPLEFT", 10, -10)
cont:SetBackdrop(backDrop)
cont:SetBackdropColor(0, 0, 0, 0.5)

-- ---

local scroll = CreateFrame("ScrollFrame", "VadeMecum_Form_Scroll", cont, "UIPanelScrollFrameTemplate")
scroll:SetSize(cont:GetWidth() - 40 , 180)
scroll:SetSize(cont:GetWidth() - 40 , 230)
scroll:SetPoint("TOPLEFT", 10, -10)

-- ---
Expand All @@ -155,21 +159,6 @@ function createForm()
VadeMecum_Form_Scroll:SetVerticalScroll(h - hs)
end
end)
-- ---

local t = formFrame:CreateFontString("VadeMecum_Form_Coords", "OVERLAY", "GameFontNormal")
t:SetPoint("TOPLEFT", 10, -10)

-- ---

local rb = CreateFrame("Button","VadeMecum_Edit_Refresh", formFrame, "UIPanelButtonTemplate")
rb:SetHeight(24)
rb:SetWidth(60)
rb:SetPoint("TOPRIGHT", -10, -5)
rb:SetText("Refresh")
rb:SetScript("OnClick", function()
getCoords()
end)

-- ---

Expand Down Expand Up @@ -312,10 +301,3 @@ function formatLocation(continent, zone)
local zoneNames , key, val = { GetMapZones(continent)}
return continentNames[continent] .. ', ' .. zoneNames[zone]
end

-- +++

function getCoords()
local posX, posY = GetPlayerMapPosition("player")
VadeMecum_Form_Coords:SetText(shwcrd(posX) .. " / " .. shwcrd(posY));
end
2 changes: 1 addition & 1 deletion WorldMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</Scripts>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentTexture" file="Interface\WorldStateFrame\ColumnIcon-FlagCapture1"/>
<Texture name="$parentTexture" file="Interface\GLUES\MODELS\UI_MainMenu_BurningCrusade\glow_green"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
Expand Down
1 change: 1 addition & 0 deletions vm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function init ()
vm.Astrolabe = DongleStub("Astrolabe-0.4")
vm.MiniMap.display()
print(addonName .. " Loaded. Type /vm for notes list")

end

-- +++
Expand Down

0 comments on commit 46de938

Please sign in to comment.