-
Posted by galvin on Sun, 27 Jun 2010 06:02:56
For the life of me I can't figure why this mod is not showing up in the addons list when I log in. I must be missing something.
BindingTest.toc
## Interface: 30300 ## Title: Key Bindings Test ## Notes: Demonstrates the usage of Bindings.xml BindingTest.lua BindingTest.xml
BindingTest.xml
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> <Button name="BindingTestButtonTemplate" inherits="UIPanelButtonTemplate2" virtual="true"> <Size x="150" y="24"/> <Scripts> <OnLoad function="BindingTestButton_OnLoad"/> <OnClick function="BindingTestButton_OnClick"/> <OnEnter function="BindingTestButton_OnEnter"/> <OnLeave function="BindingTestButton_OnLeave"/> </Scripts> </Button> <Frame name="BindTestFrame"> <Size x="1" y="1"/> <Anchors> <Anchor point="CENTER"/> </Anchors> <Frames> <Button name="BindingTestButton1" inherits="BindingTestButtonTemplate" id="1"> <Anchors> <Anchor point="BOTTOM" relativePoint="CENTER"/> </Anchors> </Button> <Button name="BindingTestButton2" inherits="BindingTestButtonTemplate" id="2"> <Anchors> <Anchor point="TOP" relativePoint="CENTER"/> </Anchors> </Button> </Frames> </Frame> <Button name="BindingTestCaptureFrame" hidden="true" enableKeyboard="true" frameStrata="DIALOG"> <Size x="175" y="90"/> <Anchors> <Anchor point="CENTER"/> </Anchors> <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> <EdgeSize val="16"/> <TileSize val="16"/> <BackgroundInsets left="5" right="5" top="5" bottom="5"/> <Color r="0" g="0" b="0"/> </Backdrop> <Layers> <Layer level="ARTWORK"> <FontString inherits="GameFontNormal" parentKey="text"> <Anchors> <Anchor point="TOPLEFT"> <Offset x="10" y="-10"/> </Anchor> <Anchor point="BOTTOMRIGHT"> <Offset x="-10" y="10"/> </Anchor> </Anchors> </FontString> </Layer> </Layers> <Scripts> <OnLoad function="BindingTestCapture_OnLoad"/> <OnShow function="BindingTestCapture_OnShow"/> <OnKeyDown function="BindingTestCapture_OnKeyDown"/> <OnClick function="BindingTestCapture_OnClick"/> </Scripts> </Button> </Ui>
BindingTest.lua
local BUTTON_CAPTION = "Set Test Binding #%d" local TOOLTIP_TEXT1 = "Left-click to add binding" local TOOLTIP_TEXT2 = "Right-click to remove first binding" local TOOLTIP_BINDING_LIST = "Currently bound: |cFFFFFFFF%s|r" local LIST_SEPARATOR = "|r, |cFFFFFFFF" local CAPTURE_TEXT = [[ Press a key or click this frame to set test binding #|cFFFFFFFF%d|r. Press |cFFFFFFFFESC|r to cancel.]] BINDING_HEADER_BINDING_TEST = "Test bindings for chapter 16" BINDING_NAME_BINDING_TEST1 = "Test binding #1" BINDING_NAME_BINDING_TEST2 = "Test binding #2" function BindingTest_Test1() print("Test binding #1 activated") end function BindingTest_Test2(keystate) if keystate == "down" then print("Test binding #2 pressed") else print("Test binding #2 released") end end function BindingTestButton_OnLoad(self) local id = self:GetID() self:SetText(BUTTON_CAPTION:format(id)) self.action = "BINDING_TEST" .. id self.RegisterForClicks("LeftButtonUp", "RightButtonUp") end function BindingTestButton_OnClick(self, button) end function BindingTestButton_OnEnter(self) end function BindingTestButton_OnLeave(self) end function BindingTestCapture_OnLoad(self) end function BindingTestCapture_OnShow(self) end function BindingTestCapture_OnKeyDown(self, key) end function BindingTestCapture_OnClick(self, button) end
Bindings.xml
<Bindings> <Binding name="BINDING_TEST1" header="BINDING_TEST"> BindingTest_Test1() </Binding> <Binding name="BINDING_TEST2" runOnUp="true"> BindingTest_Test2(keystate) </Binding> </Bindings>
-
Posted by jnwhiteh on Sun, 27 Jun 2010 09:57:28
Please do not delete your posts. Respond to them and say 'I figured it out' and share your help with someone else. Forums are not for you personally to get support, they are a community that is able to help support each other. This flies in the face of that.
I see you figured out your issue, can you please post helping everyone to understand what went wrong?
-
Posted by galvin on Mon, 28 Jun 2010 05:25:44
There was no issue. I was dumb and didn't look for "key binding test" in the addon list when I was looking for binding test.
-
Posted by jnwhiteh on Mon, 28 Jun 2010 07:55:02
Well that's an issue. Thanks for reporting back.