WoWInterface SVN SimpleAssist

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 22 to Rev 23
    Reverse comparison

Rev 22 → Rev 23

SimpleAssist.lua
14,7 → 14,7
-- =======
 
local MYADDON_NAME = "SimpleAssist";
local MYADDON_VERSION = "3.11";
local MYADDON_VERSION = "3.3";
local MYADDON_AUTHOR = "Schnoggo";
local MYADDON_EMAIL = "schnoggo@gmail.com";
local MYADDON_WEBSITE = "http://www.wowinterface.com/downloads/author-45553.html";
23,7 → 23,7
local myPlayerName=UnitName("player");
local myPlayerClassText, myPlayerClassType = UnitClass("player");
 
-- default config settings
-- default config settings
 
 
local SimpleAssistDefaults={SimpleAssistPrefsRAID=false,
55,22 → 55,22
-- --------------------------
SLASH_SIMPLEASSIST1 = "/sass";
SlashCmdList["SIMPLEASSIST"] = SimpleAssist_CommandLine;
 
 
--[[this is code]]--
 
 
 
 
-- Register the event handlers:
-- =============================
-- =============================
 
self:RegisterEvent("VARIABLES_LOADED");
-- self:RegisterEvent("CHAT_MSG_TEXT_EMOTE");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("UPDATE_BINDINGS");
self:RegisterEvent("PLAYER_LEAVE_COMBAT");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("UPDATE_BINDINGS");
self:RegisterEvent("PLAYER_LEAVE_COMBAT");
self:RegisterEvent("PLAYER_REGEN_ENABLED");
 
 
if (not myPlayerName) then
myPlayerName = UnitName("player");
end
84,7 → 84,7
 
 
 
 
 
function SimpleAssist_Event(event)
local eventHandled = false;
local inParty, unitID;
92,12 → 92,12
-- VARIABLES_LOADED
-- ================
 
if ( event == "VARIABLES_LOADED" ) then
if ( event == "VARIABLES_LOADED" ) then
-- record that we have been loaded:
SimpleAssist_variablesLoaded = true;
 
 
if not (SimpleAssistSavedVars) then
 
 
if not (SimpleAssistSavedVars) then
SimpleAssistSavedVars={
SimpleAssistPrefsRAID=false,
SimpleAssistPrefsSAY = false,
118,15 → 118,15
SimpleAssistSavedVars["CustomChat"][2]=SASSTEXT_CUSTOM_CALL_MIDDLE;
SimpleAssistSavedVars["CustomChat"][3]=SASSTEXT_CUSTOM_CALL_AFTER;
else
 
 
end
 
eventHandled = true;
end -- ( event == "VARIABLES_LOADED" )
 
 
 
 
 
 
 
if (eventHandled == false and event == "PLAYER_ENTERING_WORLD") then
-- "frameType", "frameName", parentFrame[, "inheritsFrame"]);
-- local f = CreateFrame("Button", "SimpleAssistActionFrame", nil, "SecureActionButtonTemplate");
140,24 → 140,24
f:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", -100, -100); -- (point, frame, relativePoint , x, y);
-- putting the button off-screen to make it invisible
-- f:SetPoint("BOTTOMRIGHT", "UIParent", "TOPLEFT", 2, -2); -- (point, frame, relativePoint , x, y);
 
 
 
 
SimpleAssist_UpdateBindings();
eventHandled = true;
 
end -- PLAYER_ENTERING_WORLD
 
if (eventHandled == false and event == "UPDATE_BINDINGS") then
 
if (eventHandled == false and event == "UPDATE_BINDINGS") then
SimpleAssist_UpdateBindings();
eventHandled = true;
end
 
 
if (eventHandled == false and ((event == "PLAYER_LEAVE_COMBAT") or (event == "PLAYER_REGEN_ENABLED"))) then
 
 
if (eventHandled == false and ((event == "PLAYER_LEAVE_COMBAT") or (event == "PLAYER_REGEN_ENABLED"))) then
if (SimpleAssist_PendingLearn ~= nil) then
-- SimpleAssist_PrivateLearnAssist(SimpleAssist_PendingLearn);
-- replace with code that uses player name instead of unitID
 
 
if (SimpleAssist_PendingLearn == "pending clear") then
getglobal("SimpleAssistActionButton"):SetAttribute("macrotext", "/assist target");
SimpleAssist_PopMsg(SASSTEXT.CLEARED);
170,25 → 170,25
end
eventHandled = true;
end -- event handled?
 
 
 
 
 
 
 
 
 
 
if (eventHandled == false) then
-- msgText = string.lower(arg1);
end
 
end
 
 
 
 
 
 
 
 
 
end -- end of function
 
 
 
 
 
 
 
 
function SimpleAssist_UpdateBindings()
if getglobal("SimpleAssistActionButton") then
local k1, k2, k3 = GetBindingKey("SASS_ASSIST");
202,7 → 202,7
function SimpleAssistTester()
SimpleAssist_PopMsg("Yadda");
 
end
end
 
-- command line parameters: (slash command handler)
function SimpleAssist_CommandLine(msg)
215,8 → 215,8
if ( msg =="0") then
SimpleAssistPrefsFrame:Hide();
end
 
 
 
end
 
 
250,11 → 250,11
function(k,v)
if (getglobal(k) ~= nil) then
if string.find("Text",k) then
 
 
else
getglobal(k):SetChecked(v);
end
 
 
end
end
 
267,14 → 267,14
getglobal(tMsgName):SetText(tMsgText);
end
end
 
 
-- draw the radio buttons for Icon
if (SimpleAssistSavedVars["SimpleAssistRaidIcon"] == nil) then
SimpleAssistSavedVars["SimpleAssistRaidIcon"] = 0;
end
 
 
SimpleAssistUpdateRadios();
 
 
-- update tabs:
if (SimpleAssistPrefs_CurrentPanel==nil) then
SimpleAssistPrefs_CurrentPanel=-1;
283,14 → 283,14
SimpleAssistPrefs_CurrentPanel=-1;
SimpleAssist_HidePanel(2);
SimpleAssist_HidePanel(1);
 
 
if (tPanel<1) then
tPanel=1
end
SimpleAssist_ShowPanel(tPanel);
 
 
 
 
 
end
 
 
306,18 → 306,18
i=i+1;
end
end
 
 
 
 
 
 
function SimpleAssist_ShowPanel(whichPanel)
 
if (SimpleAssistPrefs_CurrentPanel > 0) then
SimpleAssist_HidePanel(SimpleAssistPrefs_CurrentPanel);
end
 
 
 
getglobal(SimpleAssistPrefs_PanelFrames[whichPanel]):Show();
SimpleAssistPrefs_CurrentPanel=whichPanel;
end
351,11 → 351,11
 
function SimpleAssist_LearnAssist(unit)
-- {unit} = ID of unit to be set as assist (from Target)
 
 
if (InCombatLockdown()) then
local thisUnitName=UnitName(unit);
if (thisUnitName==nil) then
SimpleAssist_PendingLearn="pending clear"; -- use a name with a space and no upper-case
SimpleAssist_PendingLearn="pending clear"; -- use a name with a space and no upper-case
SimpleAssist_PopMsg(SASSTEXT.CLEAR_PENDING);
else
SimpleAssist_PendingLearn=thisUnitName;
377,14 → 377,14
getglobal("SimpleAssistActionButton"):SetAttribute("macrotext", "/assist target");
SimpleAssist_PopMsg(SASSTEXT.CLEARED);
end
 
 
if (UnitIsPlayer(unit)) then
if (UnitIsFriend("target", unit)) then -- unit could technically be "target" here... (changed from player to target for Battle of Darrowshire and similar events
-- SimpleAssist_units["assist1"]=UnitName(unit);
local thisUnitName=UnitName(unit);
-- expand the macro code here
-- /assist [target=focus, exists]
-- check for modifier to use
-- check for modifier to use
-- /use [nomodifier, nomounted]Snowy Gryphon;
-- /use [modifier:alt]Palomino Bridle;
getglobal("SimpleAssistActionButton"):SetAttribute("macrotext", "/assist "..thisUnitName);
394,10 → 394,10
end
 
 
 
 
function SimpleAssist_AskAssist()
local uName=UnitName("target");
 
 
if (uName ~= nil) then -- only ask for help if there is a target
-- local msg = SASSTEXT.CHAT_ASSIST;
-- string.gsub(s, pattern, replace [, n])
406,7 → 406,7
local p1=SimpleAssistSavedVars["CustomChat"][1];
local p2=SimpleAssistSavedVars["CustomChat"][2];
local p3=SimpleAssistSavedVars["CustomChat"][3];
 
 
-- format the message:
if (p1 ~= "") then
p1=p1.." ";
418,7 → 418,7
-- p3=" "..p3;
-- end
local msg = p1 .. myPlayerName .. p2 .. uName .. p3;
 
 
-- tell it to the world (or party, or raid...)
if (IsInGroup()) then
if (IsInRaid()) then
433,18 → 433,18
if (SimpleAssistSavedVars["SimpleAssistRaidIcon"] ~= 0) then
SetRaidTarget("target",SimpleAssistSavedVars["SimpleAssistRaidIcon"]);
end
 
 
else -- not raid, just party
 
 
if (SimpleAssistSavedVars["SimpleAssistPrefsPARTY"] ) then
SendChatMessage(msg, "PARTY");
end
 
 
if (SimpleAssistSavedVars["SimpleAssistRaidIcon"] ~= 0) then
SetRaidTarget("target",SimpleAssistSavedVars["SimpleAssistRaidIcon"]);
end
end -- party
 
 
else -- not in a group, so only yell, say or emote
if (SimpleAssistSavedVars["SimpleAssistPrefsYELL"]) then
SendChatMessage(msg, "YELL");
452,25 → 452,25
if (SimpleAssistSavedVars["SimpleAssistPrefsSAY"]) then
SendChatMessage(msg, "SAY");
end
 
 
if (SimpleAssistSavedVars["SimpleAssistPrefsEMOTE"]) then
DoEmote("ATTACKMYTARGET");
end
 
 
if (SimpleAssistSavedVars["SimpleAssistRaidIcon"] ~= 0) then
SetRaidTarget("target",SimpleAssistSavedVars["SimpleAssistRaidIcon"]);
end
 
 
 
 
end -- in group/solo test
 
end -- have target
 
 
end
 
 
 
 
 
 
 
 
function SimpleAssist_PopMsg(msg)
-- Our head's up display for this AddOn
-- Inputs: {msg} = message to display in the HUD
483,13 → 483,8
SimpleAssistAlertFrame:AddMessage(msg, 1, 1, 1, 1, 3);
end
end
 
 
function SimpleAssist_DoAssist()
-- this function is now a dummy. It exists only so that a keybinding can be set.
 
end
 
 
 
 
 
SimpleAssist.toc
1,8 → 1,8
## Interface: 80000
## Interface: 80205
## X-Min-Interface: 70300
## Title: SimpleAssist
## Notes: Replace the common /assist macro
## Version: 3.11
## Version: 3.3
## Author: Schnoggo
## Dependencies:
## SavedVariables: SimpleAssistSavedVars
localization.lua
1,4 → 1,4
SASSTEXT_TITLE="Schnoggo's Simple Assist Ver. 3.11";
SASSTEXT_TITLE="Schnoggo's Simple Assist Ver. 3.3";
SASSTEXT_OPTIONSPACING=-60; -- vertical distance between each TITLE below:
SASSTEXT_SUMMARY="Use the Key Bindings (Main Menu:Key Binding) panel to set up your keys.";
SASSTEXT_BINDING_SET_TITLE="Set Player to Assist";
48,7 → 48,7
BINDING_NAME_SASS_ASK = "Request Assistance";
 
SASSTEXT = {
WELCOME="SimpleAssist 3.11 Loaded. Type /sass to change settings.",
WELCOME="SimpleAssist 3.3 Loaded. Type /sass to change settings.",
ASSISTING="Assisting",
CLEARED="Assist Cleared",
ASSIST_SET="Assist set",
56,5 → 56,5
CLEAR_PENDING="Assist will be cleared when you leave combat. ",
CHAT_ASSIST="Assist {name} in attacking {target}."
};
 
SASSTEXT_ATTACK_EMOTE="to attack";
\ No newline at end of file + +SASSTEXT_ATTACK_EMOTE="to attack";
Readme.txt
1,9 → 1,9
SimpleAssist v3.11
SimpleAssist v3.3
 
Description
===========
 
SimpleAssist is a World of Warcraft AddOn.
SimpleAssist is a World of Warcraft AddOn.
Is is a replacement for the usual "/assist {name}" macro.
 
 
15,7 → 15,6
 
Features
========
* Compatibility with World of Warcraft v5.0x
* Low memory usage (~0.1MB)
 
* Key bind to set the assist
24,8 → 23,8
 
Usage
=====
Go to the Key Bindings panel from the Main Menu.
Set a key to remember who to assist.
Go to the Key Bindings panel from the Main Menu.
Set a key to remember who to assist.
Set one to assist that player.
Simple!
 
38,6 → 37,12
 
Versions
========
3.3 October 2, 2019
* Updated TOC and version for WoW client 8.2.5
 
3.2 July 2, 2019
* Updated TOC and version for WoW client 8.2
 
3.11 July 18, 2018
* Fixed warning about undefined relative frames
 
139,10 → 144,10
 
2.2 - Dec 26, 2006
* Updated for WoW 2.0 client.
* Because of in-combat restrictions, setting a new assist during combat will not work.
* Because of in-combat restrictions, setting a new assist during combat will not work.
The next version will include a scheduler to allow you set a new assist and have it take effect
when you leave combat.
 
 
2.11 - Aug 22, 2006
* Updated TOC numbers for patch 1.12. No other changes.
 
200,4 → 205,3
 
Author: Schnoggo (schnoggo@gmail.com)
Website: http://lonk.me