• 0

    posted a message on Baffling error...
    Hmm... Similar code in omen seems to function just fine, but I'll give that a shot.

    edit:
    That seems to have resolved it.

    ... Stupid fencepost errors...
    Posted in: Lua Code Discussion
  • 0

    posted a message on Baffling error...
    It doesn't exist. I'm manually calling it via /run Observer:AddBar(0, "test", {r=1,b=1,g=1,a=1})

    Also, the error is only generated a single time, at load, and before AddBar is even called.

    edit:
    Now that I think about it, could it be possible that the event that calls that function is being fired prior to barFrames being created?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Baffling error...
    That's odd... Observer:AddBar(offset, text, color) should be generating a texture for each bar created.

    Could it be that the for loop is executing when there aren't any bars at all? I was under the impression that for i=0, #barFrames should not loop at all if #barFrames is 0.

    Also, your change doesn't seem to work. Same error.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Baffling error...
    I'm sure this is just me being blind, but I'm getting the following error:
    [2009/11/22 13:18:01-2331-x1]: Observer-0.1\Observer.lua:168: attempt to index field '?' (a nil value)
    Observer-0.1\Observer.lua:181: in function `?'
    CallbackHandler-1.0-5:146: in function <...non\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146>
    <string>:"safecall Dispatcher[3]":4: in function <[string "safecall Dispatcher[3]"]:4>
    <in C code>: ?
    <string>:"safecall Dispatcher[3]":13: in function `?'
    CallbackHandler-1.0-5:91: in function `Fire'
    LibSharedMedia-3.0-90058:176: in function `Register'
    SharedMedia-3.0.1-177\SharedMedia.lua:48: in main chunk
    
      ---


    Yet, the odd thing is that this does not seem to effect my addon function at all. Everything works fine. Thoughts?

    Pasty is at: http://www.pastey.net/129310

    Yes, I know the code isn't optimized :P
    Posted in: Lua Code Discussion
  • 0

    posted a message on In-line chat replacement?
    Did some more digging, and I agree with you. For some reason I was thinking that sendchatmessage and sendaddonmessage were the same functions, and thus thinking that my hooked function would then be firing on all addon communication.

    Switched it over to sendchatmessage... not that it really has any noticeable effect and isn't part of a public addon, but I suppose it's the principal of the thing :P
    Posted in: Lua Code Discussion
  • 0

    posted a message on In-line chat replacement?
    Quote from Phanx
    Well that sounds extraordinarily inefficient. ChatEdit_ParseText is run every time you type (or delete) any character while the chat edit box is focused...

    It only does anything if send == 1. I don't see how a single if statement returning false whenever a key is pressed is any more inefficient than having to check possibly thousands of messages being sent by addons only to not do anything with them.
    Posted in: Lua Code Discussion
  • 0

    posted a message on In-line chat replacement?
    I just hooked ChatEdit_ParseText rather than SendChatMessage. Problem solved XD
    Posted in: Lua Code Discussion
  • 0

    posted a message on In-line chat replacement?
    Figured as much, just wanted to make sure there wasn't a simpler way to do it before I started dicking around with hooking.
    Posted in: Lua Code Discussion
  • 0

    posted a message on In-line chat replacement?
    Is there a way to intercept outgoing chat messages and replace them with something else?

    For example, would it be possible to search the outgoing string for say :name: and replace it with different text before it's sent to the server?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Replacing the quest watch frame?
    In other words, I just need to replace the handler that the watch frame uses with my own that will use the new frame instead of blizzard's default one?
    Posted in: Lua Code Discussion
  • 0

    posted a message on SharedMediaLib kicking back default statusbar texture?
    Ah okay, I saw that bit of code when I was rummaging around in Omen, but I assumed it was watching for the stuff that omen registers itself, and not waiting for LSM to get around to registering stuff from SharedMedia.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Replacing the quest watch frame?
    Well I was looking to do a complete overhaul of it for a new quest minion. For example, using bars to show progress amounts, buttons for the quest items that aren't monstrous, etc.

    I can't stand how big and bulky the frame is. The thing takes like a third of my screen to show stuff that could be squeezed down to maybe a quarter of the size if redone in a sleeker approach.
    Posted in: Lua Code Discussion
  • 0

    posted a message on SharedMediaLib kicking back default statusbar texture?
    Alright, I have NO clue why this is happening, but no matter what I pass to Fetch, I'm getting back "Interface\TargetingFrame\UI-StatusBar" as a texture. SharedMedia is enabled and injecting textures properly (other addons such as Omen and pitbull can find the texture I'm trying to use just fine). Did I miss something?

    Initializing LSM3:
    embeds.xml:
    <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
    <Script file="Libs\LibStub\LibStub.lua"/>
       <Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
       <Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
       <Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
       <Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
       <Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
       <Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml"/>
       <Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
       <Include file="Libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
       <Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
       <Include file="Libs\LibSharedMedia-3.0\lib.xml"/>
    </Ui>


    Top of main Lua file:
    -- Get LibSharedMedia access
    local LSM3 = LibStub("LibSharedMedia-3.0")
    Code using it:
       local bar = CreateFrame("Frame", nil, anchor)
    
       bar:SetWidth(anchor:GetWidth() - 2)
       bar:SetHeight(12)
    
       bar:SetPoint("TOPLEFT", anchor, "TOPLEFT", 1, 1)
    
       bar.texture = bar:CreateTexture()
       bar.texture:SetTexture(LSM3:Fetch("statusbar", "Smooth"))
       bar.texture:SetPoint("TOPLEFT", bar, "TOPLEFT")
       bar.texture:SetPoint("TOPRIGHT", bar, "TOPRIGHT")
    
       bar.texture:SetVertexColor(0, 1, 1, 1)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Replacing the quest watch frame?
    How would I go about doing this? I assume there's something I can do to tell blizzard to use my frame instead of theirs?

    Haven't really looked into replacing parts of the UI before, so I'm not really 100% certain where to begin >_<

    edit:
    Do I just butcher the default frame and replace it with mine?

    In other words:
        local q = _G.QuestWatchFrame
        q:Hide()
        q.Show = function() end
        q:UnregisterAllEvents()
    Posted in: Lua Code Discussion
  • 0

    posted a message on Tooltips best practice?
    God I'm far too used to working in C and Java... I keep thinking a table = an array in Lua, so when I've got to use a table that's all I ever picture it doing >_<
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.