Quantcast
WoWInterface - View Single Post - LUA CreateFrame, then RemoveFrame??
View Single Post
08-22-14, 09:50 AM   #8
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Use this instead of the existing Ryinn_Command function:
Lua Code:
  1. local function Ryinn_Command(msg, editBox)
  2.     -- String library functions can be called as methods on strings.
  3.     msg = msg:trim()
  4.    
  5.     if msg == "" then
  6.         RyinnsCursorFinder_Enabled = not RyinnsCursorFinder_Enabled
  7.         frame:SetShown(RyinnsCursorFinder_Enabled) -- `frame:SetShown(val)` is equivalent to `if val then frame:Show() else frame:Hide() end`
  8.        
  9.         print(("Ryinn's Flash Cursor is now %s. Use /rvm to toggle."):format(RyinnsCursorFinder_Enabled and "Enabled" or "Disabled"))
  10.     else
  11.         print("v" .. AddonVersion)
  12.         print("Use /rcf to enable/disable")
  13.     end
  14. end

After looking at the code more closely, I realised that the x, y and speed variables do need to be declared outside of the OnUpdate function as the values from the previous call are used to calculate the new value of speed each time.

Last edited by Choonstertwo : 08-22-14 at 10:09 AM.
  Reply With Quote