/trunk
-- The Ultimate Warcraft Battlecry Generator |
-- =========================================== |
-- Version : 0.44 |
-- Version : 0.50 |
-- Author : Nuchaleft (NytewolfAU2k7 on Curse) |
-- Email : nwcreations@gmail.com |
-- Create Date : 10/07/2008 01:11:43 PM WAST (GMT+8:00) |
UWBG_Prefs = {defchannel = "Say", |
allfaction = false,} |
-- This function is run on pressing the Ok or Close Buttons. |
-- Sets the Status of the Saved Variables to the new settings |
function frmBCG_Close() |
UWBG_Prefs[realm].Sold = SC_ChaChingGUIFrame_CBSold:GetChecked(); |
UWBG_Prefs[realm].Expired = SC_ChaChingGUIFrame_CBExpired:GetChecked(); |
UWBG_Prefs[realm].Outbid = SC_ChaChingGUIFrame_CBOutbid:GetChecked(); |
UWBG_Prefs[realm].Removed = SC_ChaChingGUIFrame_CBRemoved:GetChecked(); |
end |
-- This function is run on pressing the Cancel Button or from the VARIABLES LOADED event function. |
-- Sets the status of the Check Boxes to the Values of the Saved Variables. |
function frmBCG_CancelOrLoad() |
SC_ChaChingGUIFrame_CBSold:SetChecked(UWBG_Prefs[realm].Sold); |
SC_ChaChingGUIFrame_CBExpired:SetChecked(UWBG_Prefs[realm].Expired); |
SC_ChaChingGUIFrame_CBOutbid:SetChecked(UWBG_Prefs[realm].Outbid); |
SC_ChaChingGUIFrame_CBRemoved:SetChecked(UWBG_Prefs[realm].Removed); |
end |
-- ON EVENT HANDLER... ERR... EVENT |
function frmBCG_OnEvent() |
-- Do nothing. |
if (event == "VARIABLES_LOADED") then |
frmBCG_Initialise(); |
frmBCG_CancelOrLoad(); |
end |
end; |
-- GENERATE A FACTION-SPECIFIC BATTLECRY! |
function GenerateFactionBattlecry(ransom_msg,channel) |
local pc_faction = UnitFactionGroup("player"); |
if (pc_faction == "Alliance") then |
else |
frmBCG:Hide(); |
end; |
elseif (string.lower(param1) == "options") then |
if (BattleCryGenOptions:IsVisible() == false) then |
BattleCryGenOptions:Show(); |
end; |
else |
btnUsage_Click(); |
end; |
end |
-- Show how to use the addon. |
function btnUsage_Click() |
Show_Msg("|cff6666ff Usage:\n"); |
Show_Msg("|cff999999 /bcg show Open Panel"); |
Show_Msg("|cff999999 /bcg options Open Options Panel"); |
Show_Msg("|cff999999 /bcg cfg Open Options Panel"); |
Show_Msg("|cff999999 /bcg y (Yell)"); |
Show_Msg("|cff999999 /bcg s (Say)"); |
Show_Msg("|cff999999 /bcg p (Party)"); |
Show_Msg("|cff6666ff Enjoy the power!\n"); |
end |
function frmBCG_Close() |
-- Hide this addon from view. |
function btnClose_Click() |
frmBCG:Hide(); |
--UWBG_Prefs=1; |
--UWBG_CharPrefs=1; |
--UWBG_CharPrefs=0; |
end |
function frmBCG_OnLoad() |
-- ON LOAD EVENT |
function frmBCG_OnLoad(panel) |
-- Identify us. |
Show_Msg("|cff999999 Ultimate Warcraft Battlecry Generator is Loaded\n"); |
Show_Msg("|cff999999 Version 0.50 for WoW Patch 3.3+\n"); |
Show_Msg("|cff6666ff Type /bcg for options\n"); |
-- BEGIN INTERFACE OPTIONS CODE |
-- Set the name for the Category for the Panel |
panel.name = "UWBCG" .. GetAddOnMetadata("BattleCryGen", "Version"); |
-- When the player clicks okay, run this function. |
panel.okay = function (self) frmBCG_Close(); end; |
-- When the player clicks cancel, run this function. |
panel.cancel = function (self) frmBCG_CancelOrLoad(); end; |
-- Add the panel to the Interface Options |
InterfaceOptions_AddCategory(panel); |
-- END INTERFACE OPTIONS CODE |
SLASH_BCGEN1 = "/bcg"; |
SlashCmdList["BCGEN"] = cmdBCG; |
frmBCG:RegisterEvent("VARIABLES_LOADED") |
frmBCG:RegisterEvent("ADDON_LOADED"); -- Fired when saved variables are loaded |
frmBCG:RegisterEvent("PLAYER_LOGOUT"); -- Fired when about to log out |
frmBCG:RegisterEvent("VARIABLES_LOADED"); |
end |
function cboGen_OnTextChanged() |
CHANGELOG: |
From 0.41 |
+ Added more battlecries, including some cataclysm and Patch 3.3 related ones. |
- Removed some horde battlecries that didn't quite fit |
+ Changed TOC to 30200 |
From 0.10 |
+ Redesigned UI |
+ Added more battlecries, including some cataclysm and Patch 3.3 related ones. |
+ Redesigned UI to support new options dialog. |
+ Improved event support |
+ Changed TOC to 30300 |
+ Now should used Saved Variables correctly |
+ New Options Dialog |
+ BugFix: Form not showing or hiding correctly |
## Title: Ultimate Warcraft Battlecry Generator |
## Author: Nuchaleft (NytewolfAU2k7 on Curse) |
## Version: v00.00.50 |
## Notes: As the title suggests, this addon can generate over 100 hilarious and random battlecries to put fear into your enemies, and to inspire courage in your allies. |
## Notes-enGB: As the title suggests, this addon can generate over 100 hilarious and random battlecries to put fear into your enemies, and to inspire courage in your allies. |
## Notes: As the title suggests, this addon can potentially generate over 100 hilarious and random battlecries to put fear into your enemies, and to inspire courage in your allies. |
## Notes-enGB: As the title suggests, this addon can potentially generate over 100 hilarious and random battlecries to put fear into your enemies, and to inspire courage in your allies. |
## eMail: nwcreations@gmail.com |
## URL: http://nytesgames.webs.com/ |
## X-Category: Other |
/bcg show - will display the main panel again if you've closed it. |
/bcg hide - will hide the main panel. |
/bcg options - will display the options panel again if you've closed it. |
/bcg y - /Yell. Target optional. |
/bcg s - /say. Target optional. |
/bcg p - /Party. Target optional. |
<Frame name="frmBCG" parent="UIParent" movable="true" enableMouse="true"> |
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508883-59c2-4f83-ae10-27aaad48391b" />--> |
<Size> |
<AbsDimension x="345" y="84" /> |
<AbsDimension x="336" y="84" /> |
</Size> |
<Anchors> |
<Anchor point="CENTER" relativeTo="UIParent"> |
</Layer> |
</Layers> |
<Frames> |
<Button name="btnGenOpt" text="O"> |
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />--> |
<Size> |
<AbsDimension x="17" y="18" /> |
</Size> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset> |
<AbsDimension x="264" y="-17" /> |
</Offset> |
</Anchor> |
</Anchors> |
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up"> |
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" /> |
</NormalTexture> |
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down"> |
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" /> |
</PushedTexture> |
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled"> |
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" /> |
</DisabledTexture> |
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD"> |
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" /> |
</HighlightTexture> |
<ButtonText name="$parentText"> |
<FontHeight> |
<AbsValue val="10" /> |
</FontHeight> |
</ButtonText> |
<NormalFont style="GameFontNormal" /> |
<HighlightFont style="GameFontHighlight" /> |
<DisabledFont style="GameFontDisable" /> |
</Button> |
<Frame name="$parentLabel2"> |
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />--> |
<Size> |
</ArrayOfString></Property><Property name="OnSelectionChanged"><?xml version="1.0"?> |
<string /></Property></FrameSkin>--> |
<Size> |
<AbsDimension x="151" y="32" /> |
<AbsDimension x="145" y="32" /> |
</Size> |
<Anchors> |
<Anchor point="TOPLEFT"> |
</Texture> |
<Texture name="$parentMiddle" file="Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame"> |
<Size> |
<AbsDimension x="101" y="64" /> |
<AbsDimension x="95" y="64" /> |
</Size> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT" /> |
</Texture> |
<FontString name="$parentText" font="Fonts\FRIZQT__.TTF" text="Say" justifyH="RIGHT"> |
<Size> |
<AbsDimension x="126" y="10" /> |
<AbsDimension x="120" y="10" /> |
</Size> |
<Anchors> |
<Anchor point="RIGHT" relativeTo="$parentRight"> |
<Frame name="$parentLabel1"> |
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />--> |
<Size> |
<AbsDimension x="240" y="18" /> |
<AbsDimension x="223" y="18" /> |
</Size> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset> |
<AbsDimension x="287" y="-17" /> |
<AbsDimension x="277" y="-13" /> |
</Offset> |
</Anchor> |
</Anchors> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset> |
<AbsDimension x="310" y="-17" /> |
<AbsDimension x="300" y="-13" /> |
</Offset> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick>frmBCG_Close(); |
</OnClick> |
<OnClick>btnClose_Click();</OnClick> |
</Scripts> |
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up"> |
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" /> |
<Button name="btnGenSay" text="Generate!"> |
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />--> |
<Size> |
<AbsDimension x="80" y="33" /> |
<AbsDimension x="76" y="33" /> |
</Size> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset> |
<AbsDimension x="247" y="-37" /> |
<AbsDimension x="241" y="-33" /> |
</Offset> |
</Anchor> |
</Anchors> |
</Frames> |
<Scripts> |
<OnLoad> |
frmBCG_OnLoad(); |
frmBCG_OnLoad(self); |
</OnLoad> |
<OnEvent>frmBCG_OnEvent(); |