diff --git a/Jamba-AdvancedLoot/Jamba-AdvancedLoot.toc b/Jamba-AdvancedLoot/Jamba-AdvancedLoot.toc index 18cbcd2..772423a 100644 --- a/Jamba-AdvancedLoot/Jamba-AdvancedLoot.toc +++ b/Jamba-AdvancedLoot/Jamba-AdvancedLoot.toc @@ -1,8 +1,8 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba-AdvancedLoot ## Notes: Jamba-AdvancedLoot -## Author: Max Schilling, Ebony, Former Author: Jafula -## Version: 3.12 +## Author: Max Schilling +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba @@ -10,5 +10,3 @@ ## LoadOnDemand: 1 Locales\Locales.xml JambaAdvancedLoot.lua - - diff --git a/Jamba-AdvancedLoot/JambaAdvancedLoot.lua b/Jamba-AdvancedLoot/JambaAdvancedLoot.lua index ee7ab63..bbd7cd4 100644 --- a/Jamba-AdvancedLoot/JambaAdvancedLoot.lua +++ b/Jamba-AdvancedLoot/JambaAdvancedLoot.lua @@ -108,7 +108,7 @@ function AJM:SettingsRefresh() end AJM.settingsControl.checkBoxAdvancedLoot:SetValue( AJM.db.advancedLoot ) AJM.settingsControl.checkBoxManageAutoLoot:SetValue( AJM.db.manageAutoLoot ) - AJM.settingsControl.checkBoxAutoCloseLootWindowOnSlaves:SetValue( AJM.db.autoCloseLootWindowOnSlaves ) + AJM.settingsControl.checkBoxAutoCloseLootWindowOnSlaves:SetValue( AJM.db.autoCloseLootWindowOnSlaves ) AJM.settingsControl.dropdownCharacterName:SetValue( AJM.advancedLootItemCharacterName ) AJM.settingsControl.dropdownMessageArea:SetValue( AJM.db.messageArea ) AJM.settingsControl.lootBindPickupEpic:SetValue( AJM.db.lootBindPickupEpic ) @@ -154,6 +154,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -195,13 +197,13 @@ local function SettingsCreateOptions( top ) AJM.SettingsToggleAdvancedLootManageAutoLoot ) movingTop = movingTop - checkBoxHeight - AJM.settingsControl.checkBoxAutoCloseLootWindowOnSlaves = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl.checkBoxAutoCloseLootWindowOnSlaves = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, halfWidth, left, movingTop, - L["Auto Close Loot Window On Slaves"], - AJM.SettingsToggleAutoCloseLootWindowOnSlaves + L["Auto Close Loot Window On Minions"], + AJM.SettingsToggleAutoCloseLootWindowOnMinions ) movingTop = movingTop - checkBoxHeight AJM.settingsControl.advancedLootHighlightRow = 1 @@ -473,7 +475,7 @@ function AJM:SettingsToggleAdvancedLootManageAutoLoot( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleAutoCloseLootWindowOnSlaves( event, checked ) +function AJM:SettingsToggleAutoCloseLootWindowOnMinions( event, checked ) AJM.db.autoCloseLootWindowOnSlaves = checked AJM:SettingsRefresh() end @@ -534,24 +536,23 @@ function AJM:OnInitialize() InitializePopupDialogs() -- Populate the settings. AJM:SettingsRefresh() - -- Create a standalone window for the Advanced Loot. - --[[ - AJM.standaloneWindow = AceGUI:Create( "Window" ) - AJM.standaloneWindow:Hide() - AJM.standaloneWindow:SetTitle( "Jamba-AdvancedLoot" ) - AJM.standaloneWindow:SetLayout( "Fill" ) - AJM.standaloneWindow:AddChild( AJM.settingsControl.widgetSettings ) - AJM.standaloneWindow:SetHeight( 410 ) - AJM.standaloneWindow:SetWidth( 410 ) - AJM.standaloneWindow.frame:SetFrameStrata( "HIGH" ) - ]]-- - - CreateFrame( "GameTooltip", "JambaAdvancedLootScanningTooltip" ); -- Tooltip name cannot be nil - JambaAdvancedLootScanningTooltip:SetOwner( WorldFrame, "ANCHOR_NONE" ); + -- Loot scanning tooltip. + CreateFrame( "GameTooltip", "JambaAdvancedLootScanningTooltip" ) + JambaAdvancedLootScanningTooltip:SetOwner( WorldFrame, "ANCHOR_NONE" ) -- Allow tooltip SetX() methods to dynamically add new lines based on these JambaAdvancedLootScanningTooltip:AddFontStrings( - JambaAdvancedLootScanningTooltip:CreateFontString( "$parentTextLeft1", nil, "GameTooltipText" ), - JambaAdvancedLootScanningTooltip:CreateFontString( "$parentTextRight1", nil, "GameTooltipText" ) ); + JambaAdvancedLootScanningTooltip:CreateFontString( "$parentTextLeft1", nil, "GameTooltipText" ), + JambaAdvancedLootScanningTooltip:CreateFontString( "$parentTextRight1", nil, "GameTooltipText" ) + ) + -- Upgrade character names if necessary. + local realmName = GetRealmName() + for position, itemInfoTable in pairs( AJM.db.advancedLootItems ) do + local characterName = itemInfoTable.characterName + local updateMatchStart = characterName:find( "-" ) + if not updateMatchStart then + itemInfoTable.characterName = characterName.."-"..realmName + end + end end -- Called when the addon is enabled. diff --git a/Jamba-AdvancedLoot/Locales/JambaAdvancedLoot-Locale-enUS.lua b/Jamba-AdvancedLoot/Locales/JambaAdvancedLoot-Locale-enUS.lua index 66c32f8..a3a7c95 100644 --- a/Jamba-AdvancedLoot/Locales/JambaAdvancedLoot-Locale-enUS.lua +++ b/Jamba-AdvancedLoot/Locales/JambaAdvancedLoot-Locale-enUS.lua @@ -14,7 +14,7 @@ L["Merchant"] = true L["Team"] = true L["Advanced Loot"] = true L["Enable Advanced Loot"] = true -L["Auto Close Loot Window On Slaves"] = true +L["Auto Close Loot Window On Minions"] = true L["Manage Auto Loot"] = true L["Push Settings"] = true L["Push the advanced loot settings to all characters in the team."] = true diff --git a/Jamba-DisplayTeam/Jamba-DisplayTeam.toc b/Jamba-DisplayTeam/Jamba-DisplayTeam.toc index f241acd..7d50633 100644 --- a/Jamba-DisplayTeam/Jamba-DisplayTeam.toc +++ b/Jamba-DisplayTeam/Jamba-DisplayTeam.toc @@ -1,8 +1,8 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba-DisplayTeam ## Notes: Jamba-DisplayTeam ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-DisplayTeam/JambaDisplayTeam.lua b/Jamba-DisplayTeam/JambaDisplayTeam.lua index 0fffa3a..310510a 100644 --- a/Jamba-DisplayTeam/JambaDisplayTeam.lua +++ b/Jamba-DisplayTeam/JambaDisplayTeam.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -34,6 +34,7 @@ AJM.settings = { showTeamList = true, showTeamListOnMasterOnly = true, hideTeamListInCombat = false, + enableClique = false, statusBarTexture = L["Blizzard"], borderStyle = L["Blizzard Tooltip"], backgroundStyle = L["Blizzard Dialog Background"], @@ -52,7 +53,7 @@ AJM.settings = { followStatusWidth = 80, followStatusHeight = 20, followStatusShowName = true, - followStatusShowLevel = true, + followStatusShowLevel = true, showExperienceStatus = true, experienceStatusWidth = 80, experienceStatusHeight = 20, @@ -74,10 +75,21 @@ AJM.settings = { powerStatusHeight = 20, powerStatusShowValues = true, powerStatusShowPercentage = true, + showComboStatus = false, + comboStatusWidth = 80, + comboStatusHeight = 20, + comboStatusShowValues = true, + comboStatusShowPercentage = true, showBagInformation = true, showBagFreeSlotsOnly = true, bagInformationWidth = 80, - bagInformationHeight = 20, + bagInformationHeight = 25, + --EbonyTest + stackName = false, + showIlvlInformation = true, + ShowEquippedOnly = false, + --ilvlInformationWidth = 80, + --ilvlInformationHeight = 20, framePoint = "CENTER", frameRelativePoint = "CENTER", frameXOffset = 0, @@ -91,9 +103,15 @@ AJM.settings = { frameBorderColourG = 1.0, frameBorderColourB = 1.0, frameBorderColourA = 1.0, + timerCount = 1 }, } +-- Debug message. +function AJM:DebugMessage( ... ) + --AJM:Print( ... ) +end + -- Configuration. function AJM:GetConfiguration() local configuration = { @@ -139,7 +157,9 @@ end AJM.COMMAND_FOLLOW_STATUS_UPDATE = "FlwStsUpd" AJM.COMMAND_EXPERIENCE_STATUS_UPDATE = "ExpStsUpd" AJM.COMMAND_BAGINFORMATION_UPDATE = "BagInfoUpd" +AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE = "IlvlInfoUpd" AJM.COMMAND_REPUTATION_STATUS_UPDATE = "RepStsUpd" +AJM.COMMAND_COMBO_STATUS_UPDATE = "CboStsUpd" ------------------------------------------------------------------------------------------------------------- -- Messages module sends. @@ -174,7 +194,9 @@ local function GetCharacterHeight() local heightReputationStatus = 0 local heightHealthStatus = 0 local heightPowerStatus = 0 + local heightComboStatus = 0 local heightBagInformation = 0 + --local heightIlvlInformation = 0 local heightAllBars = 0 if AJM.db.showCharacterPortrait == true then heightPortrait = AJM.db.characterPortraitWidth + AJM.db.teamListVerticalSpacing @@ -183,6 +205,10 @@ local function GetCharacterHeight() heightBagInformation = AJM.db.bagInformationHeight + AJM.db.teamListVerticalSpacing heightAllBars = heightAllBars + heightBagInformation end + --if AJM.db.showIlvlInformation == true then + -- heightIlvlInformation = AJM.db.ilvlInformationHeight + AJM.db.teamListVerticalSpacing + -- heightAllBars = heightAllBars + heightIlvlInformation + --end if AJM.db.showFollowStatus == true then heightFollowStatus = AJM.db.followStatusHeight + AJM.db.barVerticalSpacing heightAllBars = heightAllBars + heightFollowStatus @@ -203,10 +229,14 @@ local function GetCharacterHeight() heightPowerStatus = AJM.db.powerStatusHeight + AJM.db.barVerticalSpacing heightAllBars = heightAllBars + heightPowerStatus end + if AJM.db.showComboStatus == true then + heightComboStatus = AJM.db.comboStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightComboStatus + end if AJM.db.barsAreStackedVertically == true then height = max( heightPortrait, heightAllBars ) else - height = max( heightPortrait, heightBagInformation, heightFollowStatus, heightExperienceStatus, heightReputationStatus, heightHealthStatus, heightPowerStatus ) + height = max( heightPortrait, heightBagInformation, heightFollowStatus, heightExperienceStatus, heightReputationStatus, heightHealthStatus, heightPowerStatus, heightComboStatus ) end return height end @@ -219,7 +249,9 @@ local function GetCharacterWidth() local widthReputationStatus = 0 local widthHealthStatus = 0 local widthPowerStatus = 0 + local widthComboStatus = 0 local widthBagInformation = 0 + local widthIvlInformation = 0 local widthAllBars = 0 if AJM.db.showCharacterPortrait == true then widthPortrait = AJM.db.characterPortraitWidth + AJM.db.teamListHorizontalSpacing @@ -228,6 +260,10 @@ local function GetCharacterWidth() widthBagInformation = AJM.db.bagInformationWidth + AJM.db.teamListHorizontalSpacing widthAllBars = widthAllBars + widthBagInformation end + --if AJM.db.showIlvlInformation == true then + -- widthIlvlInformation = AJM.db.ilvlInformationWidth + AJM.db.teamListHorizontalSpacing + -- widthAllBars = widthAllBars + widthIlvlInformation + --end if AJM.db.showFollowStatus == true then widthFollowStatus = AJM.db.followStatusWidth + AJM.db.barHorizontalSpacing widthAllBars = widthAllBars + widthFollowStatus @@ -247,9 +283,13 @@ local function GetCharacterWidth() if AJM.db.showPowerStatus == true then widthPowerStatus = AJM.db.powerStatusWidth + AJM.db.barHorizontalSpacing widthAllBars = widthAllBars + widthPowerStatus - end + end + if AJM.db.showComboStatus == true then + widthComboStatus = AJM.db.comboStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthComboStatus + end if AJM.db.barsAreStackedVertically == true then - width = widthPortrait + max( widthBagInformation, widthFollowStatus, widthExperienceStatus, widthReputationStatus, widthHealthStatus, widthPowerStatus ) + width = widthPortrait + max( widthBagInformation, widthFollowStatus, widthExperienceStatus, widthReputationStatus, widthHealthStatus, widthPowerStatus, widthComboStatus ) else width = widthPortrait + widthAllBars end @@ -288,7 +328,9 @@ local function CreateJambaTeamListFrame() frame:SetScript( "OnDragStart", function( this ) if IsAltKeyDown() then - this:StartMoving() + if not UnitAffectingCombat("player") then + this:StartMoving() + end end end ) frame:SetScript( "OnDragStop", @@ -376,6 +418,7 @@ function AJM:RefreshTeamListControlsHide() return end for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + characterName = JambaUtilities:AddRealmToNameIfMissing ( characterName ) -- Hide their status bar. AJM:HideJambaTeamStatusBar( characterName ) end @@ -390,6 +433,7 @@ function AJM:RefreshTeamListControlsShow() -- Iterate all the team members. AJM.totalMembersDisplayed = 0 for index, characterName in JambaApi.TeamListOrdered() do + characterName = JambaUtilities:AddRealmToNameIfMissing ( characterName ) -- Is the team member online? if JambaApi.GetCharacterOnlineStatus( characterName ) == true then -- Yes, the team member is online, draw their status bars. @@ -423,6 +467,9 @@ function AJM:SettingsUpdateStatusBarTexture() characterStatusBar["powerBar"]:SetStatusBarTexture( statusBarTexture ) characterStatusBar["powerBar"]:GetStatusBarTexture():SetHorizTile( false ) characterStatusBar["powerBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["comboBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["comboBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["comboBar"]:GetStatusBarTexture():SetVertTile( false ) end end @@ -453,13 +500,12 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) --SetPortraitTexture( portraitButton.Texture, characterName ) --portraitButton.Texture:SetAllPoints() portraitButton:ClearModel() - portraitButton:SetUnit( characterName ) + portraitButton:SetUnit( Ambiguate( characterName, "short" ) ) portraitButton:SetPortraitZoom( 1 ) portraitButton:SetCamDistanceScale( 1 ) portraitButton:SetPosition( 0, 0, 0 ) local portraitButtonClick = CreateFrame( "CheckButton", portraitName.."Click", parentFrame, "SecureActionButtonTemplate" ) - portraitButtonClick:SetAttribute( "type", "macro" ) - portraitButtonClick:SetAttribute( "macrotext", "/targetexact "..characterName ) + portraitButtonClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) characterStatusBar["portraitButton"] = portraitButton characterStatusBar["portraitButtonClick"] = portraitButtonClick -- Set the bag information. @@ -467,6 +513,7 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) local bagInformationFrame = CreateFrame( "Frame", bagInformationFrameName, parentFrame ) local bagInformationFrameText = bagInformationFrame:CreateFontString( bagInformationFrameName.."Text", "OVERLAY", "GameFontNormal" ) bagInformationFrameText:SetText( "999/999" ) + bagInformationFrame:SetAlpha( 1 ) --bagInformationFrameText:SetPoint( "CENTER", bagInformationFrame, "CENTER", 0, 0 ) bagInformationFrameText:SetAllPoints() bagInformationFrameText:SetJustifyH( "CENTER" ) @@ -474,8 +521,23 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) bagInformationFrameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) bagInformationFrame.slotsFree = 999 bagInformationFrame.totalSlots = 999 + --bagInformationFrame.durability = 100 characterStatusBar["bagInformationFrame"] = bagInformationFrame characterStatusBar["bagInformationFrameText"] = bagInformationFrameText + --set the ilevel Information. + local ilvlInformationFrameName = AJM.globalFramePrefix.."IlvlInformationFrame" + local ilvlInformationFrame = CreateFrame( "Frame", ilvlInformationFrameName, parentFrame ) + local ilvlInformationFrameText = ilvlInformationFrame:CreateFontString( ilvlInformationFrameName.."Text", "OVERLAY", "GameFontNormal" ) + ilvlInformationFrameText:SetText( "999/999" ) + ilvlInformationFrameText:SetAllPoints() + ilvlInformationFrameText:SetJustifyH( "CENTER" ) + ilvlInformationFrameText:SetJustifyV( "MIDDLE" ) + ilvlInformationFrameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + ilvlInformationFrame.overall = 999 + ilvlInformationFrame.equipped = 999 + ilvlInformationFrame.characterLevel = 0 + characterStatusBar["ilvlInformationFrame"] = ilvlInformationFrame + characterStatusBar["ilvlInformationFrameText"] = ilvlInformationFrameText -- Set the follow bar. local followName = AJM.globalFramePrefix.."FollowBar" local followBar = CreateFrame( "StatusBar", followName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) @@ -488,9 +550,10 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) followBar:SetMinMaxValues( 0, 100 ) followBar:SetValue( 100 ) followBar:SetFrameStrata( "LOW" ) + followBar:SetAlpha( 1 ) local followBarClick = CreateFrame( "CheckButton", followName.."Click", parentFrame, "SecureActionButtonTemplate" ) - followBarClick:SetAttribute( "type", "macro" ) - followBarClick:SetAttribute( "macrotext", "/targetexact "..characterName ) + followBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + --followBarClick:SetAttribute( "macrotext", "/targetexact "..characterName ) followBarClick:SetFrameStrata( "MEDIUM" ) characterStatusBar["followBar"] = followBar characterStatusBar["followBarClick"] = followBarClick @@ -498,7 +561,7 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) followBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) followBarText:SetAllPoints() characterStatusBar["followBarText"] = followBarText - AJM:SettingsUpdateFollowText( characterName, UnitLevel( characterName ) ) + AJM:SettingsUpdateFollowText( characterName, UnitLevel( Ambiguate( characterName, "none" ) ), nil, nil ) -- Set the experience bar. local experienceName = AJM.globalFramePrefix.."ExperienceBar" local experienceBar = CreateFrame( "StatusBar", experienceName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) @@ -511,8 +574,7 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) experienceBar:SetValue( 100 ) experienceBar:SetFrameStrata( "LOW" ) local experienceBarClick = CreateFrame( "CheckButton", experienceName.."Click", parentFrame, "SecureActionButtonTemplate" ) - experienceBarClick:SetAttribute( "type", "macro" ) - experienceBarClick:SetAttribute( "macrotext", "/targetexact "..characterName ) + experienceBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) experienceBarClick:SetFrameStrata( "MEDIUM" ) characterStatusBar["experienceBar"] = experienceBar characterStatusBar["experienceBarClick"] = experienceBarClick @@ -535,9 +597,9 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) reputationBar:SetMinMaxValues( 0, 100 ) reputationBar:SetValue( 100 ) reputationBar:SetFrameStrata( "LOW" ) + reputationBar:SetAlpha( 1 ) local reputationBarClick = CreateFrame( "CheckButton", reputationName.."Click", parentFrame, "SecureActionButtonTemplate" ) - reputationBarClick:SetAttribute( "type", "macro" ) - reputationBarClick:SetAttribute( "macrotext", "/targetexact "..characterName ) + reputationBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) reputationBarClick:SetFrameStrata( "MEDIUM" ) characterStatusBar["reputationBar"] = reputationBar characterStatusBar["reputationBarClick"] = reputationBarClick @@ -562,8 +624,9 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) healthBar:SetMinMaxValues( 0, 100 ) healthBar:SetValue( 100 ) healthBar:SetFrameStrata( "LOW" ) + healthBar:SetAlpha( 1 ) local healthBarClick = CreateFrame( "CheckButton", healthName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) - healthBarClick:SetAttribute( "unit", characterName ) + healthBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) healthBarClick:SetFrameStrata( "MEDIUM" ) characterStatusBar["healthBar"] = healthBar characterStatusBar["healthBarClick"] = healthBarClick @@ -585,8 +648,9 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) powerBar:SetMinMaxValues( 0, 100 ) powerBar:SetValue( 100 ) powerBar:SetFrameStrata( "LOW" ) + powerBar:SetAlpha( 1 ) local powerBarClick = CreateFrame( "CheckButton", powerName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) - powerBarClick:SetAttribute( "unit", characterName ) + powerBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) powerBarClick:SetFrameStrata( "MEDIUM" ) characterStatusBar["powerBar"] = powerBar characterStatusBar["powerBarClick"] = powerBarClick @@ -597,10 +661,52 @@ function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) powerBarText.playerMaxPower = 100 characterStatusBar["powerBarText"] = powerBarText AJM:UpdatePowerStatus( characterName, nil, nil, nil ) + -- Set the Combo Points bar. + local comboName = AJM.globalFramePrefix.."ComboBar" + local comboBar = CreateFrame( "StatusBar", comboName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + comboBar.backgroundTexture = comboBar:CreateTexture( comboName.."BackgroundTexture", "ARTWORK" ) + comboBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + comboBar:SetStatusBarTexture( statusBarTexture ) + comboBar:GetStatusBarTexture():SetHorizTile( false ) + comboBar:GetStatusBarTexture():SetVertTile( false ) + comboBar:SetStatusBarColor( 1.00, 0.0, 0.0, 1.00 ) + comboBar:SetMinMaxValues( 0, 5 ) + comboBar:SetValue( 5 ) + comboBar:SetFrameStrata( "LOW" ) + comboBar:SetAlpha( 1 ) + local comboBarClick = CreateFrame( "CheckButton", comboName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) + comboBarClick:SetAttribute( "unit", characterName ) + comboBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["comboBar"] = comboBar + characterStatusBar["comboBarClick"] = comboBarClick + local comboBarText = comboBar:CreateFontString( comboName.."Text", "OVERLAY", "GameFontNormal" ) + comboBarText:SetTextColor( 1.00, 1.00, 0.0, 1.00 ) + comboBarText:SetAllPoints() + comboBarText.playerCombo = 0 + comboBarText.playerMaxCombo = 5 + characterStatusBar["comboBarText"] = comboBarText + AJM:UpdateComboStatus( characterName, nil, nil ) -- Add the health and power click bars to ClickCastFrames for addons like Clique to use. + --Ebony if Support for Clique if not on then default to target unit + --TODO there got to be a better way to doing this for sure but right now i can not be assed to do this for now you need to reload the UI when turning off and on clique support. ClickCastFrames = ClickCastFrames or {} - ClickCastFrames[healthBarClick] = true - ClickCastFrames[powerBarClick] = true + if AJM.db.enableClique == true then + ClickCastFrames[portraitButtonClick] = true + ClickCastFrames[followBarClick] = true + ClickCastFrames[experienceBarClick] = true + ClickCastFrames[reputationBarClick] = true + ClickCastFrames[healthBarClick] = true + ClickCastFrames[powerBarClick] = true + ClickCastFrames[comboBarClick] = true + else + portraitButtonClick:SetAttribute( "type1", "target") + followBarClick:SetAttribute( "type1", "target") + experienceBarClick:SetAttribute( "type1", "target") + reputationBarClick:SetAttribute( "type1", "target") + healthBarClick:SetAttribute( "type1", "target") + powerBarClick:SetAttribute( "type1", "target") + comboBarClick:SetAttribute( "type1", "target") + end end function AJM:HideJambaTeamStatusBar( characterName ) @@ -615,6 +721,7 @@ function AJM:HideJambaTeamStatusBar( characterName ) characterStatusBar["portraitButton"]:Hide() characterStatusBar["portraitButtonClick"]:Hide() characterStatusBar["bagInformationFrame"]:Hide() + characterStatusBar["ilvlInformationFrame"]:Hide() characterStatusBar["followBar"]:Hide() characterStatusBar["followBarClick"]:Hide() characterStatusBar["experienceBar"]:Hide() @@ -625,6 +732,8 @@ function AJM:HideJambaTeamStatusBar( characterName ) characterStatusBar["healthBarClick"]:Hide() characterStatusBar["powerBar"]:Hide() characterStatusBar["powerBarClick"]:Hide() + characterStatusBar["comboBar"]:Hide() + characterStatusBar["comboBarClick"]:Hide() end function AJM:UpdateJambaTeamStatusBar( characterName, characterPosition ) @@ -672,7 +781,7 @@ function AJM:UpdateJambaTeamStatusBar( characterName, characterPosition ) end -- Display the follow bar. local followBar = characterStatusBar["followBar"] - local followBarClick = characterStatusBar["followBarClick"] + local followBarClick = characterStatusBar["followBarClick"] if AJM.db.showFollowStatus == true then followBar.backgroundTexture:SetAllPoints() followBar:SetWidth( AJM.db.followStatusWidth ) @@ -780,6 +889,28 @@ function AJM:UpdateJambaTeamStatusBar( characterName, characterPosition ) powerBar:Hide() powerBarClick:Hide() end + -- Display the Combo Point bar. + local comboBar = characterStatusBar["comboBar"] + local comboBarClick = characterStatusBar["comboBarClick"] + if AJM.db.showComboStatus == true then + comboBar.backgroundTexture:SetAllPoints() + comboBar:SetWidth( AJM.db.comboStatusWidth ) + comboBar:SetHeight( AJM.db.comboStatusHeight ) + comboBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + comboBarClick:SetWidth( AJM.db.comboStatusWidth ) + comboBarClick:SetHeight( AJM.db.comboStatusHeight ) + comboBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + comboBar:Show() + comboBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.comboStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.comboStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + comboBar:Hide() + comboBarClick:Hide() + end -- Display the bag information local bagInformationFrame = characterStatusBar["bagInformationFrame"] local bagInformationFrameText = characterStatusBar["bagInformationFrameText"] @@ -796,6 +927,24 @@ function AJM:UpdateJambaTeamStatusBar( characterName, characterPosition ) else bagInformationFrame:Hide() end + --[[ + -- Display the ilevel information + local ilvlInformationFrame = characterStatusBar["ilvlInformationFrame"] + local ilvlInformationFrameText = characterStatusBar["ilvlInformationFrameText"] + if AJM.db.showIlvlInformation == true then + ilvlInformationFrame:SetWidth( AJM.db.ilvlInformationWidth ) + ilvlInformationFrame:SetHeight( AJM.db.ilvlInformationHeight ) + ilvlInformationFrame:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + ilvlInformationFrame:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.ilvlInformationHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.ilvlInformationWidth + AJM.db.teamListHorizontalSpacing + end + else + ilvlInformationFrame:Hide() + end + --]] end ------------------------------------------------------------------------------------------------------------- @@ -805,6 +954,7 @@ end local function SettingsCreateDisplayOptions( top ) -- Get positions. local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() + local labelContinueHeight = JambaHelperSettings:GetContinueLabelHeight() local sliderHeight = JambaHelperSettings:GetSliderHeight() local mediaHeight = JambaHelperSettings:GetMediaHeight() local left = JambaHelperSettings:LeftOfSettings() @@ -847,6 +997,15 @@ local function SettingsCreateDisplayOptions( top ) movingTop, L["Hide Team List In Combat"], AJM.SettingsToggleHideTeamListInCombat + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxEnableClique = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Enable Clique Support - **reload UI to take effect**"], + AJM.SettingsToggleEnableClique ) movingTop = movingTop - checkBoxHeight - verticalSpacing -- Create appearance & layout. @@ -984,15 +1143,40 @@ local function SettingsCreateDisplayOptions( top ) movingTop, L["Name"], AJM.SettingsToggleShowFollowStatusName + ) + AJM.settingsControl.displayOptionsCheckBoxstackName = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Stack Text"], + AJM.SettingsTogglestackName ) + movingTop = movingTop - checkBoxHeight - verticalSpacing AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusLevel = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, thirdWidth, - left3, + left, movingTop, L["Level"], AJM.SettingsToggleShowFollowStatusLevel - ) + ) + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Show Item Level"], + AJM.SettingsToggleShowIlvlInformation + ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left3, + movingTop, + L["Equipped iLvl Only"], + AJM.SettingsToggleShowEquippedOnly + ) movingTop = movingTop - checkBoxHeight - verticalSpacing AJM.settingsControl.displayOptionsFollowStatusWidthSlider = JambaHelperSettings:CreateSlider( AJM.settingsControl, @@ -1210,6 +1394,53 @@ local function SettingsCreateDisplayOptions( top ) AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetSliderValues( 5, 50, 1 ) AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangePowerStatusHeight ) movingTop = movingTop - sliderHeight - sectionSpacing + -- Create Combo Point status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Combo Point Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowComboStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowComboStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowComboStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsComboStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeComboStatusWidth ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeComboStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing -- Create bag information status. JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Bag Information"], movingTop, true ) movingTop = movingTop - headingHeight @@ -1247,9 +1478,50 @@ local function SettingsCreateDisplayOptions( top ) L["Height"] ) AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetSliderValues( 5, 50, 1 ) - AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeBagInformationHeight ) + AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeBagInformationHeight ) + movingTop = movingTop - sliderHeight - verticalSpacing + --[[ + -- Create Ilvl information status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Players Item Level Information"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowIlvlInformation + ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left2, + movingTop, + L["Only Show Equipped Item Level Only"], + AJM.SettingsToggleShowEquippedOnly + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeIlvlInformationWidth ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeIlvlInformationHeight ) movingTop = movingTop - sliderHeight - verticalSpacing - return movingTop + --]] + return movingTop end local function SettingsCreate() @@ -1284,6 +1556,7 @@ function AJM:SettingsRefresh() AJM.settingsControl.displayOptionsCheckBoxShowTeamList:SetValue( AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxShowTeamListOnlyOnMaster:SetValue( AJM.db.showTeamListOnMasterOnly ) AJM.settingsControl.displayOptionsCheckBoxHideTeamListInCombat:SetValue( AJM.db.hideTeamListInCombat ) + AJM.settingsControl.displayOptionsCheckBoxEnableClique:SetValue( AJM.db.enableClique ) AJM.settingsControl.displayOptionsCheckBoxStackVertically:SetValue( AJM.db.barsAreStackedVertically ) AJM.settingsControl.displayOptionsCheckBoxTeamHorizontal:SetValue( AJM.db.teamListHorizontal ) AJM.settingsControl.displayOptionsCheckBoxShowListTitle:SetValue( AJM.db.showListTitle ) @@ -1320,18 +1593,30 @@ function AJM:SettingsRefresh() AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusPercentage:SetValue( AJM.db.powerStatusShowPercentage ) AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetValue( AJM.db.powerStatusWidth ) AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetValue( AJM.db.powerStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus:SetValue( AJM.db.showComboStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues:SetValue( AJM.db.comboStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage:SetValue( AJM.db.comboStatusShowPercentage ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetValue( AJM.db.comboStatusWidth ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetValue( AJM.db.comboStatusHeight ) AJM.settingsControl.displayOptionsBackgroundColourPicker:SetColor( AJM.db.frameBackgroundColourR, AJM.db.frameBackgroundColourG, AJM.db.frameBackgroundColourB, AJM.db.frameBackgroundColourA ) AJM.settingsControl.displayOptionsBorderColourPicker:SetColor( AJM.db.frameBorderColourR, AJM.db.frameBorderColourG, AJM.db.frameBorderColourB, AJM.db.frameBorderColourA ) AJM.settingsControl.displayOptionsCheckBoxShowBagInformation:SetValue( AJM.db.showBagInformation ) AJM.settingsControl.displayOptionsCheckBoxShowFreeBagSlotsOnly:SetValue( AJM.db.showBagFreeSlotsOnly ) AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetValue( AJM.db.bagInformationWidth ) - AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetValue( AJM.db.bagInformationHeight ) + AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetValue( AJM.db.bagInformationHeight ) + --Ebony + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation:SetValue( AJM.db.showIlvlInformation ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly:SetValue( AJM.db.ShowEquippedOnly ) + AJM.settingsControl.displayOptionsCheckBoxstackName:SetValue( AJM.db.stackName ) + --AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetValue( AJM.db.ilvlInformationWidth ) + --AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetValue( AJM.db.ilvlInformationHeight ) -- State. -- Trying to change state in combat lockdown causes taint. Let's not do that. Eventually it would be nice to have a "proper state driven team display", -- but this workaround is enough for now. if not InCombatLockdown() then AJM.settingsControl.displayOptionsCheckBoxShowTeamListOnlyOnMaster:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxHideTeamListInCombat:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxEnableClique:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxStackVertically:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxTeamHorizontal:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxShowListTitle:SetDisabled( not AJM.db.showTeamList ) @@ -1368,12 +1653,22 @@ function AJM:SettingsRefresh() AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusPercentage:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsBackgroundColourPicker:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsBorderColourPicker:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxShowBagInformation:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsCheckBoxShowFreeBagSlotsOnly:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetDisabled( not AJM.db.showTeamList ) AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxstackName:SetDisabled( not AJM.db.showTeamList ) + --AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetDisabled( not AJM.db.showTeamList ) + --AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetDisabled( not AJM.db.showTeamList ) if AJM.teamListCreated == true then AJM:RefreshTeamListControls() AJM:SettingsUpdateBorderStyle() @@ -1384,7 +1679,9 @@ function AJM:SettingsRefresh() AJM:SettingsUpdateReputationAll() AJM:SettingsUpdateHealthAll() AJM:SettingsUpdatePowerAll() + AJM:SettingsUpdateComboAll() AJM:SettingsUpdateBagInformationAll() + --AJM:SettingsUpdateIlvlInformationAll() end else AJM.updateSettingsAfterCombat = true @@ -1398,6 +1695,7 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.showTeamList = settings.showTeamList AJM.db.showTeamListOnMasterOnly = settings.showTeamListOnMasterOnly AJM.db.hideTeamListInCombat = settings.hideTeamListInCombat + AJM.db.enableClique = settings.enableClique AJM.db.barsAreStackedVertically = settings.barsAreStackedVertically AJM.db.teamListHorizontal = settings.teamListHorizontal AJM.db.showListTitle = settings.showListTitle @@ -1433,10 +1731,21 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.powerStatusHeight = settings.powerStatusHeight AJM.db.powerStatusShowValues = settings.powerStatusShowValues AJM.db.powerStatusShowPercentage = settings.powerStatusShowPercentage + AJM.db.showComboStatus = settings.showComboStatus + AJM.db.comboStatusWidth = settings.comboStatusWidth + AJM.db.comboStatusHeight = settings.comboStatusHeight + AJM.db.comboStatusShowValues = settings.comboStatusShowValues + AJM.db.comboStatusShowPercentage = settings.comboStatusShowPercentage AJM.db.showBagInformation = settings.showBagInformation AJM.db.showBagFreeSlotsOnly = settings.showBagFreeSlotsOnly AJM.db.bagInformationWidth = settings.bagInformationWidth AJM.db.bagInformationHeight = settings.bagInformationHeight + --EBS + AJM.db.showIlvlInformation = settings.showIlvlInformation + AJM.db.ShowEquippedOnly = settings.ShowEquippedOnly + AJM.db.stackName = settings.stackName + --AJM.db.ilvlInformationWidth = settings.ilvlInformationWidth + --AJM.db.ilvlInformationHeight = settings.ilvlInformationHeight AJM.db.frameAlpha = settings.frameAlpha AJM.db.framePoint = settings.framePoint AJM.db.frameRelativePoint = settings.frameRelativePoint @@ -1454,6 +1763,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -1480,6 +1791,11 @@ function AJM:SettingsToggleHideTeamListInCombat( event, checked ) AJM:SettingsRefresh() end +function AJM:SettingsToggleEnableClique( event, checked ) + AJM.db.enableClique = checked + AJM:SettingsRefresh() +end + function AJM:SettingsToggleStackVertically( event, checked ) AJM.db.barsAreStackedVertically = checked AJM:SettingsRefresh() @@ -1567,7 +1883,7 @@ end function AJM:SettingsToggleShowExperienceStatusPercentage( event, checked ) AJM.db.experienceStatusShowPercentage = checked - AJM:SettingsRefresh() + AJM.SettingsRefresh() end function AJM:SettingsChangeExperienceStatusWidth( event, value ) @@ -1660,6 +1976,30 @@ function AJM:SettingsChangePowerStatusHeight( event, value ) AJM:SettingsRefresh() end +function AJM:SettingsToggleShowComboStatus( event, checked ) + AJM.db.showComboStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowComboStatusValues( event, checked ) + AJM.db.comboStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowComboStatusPercentage( event, checked ) + AJM.db.comboStatusShowPercentage = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeComboStatusWidth( event, value ) + AJM.db.comboStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeComboStatusHeight( event, value ) + AJM.db.comboStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end function AJM:SettingsBackgroundColourPickerChanged( event, r, g, b, a ) AJM.db.frameBackgroundColourR = r AJM.db.frameBackgroundColourG = g @@ -1696,12 +2036,41 @@ function AJM:SettingsChangeBagInformationHeight( event, value ) AJM:SettingsRefresh() end +--ilvl +function AJM:SettingsToggleShowIlvlInformation( event, checked ) + AJM.db.showIlvlInformation = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowEquippedOnly( event, checked ) + AJM.db.ShowEquippedOnly = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsTogglestackName( event, checked ) + AJM.db.stackName = checked + AJM:SettingsRefresh() +end + +--[[ +function AJM:SettingsChangeIlvlInformationWidth( event, value ) + AJM.db.ilvlInformationWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeIlvlInformationHeight( event, value ) + AJM.db.ilvlInformationHeight = tonumber( value ) + AJM:SettingsRefresh() +end +--]] + ------------------------------------------------------------------------------------------------------------- -- Commands. ------------------------------------------------------------------------------------------------------------- -- A Jamba command has been recieved. function AJM:JambaOnCommandReceived( characterName, commandName, ... ) + AJM:DebugMessage( "JambaOnCommandReceived", characterName ) if commandName == AJM.COMMAND_FOLLOW_STATUS_UPDATE then AJM:ProcessUpdateFollowStatusMessage( characterName, ... ) end @@ -1714,6 +2083,12 @@ function AJM:JambaOnCommandReceived( characterName, commandName, ... ) if commandName == AJM.COMMAND_BAGINFORMATION_UPDATE then AJM:ProcessUpdateBagInformationMessage( characterName, ... ) end +if commandName == AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE then + AJM:ProcessUpdateIlvlInformationMessage( characterName, ... ) + end + if commandName == AJM.COMMAND_COMBO_STATUS_UPDATE then + AJM:ProcessUpdateComboStatusMessage( characterName, ... ) + end end ------------------------------------------------------------------------------------------------------------- @@ -1731,12 +2106,31 @@ end ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- +-- Range Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:RangeUpdateCommand() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + --AJM:Print("name", characterName ) + local name = Ambiguate( characterName, "none" ) + local range = UnitInRange( name ) + AJM:UpdateHealthStatus( name, nil, nil, range, nil ) + AJM:UpdatePowerStatus( name, nil, nil, range ) + AJM:UpdateComboStatus( name, nil, nil, range ) + AJM:UpdateReputationStatus( name, nil, nil, nil, nil, nil, range ) + AJM:UpdateExperienceStatus( name, nil, nil, nil, range ) + AJM:ProcessUpdateBagInformationMessage( name, nil, nil, range ) + end +end + + +------------------------------------------------------------------------------------------------------------- -- Bag Information Updates. ------------------------------------------------------------------------------------------------------------- function AJM:ITEM_PUSH( event, ... ) AJM:SendBagInformationUpdateCommand() -end +end function AJM:SendBagInformationUpdateCommand() if AJM.db.showTeamList == true and AJM.db.showBagInformation == true then @@ -1747,33 +2141,49 @@ function AJM:SendBagInformationUpdateCommand() return end local slotsFree, totalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) - if AJM.previousSlotsFree ~= slotsFree or AJM.previousTotalSlots ~= totalSlots then + local curTotal, maxTotal, broken = 0, 0, 0 + --for i = 1, 18 do + -- local curItemDurability, maxItemDurability = GetInventoryItemDurability(i) + --if curItemDurability and maxItemDurability then + -- curTotal = curTotal + curItemDurability + -- maxTotal = maxTotal + maxItemDurability + -- if maxItemDurability > 0 and curItemDurability == 0 then + -- broken = broken + 1 + -- end + --end + --end + --local percent = curTotal / maxTotal * 100 + --return percent, broken + --AJM:Print("Durability", percent, broken) + --if AJM.previousSlotsFree ~= slotsFree or AJM.previousTotalSlots ~= totalSlots then if AJM.db.showTeamListOnMasterOnly == true then AJM:JambaSendCommandToMaster( AJM.COMMAND_BAGINFORMATION_UPDATE, slotsFree, totalSlots ) else AJM:JambaSendCommandToTeam( AJM.COMMAND_BAGINFORMATION_UPDATE, slotsFree, totalSlots ) end - end + --end end end -function AJM:ProcessUpdateBagInformationMessage( characterName, slotsFree, totalSlots ) - AJM:UpdateBagInformation( characterName, slotsFree, totalSlots ) +function AJM:ProcessUpdateBagInformationMessage( characterName, slotsFree, totalSlots, range ) + AJM:UpdateBagInformation( characterName, slotsFree, totalSlots, range ) end function AJM:SettingsUpdateBagInformationAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:UpdateBagInformation( characterName, nil, nil ) + AJM:UpdateBagInformation( characterName, nil, nil, nil ) end end -function AJM:UpdateBagInformation( characterName, slotsFree, totalSlots ) +function AJM:UpdateBagInformation( characterName, slotsFree, totalSlots, range ) --percent, range ) + --AJM:Print("Data", characterName, slotsFree, totalSlots, percent ) if CanDisplayTeamList() == false then return end if AJM.db.showBagInformation == false then return end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -1786,15 +2196,69 @@ function AJM:UpdateBagInformation( characterName, slotsFree, totalSlots ) if totalSlots == nil then totalSlots = bagInformationFrame.totalSlots end + --if percent == nil or percent == false then + -- percent = bagInformationFrame.durability + --end bagInformationFrame.slotsFree = slotsFree bagInformationFrame.totalSlots = totalSlots + --bagInformationFrame.durability = percent + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + bagInformationFrame:SetAlpha( 0.5 ) + else + bagInformationFrame:SetAlpha( 1 ) + end + else + bagInformationFrame:SetAlpha( 1 ) + end + + --AJM:Print("test", percent) + --local durability = gsub(percent, "%.[^|]+", "") + --AJM:Print("hello", durability) + --text = text..L["Dura"]..L[" "]..tostring(gsub(percent, "%.[^|]+", "") )..L["%"] local text = "" if AJM.db.showBagFreeSlotsOnly == true then + --text = text..("\n")..L["BgS"]..L[" "]..tostring(slotsFree) text = tostring(slotsFree) else + --text = text..("\n")..L["BgS"]..L[" "]..tostring((totalSlots - slotsFree)).."/"..tostring(totalSlots) text = tostring((totalSlots - slotsFree)).."/"..tostring(totalSlots) end - bagInformationFrameText:SetText( text ) + bagInformationFrameText:SetText( text ) + --AJM:Print("freespace", slotsFree, totalSlots) --Debug +end + +------------------------------------------------------------------------------------------------------------- +-- Ilvl Information Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:ITEMLVL_PUSH( event, ... ) + AJM:SendIlvlInformationUpdateCommand() +end + +function AJM:PLAYER_EQUIPMENT_CHANGED( event, ... ) + AJM:SendIlvlInformationUpdateCommand() +end + + +function AJM:SendIlvlInformationUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showIlvlInformation == true or AJM.db.followStatusShowLevel == true then + if UnitIsGhost( "player" ) then + return + end + if UnitIsDead( "player" ) then + return + end + local overall, equipped = GetAverageItemLevel() + local characterLevel = UnitLevel("player") + --if AJM.previousIlvl ~= overall then ---or AJM.previousTotalSlots ~= totalSlots then + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE, characterLevel, overall, equipped ) + else + AJM:JambaSendCommandToTeam( AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE, characterLevel, overall, equipped ) + end + --end + end end ------------------------------------------------------------------------------------------------------------- @@ -1833,6 +2297,7 @@ function AJM:ProcessUpdateFollowStatusMessage( characterName, isFollowing ) AJM:UpdateFollowStatus( characterName, isFollowing, false ) end +--TODO: Ebony,-- See if this code could be cleaned up a little as when in combat takes a few mins after to catch up. Sending add-on msg with combat? function AJM:UpdateFollowStatus( characterName, isFollowing, isFollowLeader ) if CanDisplayTeamList() == false then return @@ -1840,6 +2305,7 @@ function AJM:UpdateFollowStatus( characterName, isFollowing, isFollowLeader ) if AJM.db.showFollowStatus == false then return end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -1859,35 +2325,77 @@ function AJM:UpdateFollowStatus( characterName, isFollowing, isFollowLeader ) end end +function AJM:ProcessUpdateIlvlInformationMessage( characterName, characterLevel, overall, equipped ) + AJM:SettingsUpdateFollowText( characterName, characterLevel, overall, equipped ) +end + + function AJM:SettingsUpdateFollowTextAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:SettingsUpdateFollowText( characterName, UnitLevel( characterName ) ) + AJM:SettingsUpdateFollowText( characterName, nil, nil, nil ) + --AJM:SettingsUpdateFollowText( characterName, nil, nil, nil ) end end -function AJM:SettingsUpdateFollowText( characterName, characterLevel ) + +function AJM:SettingsUpdateFollowText( characterName, characterLevel, overall, equipped ) + --AJM:Print("Info", characterName, characterLevel,overall, equipped) -- debug if CanDisplayTeamList() == false then return end if AJM.db.showFollowStatus == false then return end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return end - local followBarText = characterStatusBar["followBarText"] + local ilvlInformationFrame = characterStatusBar["ilvlInformationFrame"] + local ilvlInformationFrameText = characterStatusBar["ilvlInformationFrameText"] + if overall == nil then + overall = ilvlInformationFrame.overall + end + if equipped == nil then + equipped = ilvlInformationFrame.equipped + end + if characterLevel == nil then + characterLevel = ilvlInformationFrame.characterLevel + end + ilvlInformationFrame.overall = overall + ilvlInformationFrame.equipped = equipped + ilvlInformationFrame.characterLevel = characterLevel + local followBarText = characterStatusBar["followBarText"] local text = "" if AJM.db.followStatusShowName == true then - text = text..characterName + text = text..Ambiguate( characterName, "none" ) end if AJM.db.followStatusShowLevel == true then if AJM.db.followStatusShowName == true then - text = text..L[" "]..L["("]..tostring( characterLevel )..L[")"] + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring( characterLevel )..L[")"] + else + text = text..L[" "]..L["("]..tostring( characterLevel )..L[")"] + end else text = tostring( characterLevel ) end end + if AJM.db.showIlvlInformation == true then + if AJM.db.ShowEquippedOnly == true then + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring (format("%.0f", equipped ))..L[")"] + else + text = text..L[" "]..L["("]..tostring (format("%.0f", equipped ))..L[")"] + end + else + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring(format("%.0f", equipped )).."/"..tostring(format("%.0f", overall ))..L[")"] + else + text = text..L[" "]..L["("]..tostring(format("%.0f", equipped )).."/"..tostring(format("%.0f", overall ))..L[")"] + end + end + end followBarText:SetText( text ) end @@ -1905,39 +2413,58 @@ end function AJM:PLAYER_LEVEL_UP( event, ... ) AJM:SendExperienceStatusUpdateCommand() - AJM:SettingsUpdateFollowTextAll() + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() end function AJM:SendExperienceStatusUpdateCommand() if AJM.db.showTeamList == true and AJM.db.showExperienceStatus == true then + -- Hide the xp bar at max level as its nolonger needed. + local uLevel = UnitLevel("player") + local maxLevel = GetMaxPlayerLevel() + --[[ + if uLevel == maxLevel then + --AJM:Print("maxLevel", uLevel, maxLevel) --debug + AJM.db.showExperienceStatus = false + AJM.SettingsRefresh() + AJM:JambaSendSettings() + end + --]] local playerExperience = UnitXP( "player" ) local playerMaxExperience = UnitXPMax( "player" ) - local exhaustionStateID, exhaustionStateName, exhaustionStateMultiplier = GetRestState() - if AJM.db.showTeamListOnMasterOnly == true then - AJM:JambaSendCommandToMaster( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID ) - else - AJM:JambaSendCommandToTeam( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID ) - end + local playerMaxLevel = GetMaxPlayerLevel() + local playerLevel = UnitLevel("player") + local exhaustionStateID, exhaustionStateName, exhaustionStateMultiplier = GetRestState() + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID) + else + AJM:DebugMessage( "SendExperienceStatusUpdateCommand TO TEAM!" ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID) + end end end -function AJM:ProcessUpdateExperienceStatusMessage( characterName, playerExperience, playerMaxExperience, exhaustionStateID ) - AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID ) +function AJM:ProcessUpdateExperienceStatusMessage( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) + AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) end function AJM:SettingsUpdateExperienceAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:UpdateExperienceStatus( characterName, nil, nil, nil ) + AJM:UpdateExperienceStatus( characterName, nil, nil, nil, nil ) end end -function AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID ) +function AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) + --AJM:Print( "UpdateExperienceStatus", characterName, playerExperience, playerMaxExperience, exhaustionStateID, range) + if CanDisplayTeamList() == false then return end if AJM.db.showExperienceStatus == false then return end + + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -1953,11 +2480,21 @@ function AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxE if exhaustionStateID == nil then exhaustionStateID = experienceBarText.exhaustionStateID end + experienceBarText.playerExperience = playerExperience experienceBarText.playerMaxExperience = playerMaxExperience experienceBarText.exhaustionStateID = exhaustionStateID experienceBar:SetMinMaxValues( 0, tonumber( playerMaxExperience ) ) experienceBar:SetValue( tonumber( playerExperience ) ) + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + experienceBar:SetAlpha( 0.5 ) + else + experienceBar:SetAlpha( 1 ) + end + else + experienceBar:SetAlpha( 1 ) + end local text = "" if AJM.db.experienceStatusShowValues == true then text = text..tostring( playerExperience )..L[" / "]..tostring( playerMaxExperience )..L[" "] @@ -2002,23 +2539,24 @@ function AJM:SendReputationStatusUpdateCommand() end end -function AJM:ProcessUpdateReputationStatusMessage( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue ) - AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue ) +function AJM:ProcessUpdateReputationStatusMessage( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) + AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) end function AJM:SettingsUpdateReputationAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:UpdateReputationStatus( characterName, nil, nil, nil, nil, nil ) + AJM:UpdateReputationStatus( characterName, nil, nil, nil, nil, nil, nil ) end end -function AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue ) +function AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) if CanDisplayTeamList() == false then return end if AJM.db.showReputationStatus == false then return end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -2053,6 +2591,15 @@ function AJM:UpdateReputationStatus( characterName, reputationName, reputationSt reputationBarValue = 100 reputationStandingID = 1 end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + reputationBar:SetAlpha( 0.5 ) + else + reputationBar:SetAlpha( 1 ) + end + else + reputationBar:SetAlpha( 1 ) + end local text = "" if AJM.db.showReputationName == true then if reputationName == 0 then @@ -2086,35 +2633,41 @@ end ------------------------------------------------------------------------------------------------------------- function AJM:UNIT_HEALTH( event, unit, ... ) - AJM:SendHealthStatusUpdateCommand( unit ) + AJM:SendHealthStatusUpdateCommand( unit,nil ) + --AJM:Print("test2", unit) end function AJM:UNIT_MAXHEALTH( event, unit, ... ) - AJM:SendHealthStatusUpdateCommand( unit ) + AJM:SendHealthStatusUpdateCommand( unit, nil ) end -function AJM:SendHealthStatusUpdateCommand( unit ) + +function AJM:SendHealthStatusUpdateCommand( unit, range ) if AJM.db.showTeamList == true and AJM.db.showHealthStatus == true then local playerHealth = UnitHealth( unit ) local playerMaxHealth = UnitHealthMax( unit ) - local characterName = UnitName( unit ) - AJM:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth ) + local isDead = UnitIsDeadOrGhost( unit ) + local characterName, characterRealm = UnitName( unit ) + local character = JambaUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) + --AJM:Print("HeathStats", character, playerHealth, playerMaxHealth, range) + AJM:UpdateHealthStatus( character, playerHealth, playerMaxHealth, range, isDead ) end end function AJM:SettingsUpdateHealthAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:UpdateHealthStatus( characterName, nil, nil ) + AJM:UpdateHealthStatus( characterName, nil, nil, nil, nil ) end end -function AJM:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth ) +function AJM:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, range, isDead ) if CanDisplayTeamList() == false then return end if AJM.db.showHealthStatus == false then return end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -2126,20 +2679,35 @@ function AJM:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth ) end if playerMaxHealth == nil then playerMaxHealth = healthBarText.playerMaxHealth + end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + healthBar:SetAlpha( 0.5 ) + else + healthBar:SetAlpha( 1 ) + end + else + healthBar:SetAlpha( 1 ) end healthBarText.playerHealth = playerHealth healthBarText.playerMaxHealth = playerMaxHealth healthBar:SetMinMaxValues( 0, tonumber( playerMaxHealth ) ) healthBar:SetValue( tonumber( playerHealth ) ) local text = "" - if AJM.db.healthStatusShowValues == true then - text = text..tostring( playerHealth )..L[" / "]..tostring( playerMaxHealth )..L[" "] - end - if AJM.db.healthStatusShowPercentage == true then + if UnitIsDeadOrGhost(Ambiguate( characterName, "none" ) ) == true then + --if isDead == true then + --AJM:Print("dead", characterName) + text = text..L["DEAD"] + else if AJM.db.healthStatusShowValues == true then - text = text..L["("]..tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"]..L[")"] - else - text = tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"] + text = text..tostring( playerHealth )..L[" / "]..tostring( playerMaxHealth )..L[" "] + end + if AJM.db.healthStatusShowPercentage == true then + if AJM.db.healthStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"] + end end end healthBarText:SetText( text ) @@ -2158,7 +2726,7 @@ function AJM:SetStatusBarColourForHealth( statusBar, statusValue ) end b = 0.0 statusBar:SetStatusBarColor( r, g, b ) -end +end ------------------------------------------------------------------------------------------------------------- -- Power Status Bar Updates. @@ -2176,24 +2744,28 @@ function AJM:SendPowerStatusUpdateCommand( unit ) if AJM.db.showTeamList == true and AJM.db.showPowerStatus == true then local playerPower = UnitPower( unit ) local playerMaxPower = UnitPowerMax( unit ) - local characterName = UnitName( unit ) - AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower ) + local characterName, characterRealm = UnitName( unit ) + local character = JambaUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) + --AJM:Print("power", character, playerPower, playerMaxPower ) + AJM:UpdatePowerStatus( character, playerPower, playerMaxPower) end end function AJM:SettingsUpdatePowerAll() for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do - AJM:UpdatePowerStatus( characterName, nil, nil ) + AJM:UpdatePowerStatus( characterName, nil, nil, nil ) end end -function AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower ) +function AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower, range ) if CanDisplayTeamList() == false then return end if AJM.db.showPowerStatus == false then return end + local originalChatacterName = characterName + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterStatusBar = AJM.characterStatusBar[characterName] if characterStatusBar == nil then return @@ -2206,6 +2778,15 @@ function AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower ) if playerMaxPower == nil then playerMaxPower = powerBarText.playerMaxPower end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + powerBar:SetAlpha( 0.5 ) + else + powerBar:SetAlpha( 1 ) + end + else + powerBar:SetAlpha( 1 ) + end powerBarText.playerPower = playerPower powerBarText.playerMaxPower = playerMaxPower powerBar:SetMinMaxValues( 0, tonumber( playerMaxPower ) ) @@ -2222,10 +2803,11 @@ function AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower ) end end powerBarText:SetText( text ) - AJM:SetStatusBarColourForPower( powerBar, characterName ) + AJM:SetStatusBarColourForPower( powerBar, originalChatacterName ) end function AJM:SetStatusBarColourForPower( statusBar, unit ) + unit = Ambiguate( unit, "none" ) local powerIndex, powerString, altR, altG, altB = UnitPowerType( unit ) if powerString ~= nil and powerString ~= "" then local r = PowerBarColor[powerString].r @@ -2234,8 +2816,118 @@ function AJM:SetStatusBarColourForPower( statusBar, unit ) statusBar:SetStatusBarColor( r, g, b, 1 ) statusBar.backgroundTexture:SetTexture( r, g, b, 0.25 ) end -end +end + +------------------------------------------------------------------------------------------------------------- +-- Combo Points Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:UNIT_COMBO_POINTS( event, ... ) + --AJM:Print("hello") + AJM:SendComboStatusUpdateCommand() +end + + +--function AJM:UNIT_DISPLAYCOMBO( event, unit, ... ) +-- AJM:SendComboStatusUpdateCommand( unit ) +--end + +function AJM:SendComboStatusUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showComboStatus == true then + if select(2, UnitClass("player")) ~= "DRUID" and select(2, UnitClass("player")) ~= "ROGUE" == true then + return + end + + local playerCombo = UnitPower ( "player", 4) + local playerMaxCombo = UnitPowerMax( "player", 4) + --AJM:Print ("combo", playerCombo, playerMaxCombo) + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_COMBO_STATUS_UPDATE, playerCombo, playerMaxCombo ) + else + AJM:DebugMessage( "SendComboStatusUpdateCommand TO TEAM!" ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_COMBO_STATUS_UPDATE, playerCombo, playerMaxCombo ) + end + end +end + +function AJM:ProcessUpdateComboStatusMessage( characterName, playerCombo, playerMaxCombo, range ) + AJM:UpdateComboStatus( characterName, playerCombo , playerMaxCombo, range ) +end + +function AJM:SettingsUpdateComboAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateComboStatus( characterName, nil, nil, nil ) + end +end + +function AJM:UpdateComboStatus( characterName, playerCombo, playerMaxCombon, range ) + if CanDisplayTeamList() == false then + return + end + + if AJM.db.showComboStatus == false then + return + end + + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + + local comboBarText = characterStatusBar["comboBarText"] + local comboBar = characterStatusBar["comboBar"] + + if playerCombo == nil then + playerCombo = comboBarText.playerCombo + end + + if playerMaxCombo == nil then + playerMaxCombo = comboBarText.playerMaxCombo + end + + comboBarText.playerCombo = playerCombo + comboBarText.playerMaxCombo = playerMaxCombo + comboBar:SetMinMaxValues( 0, tonumber( playerMaxCombo ) ) + comboBar:SetValue( tonumber( playerCombo ) ) + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + comboBar:SetAlpha( 0.5 ) + else + comboBar:SetAlpha( 1 ) + end + else + comboBar:SetAlpha( 1 ) + end + local text = "" + + if AJM.db.comboStatusShowValues == true then + text = text..tostring( playerCombo )..L[" / "]..tostring( playerMaxCombo )..L[" "] + end + + if AJM.db.ComboStatusShowPercentage == true then + if AJM.db.comboStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerCombo/playerMaxCombo)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerCombo/playerMaxCombo)*100) )..L["%"] + end + end + comboBarText:SetText( text ) +end +--[[ +function AJM:SetStatusBarColourForCombo( statusBar, unit ) + local powerIndex, powerString, altR, altG, altB = UnitPowerType( unit ) + if comboString ~= nil and comboString ~= "" then + local r = ComboBarColor[powerString].r + local g = ComboBarColor[powerString].g + local b = ComboBarColor[powerString].b + statusBar:SetStatusBarColor( r, g, b, 1 ) + statusBar.backgroundTexture:SetTexture( r, g, b, 0.25 ) + end + +end +--]] + ------------------------------------------------------------------------------------------------------------- -- Addon initialization, enabling and disabling. ------------------------------------------------------------------------------------------------------------- @@ -2268,42 +2960,66 @@ function AJM:OnEnable() AJM:RegisterEvent( "UNIT_MAXHEALTH" ) AJM:RegisterEvent( "UNIT_POWER", "UNIT_POWER" ) AJM:RegisterEvent( "UNIT_MAXPOWER", "UNIT_POWER" ) + AJM:RegisterEvent( "PLAYER_EQUIPMENT_CHANGED" ) + AJM:RegisterEvent( "PLAYER_ENTERING_WORLD") AJM:RegisterEvent( "UNIT_DISPLAYPOWER" ) AJM:RegisterEvent( "UNIT_LEVEL" ) + AJM:RegisterEvent( "ITEMLVL_PUSH" ) AJM:RegisterEvent( "GROUP_ROSTER_UPDATE" ) AJM:RegisterEvent( "ITEM_PUSH" ) AJM:RegisterEvent( "CHAT_MSG_COMBAT_FACTION_CHANGE" ) - AJM:RegisterEvent( "UI_ERROR_MESSAGE", "ITEM_PUSH" ) - --AJM:RegisterEvent( "UNIT_PORTRAIT_UPDATE" ) + AJM:RegisterEvent( "UNIT_COMBO_POINTS" ) + --Updating Bag information -- Chaneged again 4.1 this event fires even for bank bags. When moving an item in your inventory, this fires multiple times: once each for the source and destination bag + AJM:RegisterEvent( "BAG_UPDATE", "ITEM_PUSH" ) + --Updates everytime jamba Reads the UI_ERROR_MESSAGE Are This is not very good for me using a spambar! Need's a better system. + --AJM:RegisterEvent( "UI_ERROR_MESSAGE", "ITEM_PUSH" ) + --TODO: Clean up code + --AJM:RegisterEvent( "UNIT_PORTRAIT_UPDATE" ) AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_Registered" ) AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_SetGlobal" ) AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_CHARACTER_ADDED, "OnCharactersChanged" ) AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_CHARACTER_REMOVED, "OnCharactersChanged" ) AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_ORDER_CHANGED, "OnCharactersChanged" ) AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_MASTER_CHANGED, "OnMasterChanged" ) - AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged" ) - AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged") + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged") AJM:SecureHook( "SetWatchedFactionIndex" ) - AJM:ScheduleTimer( "RefreshTeamListControls", 5 ) - AJM:ScheduleTimer( "SendExperienceStatusUpdateCommand", 6 ) - AJM:ScheduleTimer( "SendReputationStatusUpdateCommand", 7 ) - AJM:ScheduleTimer( "SendBagInformationUpdateCommand", 8 ) + AJM:ScheduleTimer( "RefreshTeamListControls", 20 ) + AJM:ScheduleTimer( "SendExperienceStatusUpdateCommand", 5 ) + AJM:ScheduleTimer( "SendReputationStatusUpdateCommand", 5 ) + AJM:ScheduleTimer( "SendBagInformationUpdateCommand", 5 ) + AJM:ScheduleTimer( "SendIlvlInformationUpdateCommand", 5 ) + --AJM:timerCount = ( 0 ) + --AJM:testTimer = + --self.timerCount = 0 + AJM:ScheduleRepeatingTimer("RangeUpdateCommand", 5) end -- Called when the addon is disabled. function AJM:OnDisable() end +-- this is not needed as the range timer would do this. +function AJM:PLAYER_ENTERING_WORLD( event, ... ) + AJM:SendBagInformationUpdateCommand() + AJM:SendExperienceStatusUpdateCommand() + AJM:SendIlvlInformationUpdateCommand() + AJM:SendReputationStatusUpdateCommand() +end + function AJM:OnMasterChanged( message, characterName ) AJM:SettingsRefresh() end function AJM:UNIT_LEVEL( event, ... ) - AJM:SettingsUpdateFollowTextAll() + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() end function AJM:GROUP_ROSTER_UPDATE( event, ... ) - AJM:SettingsUpdateFollowTextAll() + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() + AJM:SendBagInformationUpdateCommand() end function AJM:PLAYER_REGEN_ENABLED( event, ... ) @@ -2332,4 +3048,5 @@ end function AJM:OnCharactersChanged() AJM:RefreshTeamListControls() -end + AJM:SendIlvlInformationUpdateCommand() +end \ No newline at end of file diff --git a/Jamba-DisplayTeam/JambaDisplayTeam.lua.old b/Jamba-DisplayTeam/JambaDisplayTeam.lua.old new file mode 100644 index 0000000..604920b --- /dev/null +++ b/Jamba-DisplayTeam/JambaDisplayTeam.lua.old @@ -0,0 +1,3065 @@ +--[[ +Jamba - Jafula's Awesome Multi-Boxer Assistant +Copyright 2008 - 2016 Michael "Jafula" Miller +License: The MIT License +]]-- + +-- Create the addon using AceAddon-3.0 and embed some libraries. +local AJM = LibStub( "AceAddon-3.0" ):NewAddon( + "JambaDisplayTeam", + "JambaModule-1.0", + "AceConsole-3.0", + "AceEvent-3.0", + "AceHook-3.0", + "AceTimer-3.0" +) + +-- Load libraries. +local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" ) +local JambaHelperSettings = LibStub:GetLibrary( "JambaHelperSettings-1.0" ) +local LibBagUtils = LibStub:GetLibrary( "LibBagUtils-1.0" ) +AJM.SharedMedia = LibStub( "LibSharedMedia-3.0" ) + +-- Constants required by JambaModule and Locale for this module. +AJM.moduleName = "JmbDspTm" +AJM.settingsDatabaseName = "JambaDisplayTeamProfileDB" +AJM.chatCommand = "jamba-display-team" +local L = LibStub( "AceLocale-3.0" ):GetLocale( AJM.moduleName ) +AJM.parentDisplayName = L["Team"] +AJM.moduleDisplayName = L["Display: Team"] + +-- Settings - the values to store and their defaults for the settings database. +AJM.settings = { + profile = { + showTeamList = true, + showTeamListOnMasterOnly = true, + hideTeamListInCombat = false, + enableClique = false, + statusBarTexture = L["Blizzard"], + borderStyle = L["Blizzard Tooltip"], + backgroundStyle = L["Blizzard Dialog Background"], + teamListScale = 1, + teamListTitleHeight = 15, + teamListVerticalSpacing = 4, + teamListHorizontalSpacing = 4, + barVerticalSpacing = 2, + barHorizontalSpacing = 2, + barsAreStackedVertically = false, + teamListHorizontal = false, + showListTitle = true, + showCharacterPortrait = true, + characterPortraitWidth = 20, + showFollowStatus = true, + followStatusWidth = 80, + followStatusHeight = 20, + followStatusShowName = true, + followStatusShowLevel = true, + showExperienceStatus = true, + experienceStatusWidth = 80, + experienceStatusHeight = 20, + experienceStatusShowValues = false, + experienceStatusShowPercentage = true, + showReputationStatus = true, + showReputationName = true, + reputationStatusWidth = 80, + reputationStatusHeight = 20, + reputationStatusShowValues = false, + reputationStatusShowPercentage = true, + showHealthStatus = false, + healthStatusWidth = 80, + healthStatusHeight = 20, + healthStatusShowValues = true, + healthStatusShowPercentage = true, + showPowerStatus = false, + powerStatusWidth = 80, + powerStatusHeight = 20, + powerStatusShowValues = true, + powerStatusShowPercentage = true, + showComboStatus = false, + comboStatusWidth = 80, + comboStatusHeight = 20, + comboStatusShowValues = true, + comboStatusShowPercentage = true, +-- showBagInformation = true, +-- showBagFreeSlotsOnly = true, +-- bagInformationWidth = 80, +-- bagInformationHeight = 25, + --EbonyTest + stackName = false, + showIlvlInformation = true, + ShowEquippedOnly = false, + --ilvlInformationWidth = 80, + --ilvlInformationHeight = 20, + framePoint = "CENTER", + frameRelativePoint = "CENTER", + frameXOffset = 0, + frameYOffset = 0, + frameAlpha = 1.0, + frameBackgroundColourR = 1.0, + frameBackgroundColourG = 1.0, + frameBackgroundColourB = 1.0, + frameBackgroundColourA = 1.0, + frameBorderColourR = 1.0, + frameBorderColourG = 1.0, + frameBorderColourB = 1.0, + frameBorderColourA = 1.0, + timerCount = 1 + }, +} + +-- Debug message. +function AJM:DebugMessage( ... ) + --AJM:Print( ... ) +end + +-- Configuration. +function AJM:GetConfiguration() + local configuration = { + name = AJM.moduleDisplayName, + handler = AJM, + type = "group", + get = "JambaConfigurationGetSetting", + set = "JambaConfigurationSetSetting", + args = { + push = { + type = "input", + name = L["Push Settings"], + desc = L["Push the display team settings to all characters in the team."], + usage = "/jamba-display-team push", + get = false, + set = "JambaSendSettings", + }, + hide = { + type = "input", + name = L["Hide Team Display"], + desc = L["Hide the display team panel."], + usage = "/jamba-display-team hide", + get = false, + set = "HideTeamListCommand", + }, + show = { + type = "input", + name = L["Show Team Display"], + desc = L["Show the display team panel."], + usage = "/jamba-display-team show", + get = false, + set = "ShowTeamListCommand", + }, + }, + } + return configuration +end + +------------------------------------------------------------------------------------------------------------- +-- Command this module sends. +------------------------------------------------------------------------------------------------------------- + +AJM.COMMAND_FOLLOW_STATUS_UPDATE = "FlwStsUpd" +AJM.COMMAND_EXPERIENCE_STATUS_UPDATE = "ExpStsUpd" +--AJM.COMMAND_BAGINFORMATION_UPDATE = "BagInfoUpd" +AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE = "IlvlInfoUpd" +AJM.COMMAND_REPUTATION_STATUS_UPDATE = "RepStsUpd" +AJM.COMMAND_COMBO_STATUS_UPDATE = "CboStsUpd" + +------------------------------------------------------------------------------------------------------------- +-- Messages module sends. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- +-- Constants used by module. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- +-- Variables used by module. +------------------------------------------------------------------------------------------------------------- + +-- Team display variables. +AJM.globalFramePrefix = "JambaDisplayTeam" +AJM.characterStatusBar = {} +AJM.totalMembersDisplayed = 0 +AJM.teamListCreated = false +AJM.refreshHideTeamListControlsPending = false +AJM.refreshShowTeamListControlsPending = false +AJM.updateSettingsAfterCombat = false + +------------------------------------------------------------------------------------------------------------- +-- Team Frame. +------------------------------------------------------------------------------------------------------------- + +local function GetCharacterHeight() + local height = 0 + local heightPortrait = 0 + local heightFollowStatus = 0 + local heightExperienceStatus = 0 + local heightReputationStatus = 0 + local heightHealthStatus = 0 + local heightPowerStatus = 0 + local heightComboStatus = 0 +-- local heightBagInformation = 0 + --local heightIlvlInformation = 0 + local heightAllBars = 0 + if AJM.db.showCharacterPortrait == true then + heightPortrait = AJM.db.characterPortraitWidth + AJM.db.teamListVerticalSpacing + end +-- if AJM.db.showBagInformation == true then +-- heightBagInformation = AJM.db.bagInformationHeight + AJM.db.teamListVerticalSpacing +-- heightAllBars = heightAllBars + heightBagInformation +-- end + --if AJM.db.showIlvlInformation == true then + -- heightIlvlInformation = AJM.db.ilvlInformationHeight + AJM.db.teamListVerticalSpacing + -- heightAllBars = heightAllBars + heightIlvlInformation + --end + if AJM.db.showFollowStatus == true then + heightFollowStatus = AJM.db.followStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightFollowStatus + end + if AJM.db.showExperienceStatus == true then + heightExperienceStatus = AJM.db.experienceStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightExperienceStatus + end + if AJM.db.showReputationStatus == true then + heightReputationStatus = AJM.db.reputationStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightReputationStatus + end + if AJM.db.showHealthStatus == true then + heightHealthStatus = AJM.db.healthStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightHealthStatus + end + if AJM.db.showPowerStatus == true then + heightPowerStatus = AJM.db.powerStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightPowerStatus + end + if AJM.db.showComboStatus == true then + heightComboStatus = AJM.db.comboStatusHeight + AJM.db.barVerticalSpacing + heightAllBars = heightAllBars + heightComboStatus + end + if AJM.db.barsAreStackedVertically == true then + height = max( heightPortrait, heightAllBars ) + else + --height = max( heightPortrait, heightBagInformation, heightFollowStatus, heightExperienceStatus, heightReputationStatus, heightHealthStatus, heightPowerStatus, heightComboStatus ) + height = max( heightPortrait, heightFollowStatus, heightExperienceStatus, heightReputationStatus, heightHealthStatus, heightPowerStatus, heightComboStatus ) + end + return height +end + +local function GetCharacterWidth() + local width = 0 + local widthPortrait = 0 + local widthFollowStatus = 0 + local widthExperienceStatus = 0 + local widthReputationStatus = 0 + local widthHealthStatus = 0 + local widthPowerStatus = 0 + local widthComboStatus = 0 +-- local widthBagInformation = 0 + local widthIvlInformation = 0 + local widthAllBars = 0 + if AJM.db.showCharacterPortrait == true then + widthPortrait = AJM.db.characterPortraitWidth + AJM.db.teamListHorizontalSpacing + end +-- if AJM.db.showBagInformation == true then +-- widthBagInformation = AJM.db.bagInformationWidth + AJM.db.teamListHorizontalSpacing +-- widthAllBars = widthAllBars + widthBagInformation +-- end + --if AJM.db.showIlvlInformation == true then + -- widthIlvlInformation = AJM.db.ilvlInformationWidth + AJM.db.teamListHorizontalSpacing + -- widthAllBars = widthAllBars + widthIlvlInformation + --end + if AJM.db.showFollowStatus == true then + widthFollowStatus = AJM.db.followStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthFollowStatus + end + if AJM.db.showExperienceStatus == true then + widthExperienceStatus = AJM.db.experienceStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthExperienceStatus + end + if AJM.db.showReputationStatus == true then + widthReputationStatus = AJM.db.reputationStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthReputationStatus + end + if AJM.db.showHealthStatus == true then + widthHealthStatus = AJM.db.healthStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthHealthStatus + end + if AJM.db.showPowerStatus == true then + widthPowerStatus = AJM.db.powerStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthPowerStatus + end + if AJM.db.showComboStatus == true then + widthComboStatus = AJM.db.comboStatusWidth + AJM.db.barHorizontalSpacing + widthAllBars = widthAllBars + widthComboStatus + end + if AJM.db.barsAreStackedVertically == true then + --width = widthPortrait + max( widthBagInformation, widthFollowStatus, widthExperienceStatus, widthReputationStatus, widthHealthStatus, widthPowerStatus, widthComboStatus ) + width = widthPortrait + max( widthFollowStatus, widthExperienceStatus, widthReputationStatus, widthHealthStatus, widthPowerStatus, widthComboStatus ) + + else + width = widthPortrait + widthAllBars + end + return width +end + +local function UpdateJambaTeamListDimensions() + local frame = JambaDisplayTeamListFrame + if AJM.db.showListTitle == true then + AJM.db.teamListTitleHeight = 15 + JambaDisplayTeamListFrame.titleName:SetText( L["Jamba Team"] ) + else + AJM.db.teamListTitleHeight = 0 + JambaDisplayTeamListFrame.titleName:SetText( "" ) + end + if AJM.db.teamListHorizontal == true then + frame:SetWidth( (AJM.db.teamListVerticalSpacing * 3) + (GetCharacterWidth() * AJM.totalMembersDisplayed) ) + frame:SetHeight( AJM.db.teamListTitleHeight + (AJM.db.teamListVerticalSpacing * 3) + GetCharacterHeight() ) + else + frame:SetWidth( (AJM.db.teamListHorizontalSpacing * 3) + GetCharacterWidth() ) + frame:SetHeight( AJM.db.teamListTitleHeight + (GetCharacterHeight() * AJM.totalMembersDisplayed) + (AJM.db.teamListVerticalSpacing * 3) ) + end + frame:SetScale( AJM.db.teamListScale ) +end + +local function CreateJambaTeamListFrame() + -- The frame. + local frame = CreateFrame( "Frame", "JambaDisplayTeamListWindowFrame", UIParent ) + frame.obj = AJM + frame:SetFrameStrata( "LOW" ) + frame:SetToplevel( true ) + frame:SetClampedToScreen( true ) + frame:EnableMouse( true ) + frame:SetMovable( true ) + frame:RegisterForDrag( "LeftButton" ) + frame:SetScript( "OnDragStart", + function( this ) + if IsAltKeyDown() then + if not UnitAffectingCombat("player") then + this:StartMoving() + end + end + end ) + frame:SetScript( "OnDragStop", + function( this ) + this:StopMovingOrSizing() + local point, relativeTo, relativePoint, xOffset, yOffset = this:GetPoint() + AJM.db.framePoint = point + AJM.db.frameRelativePoint = relativePoint + AJM.db.frameXOffset = xOffset + AJM.db.frameYOffset = yOffset + end ) + frame:ClearAllPoints() + frame:SetPoint( AJM.db.framePoint, UIParent, AJM.db.frameRelativePoint, AJM.db.frameXOffset, AJM.db.frameYOffset ) + frame:SetBackdrop( { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 10, edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + + -- Create the title for the team list frame. + local titleName = frame:CreateFontString( "JambaDisplayTeamListWindowFrameTitleText", "OVERLAY", "GameFontNormal" ) + titleName:SetPoint( "TOP", frame, "TOP", 0, -5 ) + titleName:SetTextColor( 1.00, 1.00, 1.00 ) + titleName:SetText( L["Jamba Team"] ) + frame.titleName = titleName + + -- Set transparency of the the frame (and all its children). + frame:SetAlpha(AJM.db.frameAlpha) + + -- Set the global frame reference for this frame. + JambaDisplayTeamListFrame = frame + + AJM:SettingsUpdateBorderStyle() + AJM.teamListCreated = true + +--[[ + -- Draw the title. + if AJM.db.teamListStatusWidth >= 90 then + JambaDisplayTeamListFrame.titleName:SetText( L["Jamba Team"] ) + else + JambaDisplayTeamListFrame.titleName:SetText( L["Team"] ) + end +]]-- +end + +local function CanDisplayTeamList() + local canShow = false + if AJM.db.showTeamList == true then + if AJM.db.showTeamListOnMasterOnly == true then + if JambaApi.IsCharacterTheMaster( AJM.characterName ) == true then + canShow = true + end + else + canShow = true + end + end + return canShow +end + +function AJM:ShowTeamListCommand() + AJM.db.showTeamList = true + AJM:SetTeamListVisibility() +end + +function AJM:HideTeamListCommand() + AJM.db.showTeamList = false + AJM:SetTeamListVisibility() +end + +function AJM:SetTeamListVisibility() + if CanDisplayTeamList() == true then + JambaDisplayTeamListFrame:ClearAllPoints() + JambaDisplayTeamListFrame:SetPoint( AJM.db.framePoint, UIParent, AJM.db.frameRelativePoint, AJM.db.frameXOffset, AJM.db.frameYOffset ) + JambaDisplayTeamListFrame:SetAlpha( AJM.db.frameAlpha ) + JambaDisplayTeamListFrame:Show() + else + JambaDisplayTeamListFrame:Hide() + end +end + +function AJM:RefreshTeamListControlsHide() + if InCombatLockdown() then + AJM.refreshHideTeamListControlsPending = true + return + end + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + characterName = JambaUtilities:AddRealmToNameIfMissing ( characterName ) + -- Hide their status bar. + AJM:HideJambaTeamStatusBar( characterName ) + end + UpdateJambaTeamListDimensions() +end + +function AJM:RefreshTeamListControlsShow() + if InCombatLockdown() then + AJM.refreshShowTeamListControlsPending = true + return + end + -- Iterate all the team members. + AJM.totalMembersDisplayed = 0 + for index, characterName in JambaApi.TeamListOrdered() do + characterName = JambaUtilities:AddRealmToNameIfMissing ( characterName ) + -- Is the team member online? + if JambaApi.GetCharacterOnlineStatus( characterName ) == true then + -- Yes, the team member is online, draw their status bars. + AJM:UpdateJambaTeamStatusBar( characterName, AJM.totalMembersDisplayed ) + AJM.totalMembersDisplayed = AJM.totalMembersDisplayed + 1 + end + end + UpdateJambaTeamListDimensions() +end + +function AJM:RefreshTeamListControls() + AJM:RefreshTeamListControlsHide() + AJM:RefreshTeamListControlsShow() +end + +function AJM:SettingsUpdateStatusBarTexture() + local statusBarTexture = AJM.SharedMedia:Fetch( "statusbar", AJM.db.statusBarTexture ) + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + characterStatusBar["followBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["followBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["followBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["experienceBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["experienceBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["experienceBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["reputationBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["reputationBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["reputationBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["healthBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["healthBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["healthBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["powerBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["powerBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["powerBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["comboBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["comboBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["comboBar"]:GetStatusBarTexture():SetVertTile( false ) + end +end + +function AJM:SettingsUpdateBorderStyle() + local borderStyle = AJM.SharedMedia:Fetch( "border", AJM.db.borderStyle ) + local backgroundStyle = AJM.SharedMedia:Fetch( "background", AJM.db.backgroundStyle ) + local frame = JambaDisplayTeamListFrame + frame:SetBackdrop( { + bgFile = backgroundStyle, + edgeFile = borderStyle, + tile = true, tileSize = frame:GetWidth(), edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + frame:SetBackdropColor( AJM.db.frameBackgroundColourR, AJM.db.frameBackgroundColourG, AJM.db.frameBackgroundColourB, AJM.db.frameBackgroundColourA ) + frame:SetBackdropBorderColor( AJM.db.frameBorderColourR, AJM.db.frameBorderColourG, AJM.db.frameBorderColourB, AJM.db.frameBorderColourA ) +end + +function AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) + local statusBarTexture = AJM.SharedMedia:Fetch( "statusbar", AJM.db.statusBarTexture ) + -- Create the table to hold the status bars for this character. + AJM.characterStatusBar[characterName] = {} + -- Get the status bars table. + local characterStatusBar = AJM.characterStatusBar[characterName] + -- Set the portrait. + local portraitName = AJM.globalFramePrefix.."PortraitButton" + local portraitButton = CreateFrame( "PlayerModel", portraitName, parentFrame ) + --portraitButton.Texture = portraitButton:CreateTexture( portraitName.."NormalTexture", "ARTWORK" ) + --SetPortraitTexture( portraitButton.Texture, characterName ) + --portraitButton.Texture:SetAllPoints() + portraitButton:ClearModel() + portraitButton:SetUnit( Ambiguate( characterName, "short" ) ) + portraitButton:SetPortraitZoom( 1 ) + portraitButton:SetCamDistanceScale( 1 ) + portraitButton:SetPosition( 0, 0, 0 ) + local portraitButtonClick = CreateFrame( "CheckButton", portraitName.."Click", parentFrame, "SecureActionButtonTemplate" ) + portraitButtonClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + characterStatusBar["portraitButton"] = portraitButton + characterStatusBar["portraitButtonClick"] = portraitButtonClick + -- Set the bag information. +--[[ + local bagInformationFrameName = AJM.globalFramePrefix.."BagInformationFrame" + local bagInformationFrame = CreateFrame( "Frame", bagInformationFrameName, parentFrame ) + local bagInformationFrameText = bagInformationFrame:CreateFontString( bagInformationFrameName.."Text", "OVERLAY", "GameFontNormal" ) + bagInformationFrameText:SetText( "999/999" ) + bagInformationFrame:SetAlpha( 1 ) + --bagInformationFrameText:SetPoint( "CENTER", bagInformationFrame, "CENTER", 0, 0 ) + bagInformationFrameText:SetAllPoints() + bagInformationFrameText:SetJustifyH( "CENTER" ) + bagInformationFrameText:SetJustifyV( "MIDDLE" ) + bagInformationFrameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + bagInformationFrame.slotsFree = 999 + bagInformationFrame.totalSlots = 999 + bagInformationFrame.durability = 100 + characterStatusBar["bagInformationFrame"] = bagInformationFrame + characterStatusBar["bagInformationFrameText"] = bagInformationFrameText +--]] + --set the ilevel Information. + local ilvlInformationFrameName = AJM.globalFramePrefix.."IlvlInformationFrame" + local ilvlInformationFrame = CreateFrame( "Frame", ilvlInformationFrameName, parentFrame ) + local ilvlInformationFrameText = ilvlInformationFrame:CreateFontString( ilvlInformationFrameName.."Text", "OVERLAY", "GameFontNormal" ) + ilvlInformationFrameText:SetText( "999/999" ) + ilvlInformationFrameText:SetAllPoints() + ilvlInformationFrameText:SetJustifyH( "CENTER" ) + ilvlInformationFrameText:SetJustifyV( "MIDDLE" ) + ilvlInformationFrameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + ilvlInformationFrame.overall = 999 + ilvlInformationFrame.equipped = 999 + ilvlInformationFrame.characterLevel = 0 + characterStatusBar["ilvlInformationFrame"] = ilvlInformationFrame + characterStatusBar["ilvlInformationFrameText"] = ilvlInformationFrameText + -- Set the follow bar. + local followName = AJM.globalFramePrefix.."FollowBar" + local followBar = CreateFrame( "StatusBar", followName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + followBar.backgroundTexture = followBar:CreateTexture( followName.."BackgroundTexture", "ARTWORK" ) + followBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + followBar:SetStatusBarTexture( statusBarTexture ) + followBar:GetStatusBarTexture():SetHorizTile( false ) + followBar:GetStatusBarTexture():SetVertTile( false ) + followBar:SetStatusBarColor( 0.55, 0.15, 0.15, 0.25 ) + followBar:SetMinMaxValues( 0, 100 ) + followBar:SetValue( 100 ) + followBar:SetFrameStrata( "LOW" ) + followBar:SetAlpha( 1 ) + local followBarClick = CreateFrame( "CheckButton", followName.."Click", parentFrame, "SecureActionButtonTemplate" ) + followBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + --followBarClick:SetAttribute( "macrotext", "/targetexact "..characterName ) + followBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["followBar"] = followBar + characterStatusBar["followBarClick"] = followBarClick + local followBarText = followBar:CreateFontString( followName.."Text", "OVERLAY", "GameFontNormal" ) + followBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + followBarText:SetAllPoints() + characterStatusBar["followBarText"] = followBarText + AJM:SettingsUpdateFollowText( characterName, UnitLevel( Ambiguate( characterName, "none" ) ), nil, nil ) + -- Set the experience bar. + local experienceName = AJM.globalFramePrefix.."ExperienceBar" + local experienceBar = CreateFrame( "StatusBar", experienceName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + experienceBar.backgroundTexture = experienceBar:CreateTexture( experienceName.."BackgroundTexture", "ARTWORK" ) + experienceBar.backgroundTexture:SetTexture( 0.0, 0.39, 0.88, 0.15 ) + experienceBar:SetStatusBarTexture( statusBarTexture ) + experienceBar:GetStatusBarTexture():SetHorizTile( false ) + experienceBar:GetStatusBarTexture():SetVertTile( false ) + experienceBar:SetMinMaxValues( 0, 100 ) + experienceBar:SetValue( 100 ) + experienceBar:SetFrameStrata( "LOW" ) + local experienceBarClick = CreateFrame( "CheckButton", experienceName.."Click", parentFrame, "SecureActionButtonTemplate" ) + experienceBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + experienceBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["experienceBar"] = experienceBar + characterStatusBar["experienceBarClick"] = experienceBarClick + local experienceBarText = experienceBar:CreateFontString( experienceName.."Text", "OVERLAY", "GameFontNormal" ) + experienceBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + experienceBarText:SetAllPoints() + experienceBarText.playerExperience = 100 + experienceBarText.playerMaxExperience = 100 + experienceBarText.exhaustionStateID = 1 + characterStatusBar["experienceBarText"] = experienceBarText + AJM:UpdateExperienceStatus( characterName, nil, nil, nil ) + -- Set the reputation bar. + local reputationName = AJM.globalFramePrefix.."ReputationBar" + local reputationBar = CreateFrame( "StatusBar", reputationName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + reputationBar.backgroundTexture = reputationBar:CreateTexture( reputationName.."BackgroundTexture", "ARTWORK" ) + reputationBar.backgroundTexture:SetTexture( 0.0, 0.39, 0.88, 0.15 ) + reputationBar:SetStatusBarTexture( statusBarTexture ) + reputationBar:GetStatusBarTexture():SetHorizTile( false ) + reputationBar:GetStatusBarTexture():SetVertTile( false ) + reputationBar:SetMinMaxValues( 0, 100 ) + reputationBar:SetValue( 100 ) + reputationBar:SetFrameStrata( "LOW" ) + reputationBar:SetAlpha( 1 ) + local reputationBarClick = CreateFrame( "CheckButton", reputationName.."Click", parentFrame, "SecureActionButtonTemplate" ) + reputationBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + reputationBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["reputationBar"] = reputationBar + characterStatusBar["reputationBarClick"] = reputationBarClick + local reputationBarText = reputationBar:CreateFontString( reputationName.."Text", "OVERLAY", "GameFontNormal" ) + reputationBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + reputationBarText:SetAllPoints() + reputationBarText.reputationName = "Faction" + reputationBarText.reputationStandingID = 4 + reputationBarText.reputationBarMin = 0 + reputationBarText.reputationBarMax = 100 + reputationBarText.reputationBarValue = 100 + characterStatusBar["reputationBarText"] = reputationBarText + AJM:UpdateReputationStatus( characterName, nil, nil, nil ) + -- Set the health bar. + local healthName = AJM.globalFramePrefix.."HealthBar" + local healthBar = CreateFrame( "StatusBar", healthName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + healthBar.backgroundTexture = healthBar:CreateTexture( healthName.."BackgroundTexture", "ARTWORK" ) + healthBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + healthBar:SetStatusBarTexture( statusBarTexture ) + healthBar:GetStatusBarTexture():SetHorizTile( false ) + healthBar:GetStatusBarTexture():SetVertTile( false ) + healthBar:SetMinMaxValues( 0, 100 ) + healthBar:SetValue( 100 ) + healthBar:SetFrameStrata( "LOW" ) + healthBar:SetAlpha( 1 ) + local healthBarClick = CreateFrame( "CheckButton", healthName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) + healthBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + healthBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["healthBar"] = healthBar + characterStatusBar["healthBarClick"] = healthBarClick + local healthBarText = healthBar:CreateFontString( healthName.."Text", "OVERLAY", "GameFontNormal" ) + healthBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + healthBarText:SetAllPoints() + healthBarText.playerHealth = 100 + healthBarText.playerMaxHealth = 100 + characterStatusBar["healthBarText"] = healthBarText + AJM:UpdateHealthStatus( characterName, nil, nil ) + -- Set the power bar. + local powerName = AJM.globalFramePrefix.."PowerBar" + local powerBar = CreateFrame( "StatusBar", powerName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + powerBar.backgroundTexture = powerBar:CreateTexture( powerName.."BackgroundTexture", "ARTWORK" ) + powerBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + powerBar:SetStatusBarTexture( statusBarTexture ) + powerBar:GetStatusBarTexture():SetHorizTile( false ) + powerBar:GetStatusBarTexture():SetVertTile( false ) + powerBar:SetMinMaxValues( 0, 100 ) + powerBar:SetValue( 100 ) + powerBar:SetFrameStrata( "LOW" ) + powerBar:SetAlpha( 1 ) + local powerBarClick = CreateFrame( "CheckButton", powerName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) + powerBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + powerBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["powerBar"] = powerBar + characterStatusBar["powerBarClick"] = powerBarClick + local powerBarText = powerBar:CreateFontString( powerName.."Text", "OVERLAY", "GameFontNormal" ) + powerBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + powerBarText:SetAllPoints() + powerBarText.playerPower = 100 + powerBarText.playerMaxPower = 100 + characterStatusBar["powerBarText"] = powerBarText + AJM:UpdatePowerStatus( characterName, nil, nil, nil ) + -- Set the Combo Points bar. + local comboName = AJM.globalFramePrefix.."ComboBar" + local comboBar = CreateFrame( "StatusBar", comboName, parentFrame, "TextStatusBar,SecureActionButtonTemplate" ) + comboBar.backgroundTexture = comboBar:CreateTexture( comboName.."BackgroundTexture", "ARTWORK" ) + comboBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + comboBar:SetStatusBarTexture( statusBarTexture ) + comboBar:GetStatusBarTexture():SetHorizTile( false ) + comboBar:GetStatusBarTexture():SetVertTile( false ) + comboBar:SetStatusBarColor( 1.00, 0.0, 0.0, 1.00 ) + comboBar:SetMinMaxValues( 0, 5 ) + comboBar:SetValue( 5 ) + comboBar:SetFrameStrata( "LOW" ) + comboBar:SetAlpha( 1 ) + local comboBarClick = CreateFrame( "CheckButton", comboName.."Click"..characterName, parentFrame, "SecureActionButtonTemplate" ) + comboBarClick:SetAttribute( "unit", characterName ) + comboBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["comboBar"] = comboBar + characterStatusBar["comboBarClick"] = comboBarClick + local comboBarText = comboBar:CreateFontString( comboName.."Text", "OVERLAY", "GameFontNormal" ) + comboBarText:SetTextColor( 1.00, 1.00, 0.0, 1.00 ) + comboBarText:SetAllPoints() + comboBarText.playerCombo = 0 + comboBarText.playerMaxCombo = 5 + characterStatusBar["comboBarText"] = comboBarText + AJM:UpdateComboStatus( characterName, nil, nil ) + -- Add the health and power click bars to ClickCastFrames for addons like Clique to use. + --Ebony if Support for Clique if not on then default to target unit + --TODO there got to be a better way to doing this for sure but right now i can not be assed to do this for now you need to reload the UI when turning off and on clique support. + ClickCastFrames = ClickCastFrames or {} + if AJM.db.enableClique == true then + ClickCastFrames[portraitButtonClick] = true + ClickCastFrames[followBarClick] = true + ClickCastFrames[experienceBarClick] = true + ClickCastFrames[reputationBarClick] = true + ClickCastFrames[healthBarClick] = true + ClickCastFrames[powerBarClick] = true + ClickCastFrames[comboBarClick] = true + else + portraitButtonClick:SetAttribute( "type1", "target") + followBarClick:SetAttribute( "type1", "target") + experienceBarClick:SetAttribute( "type1", "target") + reputationBarClick:SetAttribute( "type1", "target") + healthBarClick:SetAttribute( "type1", "target") + powerBarClick:SetAttribute( "type1", "target") + comboBarClick:SetAttribute( "type1", "target") + end +end + +function AJM:HideJambaTeamStatusBar( characterName ) + local parentFrame = JambaDisplayTeamListFrame + -- Get (or create and get) the character status bar information. + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) + characterStatusBar = AJM.characterStatusBar[characterName] + end + -- Hide the bars. + characterStatusBar["portraitButton"]:Hide() + characterStatusBar["portraitButtonClick"]:Hide() +-- characterStatusBar["bagInformationFrame"]:Hide() + characterStatusBar["ilvlInformationFrame"]:Hide() + characterStatusBar["followBar"]:Hide() + characterStatusBar["followBarClick"]:Hide() + characterStatusBar["experienceBar"]:Hide() + characterStatusBar["experienceBarClick"]:Hide() + characterStatusBar["reputationBar"]:Hide() + characterStatusBar["reputationBarClick"]:Hide() + characterStatusBar["healthBar"]:Hide() + characterStatusBar["healthBarClick"]:Hide() + characterStatusBar["powerBar"]:Hide() + characterStatusBar["powerBarClick"]:Hide() + characterStatusBar["comboBar"]:Hide() + characterStatusBar["comboBarClick"]:Hide() +end + +function AJM:UpdateJambaTeamStatusBar( characterName, characterPosition ) + local parentFrame = JambaDisplayTeamListFrame + -- Get (or create and get) the character status bar information. + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + AJM:CreateJambaTeamStatusBar( characterName, parentFrame ) + characterStatusBar = AJM.characterStatusBar[characterName] + end + -- Set the positions. + local characterHeight = GetCharacterHeight() + local characterWidth = GetCharacterWidth() + local positionLeft = 0 + local positionTop = -AJM.db.teamListTitleHeight - (AJM.db.teamListVerticalSpacing * 2) + if AJM.db.teamListHorizontal == true then + positionLeft = -6 + (characterPosition * characterWidth) + (AJM.db.teamListHorizontalSpacing * 3) + else + positionLeft = 6 + positionTop = positionTop - (characterPosition * characterHeight) + end + -- Display the portrait. + local portraitButton = characterStatusBar["portraitButton"] + local portraitButtonClick = characterStatusBar["portraitButtonClick"] + if AJM.db.showCharacterPortrait == true then + portraitButton:ClearModel() + portraitButton:SetUnit( characterName ) + portraitButton:SetPortraitZoom( 1 ) + portraitButton:SetCamDistanceScale( 1 ) + portraitButton:SetPosition( 0, 0, 0 ) + portraitButton:SetWidth( AJM.db.characterPortraitWidth ) + portraitButton:SetHeight( AJM.db.characterPortraitWidth ) + portraitButton:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + portraitButtonClick:SetWidth( AJM.db.characterPortraitWidth ) + portraitButtonClick:SetHeight( AJM.db.characterPortraitWidth ) + portraitButtonClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + --SetPortraitTexture( portraitButton.Texture, characterName ) + --portraitButton.Texture:SetAllPoints() + portraitButton:Show() + portraitButtonClick:Show() + positionLeft = positionLeft + AJM.db.characterPortraitWidth + AJM.db.teamListHorizontalSpacing + else + portraitButton:Hide() + portraitButtonClick:Hide() + end + -- Display the follow bar. + local followBar = characterStatusBar["followBar"] + local followBarClick = characterStatusBar["followBarClick"] + if AJM.db.showFollowStatus == true then + followBar.backgroundTexture:SetAllPoints() + followBar:SetWidth( AJM.db.followStatusWidth ) + followBar:SetHeight( AJM.db.followStatusHeight ) + followBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + followBarClick:SetWidth( AJM.db.followStatusWidth ) + followBarClick:SetHeight( AJM.db.followStatusHeight ) + followBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + followBar:Show() + followBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.followStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.followStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + followBar:Hide() + followBarClick:Hide() + end + -- Display the experience bar. + local experienceBar = characterStatusBar["experienceBar"] + local experienceBarClick = characterStatusBar["experienceBarClick"] + if AJM.db.showExperienceStatus == true then + experienceBar.backgroundTexture:SetAllPoints() + experienceBar:SetWidth( AJM.db.experienceStatusWidth ) + experienceBar:SetHeight( AJM.db.experienceStatusHeight ) + experienceBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + experienceBarClick:SetWidth( AJM.db.experienceStatusWidth ) + experienceBarClick:SetHeight( AJM.db.experienceStatusHeight ) + experienceBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + experienceBar:Show() + experienceBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.experienceStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.experienceStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + experienceBar:Hide() + experienceBarClick:Hide() + end + -- Display the reputation bar. + local reputationBar = characterStatusBar["reputationBar"] + local reputationBarClick = characterStatusBar["reputationBarClick"] + if AJM.db.showReputationStatus == true then + reputationBar.backgroundTexture:SetAllPoints() + reputationBar:SetWidth( AJM.db.reputationStatusWidth ) + reputationBar:SetHeight( AJM.db.reputationStatusHeight ) + reputationBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + reputationBarClick:SetWidth( AJM.db.reputationStatusWidth ) + reputationBarClick:SetHeight( AJM.db.reputationStatusHeight ) + reputationBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + reputationBar:Show() + reputationBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.reputationStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.reputationStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + reputationBar:Hide() + reputationBarClick:Hide() + end + -- Display the health bar. + local healthBar = characterStatusBar["healthBar"] + local healthBarClick = characterStatusBar["healthBarClick"] + if AJM.db.showHealthStatus == true then + healthBar.backgroundTexture:SetAllPoints() + healthBar:SetWidth( AJM.db.healthStatusWidth ) + healthBar:SetHeight( AJM.db.healthStatusHeight ) + healthBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + healthBarClick:SetWidth( AJM.db.healthStatusWidth ) + healthBarClick:SetHeight( AJM.db.healthStatusHeight ) + healthBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + healthBar:Show() + healthBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.healthStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.healthStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + healthBar:Hide() + healthBarClick:Hide() + end + -- Display the power bar. + local powerBar = characterStatusBar["powerBar"] + local powerBarClick = characterStatusBar["powerBarClick"] + if AJM.db.showPowerStatus == true then + powerBar.backgroundTexture:SetAllPoints() + powerBar:SetWidth( AJM.db.powerStatusWidth ) + powerBar:SetHeight( AJM.db.powerStatusHeight ) + powerBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + powerBarClick:SetWidth( AJM.db.powerStatusWidth ) + powerBarClick:SetHeight( AJM.db.powerStatusHeight ) + powerBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + powerBar:Show() + powerBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.powerStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.powerStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + powerBar:Hide() + powerBarClick:Hide() + end + -- Display the Combo Point bar. + local comboBar = characterStatusBar["comboBar"] + local comboBarClick = characterStatusBar["comboBarClick"] + if AJM.db.showComboStatus == true then + comboBar.backgroundTexture:SetAllPoints() + comboBar:SetWidth( AJM.db.comboStatusWidth ) + comboBar:SetHeight( AJM.db.comboStatusHeight ) + comboBar:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + comboBarClick:SetWidth( AJM.db.comboStatusWidth ) + comboBarClick:SetHeight( AJM.db.comboStatusHeight ) + comboBarClick:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + comboBar:Show() + comboBarClick:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.comboStatusHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.comboStatusWidth + AJM.db.teamListHorizontalSpacing + end + else + comboBar:Hide() + comboBarClick:Hide() + end +--[[ + -- Display the bag information + local bagInformationFrame = characterStatusBar["bagInformationFrame"] + local bagInformationFrameText = characterStatusBar["bagInformationFrameText"] + if AJM.db.showBagInformation == true then + bagInformationFrame:SetWidth( AJM.db.bagInformationWidth ) + bagInformationFrame:SetHeight( AJM.db.bagInformationHeight ) + bagInformationFrame:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + bagInformationFrame:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.bagInformationHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.bagInformationWidth + AJM.db.teamListHorizontalSpacing + end + else + bagInformationFrame:Hide() + end + --]] + --[[ + -- Display the ilevel information + local ilvlInformationFrame = characterStatusBar["ilvlInformationFrame"] + local ilvlInformationFrameText = characterStatusBar["ilvlInformationFrameText"] + if AJM.db.showIlvlInformation == true then + ilvlInformationFrame:SetWidth( AJM.db.ilvlInformationWidth ) + ilvlInformationFrame:SetHeight( AJM.db.ilvlInformationHeight ) + ilvlInformationFrame:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", positionLeft, positionTop ) + ilvlInformationFrame:Show() + if AJM.db.barsAreStackedVertically == true then + positionTop = positionTop - AJM.db.ilvlInformationHeight - AJM.db.barVerticalSpacing + else + positionLeft = positionLeft + AJM.db.ilvlInformationWidth + AJM.db.teamListHorizontalSpacing + end + else + ilvlInformationFrame:Hide() + end + --]] +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Dialogs. +------------------------------------------------------------------------------------------------------------- + +local function SettingsCreateDisplayOptions( top ) + -- Get positions. + local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() + local labelContinueHeight = JambaHelperSettings:GetContinueLabelHeight() + local sliderHeight = JambaHelperSettings:GetSliderHeight() + local mediaHeight = JambaHelperSettings:GetMediaHeight() + local left = JambaHelperSettings:LeftOfSettings() + local headingHeight = JambaHelperSettings:HeadingHeight() + local headingWidth = JambaHelperSettings:HeadingWidth( true ) + local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing() + local verticalSpacing = JambaHelperSettings:GetVerticalSpacing() + local sectionSpacing = verticalSpacing * 4 + local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 + local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 + local column2left = left + halfWidthSlider + local left2 = left + thirdWidth + local left3 = left + (thirdWidth * 2) + local movingTop = top + -- Create show. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Show"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowTeamList = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Show Team List"], + AJM.SettingsToggleShowTeamList + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxShowTeamListOnlyOnMaster = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Only On Master"], + AJM.SettingsToggleShowTeamListOnMasterOnly + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxHideTeamListInCombat = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Hide Team List In Combat"], + AJM.SettingsToggleHideTeamListInCombat + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxEnableClique = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Enable Clique Support - **reload UI to take effect**"], + AJM.SettingsToggleEnableClique + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + -- Create appearance & layout. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Appearance & Layout"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxStackVertically = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Stack Bars Vertically"], + AJM.SettingsToggleStackVertically + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxTeamHorizontal = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Display Team List Horizontally"], + AJM.SettingsToggleTeamHorizontal + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxShowListTitle = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Show Team List Title"], + AJM.SettingsToggleShowTeamListTitle + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsTeamListScaleSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Scale"] + ) + AJM.settingsControl.displayOptionsTeamListScaleSlider:SetSliderValues( 0.5, 2, 0.01 ) + AJM.settingsControl.displayOptionsTeamListScaleSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeScale ) + movingTop = movingTop - sliderHeight - verticalSpacing + AJM.settingsControl.displayOptionsTeamListTransparencySlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Transparency"] + ) + AJM.settingsControl.displayOptionsTeamListTransparencySlider:SetSliderValues( 0, 1, 0.01 ) + AJM.settingsControl.displayOptionsTeamListTransparencySlider:SetCallback( "OnValueChanged", AJM.SettingsChangeTransparency ) + movingTop = movingTop - sliderHeight - verticalSpacing + AJM.settingsControl.displayOptionsTeamListMediaStatus = JambaHelperSettings:CreateMediaStatus( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Status Bar Texture"] + ) + AJM.settingsControl.displayOptionsTeamListMediaStatus:SetCallback( "OnValueChanged", AJM.SettingsChangeStatusBarTexture ) + movingTop = movingTop - mediaHeight - verticalSpacing + AJM.settingsControl.displayOptionsTeamListMediaBorder = JambaHelperSettings:CreateMediaBorder( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Border Style"] + ) + AJM.settingsControl.displayOptionsTeamListMediaBorder:SetCallback( "OnValueChanged", AJM.SettingsChangeBorderStyle ) + AJM.settingsControl.displayOptionsBorderColourPicker = JambaHelperSettings:CreateColourPicker( + AJM.settingsControl, + halfWidthSlider, + column2left + 15, + movingTop - 15, + L["Border Colour"] + ) + AJM.settingsControl.displayOptionsBorderColourPicker:SetHasAlpha( true ) + AJM.settingsControl.displayOptionsBorderColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsBorderColourPickerChanged ) + movingTop = movingTop - mediaHeight - verticalSpacing + AJM.settingsControl.displayOptionsTeamListMediaBackground = JambaHelperSettings:CreateMediaBackground( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Background"] + ) + AJM.settingsControl.displayOptionsTeamListMediaBackground:SetCallback( "OnValueChanged", AJM.SettingsChangeBackgroundStyle ) + AJM.settingsControl.displayOptionsBackgroundColourPicker = JambaHelperSettings:CreateColourPicker( + AJM.settingsControl, + halfWidthSlider, + column2left + 15, + movingTop - 15, + L["Background Colour"] + ) + AJM.settingsControl.displayOptionsBackgroundColourPicker:SetHasAlpha( true ) + AJM.settingsControl.displayOptionsBackgroundColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsBackgroundColourPickerChanged ) + movingTop = movingTop - mediaHeight - sectionSpacing + -- Create portrait. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Portrait"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowPortrait = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowPortrait + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsPortraitWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsPortraitWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsPortraitWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangePortraitWidth ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create follow status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Follow Status Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowFollowStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusName = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Name"], + AJM.SettingsToggleShowFollowStatusName + ) + AJM.settingsControl.displayOptionsCheckBoxstackName = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Stack Text"], + AJM.SettingsTogglestackName + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusLevel = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Level"], + AJM.SettingsToggleShowFollowStatusLevel + ) + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Show Item Level"], + AJM.SettingsToggleShowIlvlInformation + ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left3, + movingTop, + L["Equipped iLvl Only"], + AJM.SettingsToggleShowEquippedOnly + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsFollowStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsFollowStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsFollowStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeFollowStatusWidth ) + AJM.settingsControl.displayOptionsFollowStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsFollowStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsFollowStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeFollowStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create experience status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Experience Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowExperienceStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowExperienceStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowExperienceStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsExperienceStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsExperienceStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsExperienceStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeExperienceStatusWidth ) + AJM.settingsControl.displayOptionsExperienceStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsExperienceStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsExperienceStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeExperienceStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create reputation status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Reputation Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowReputationStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowReputationStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowReputationStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxShowReputationName = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left, + movingTop, + L["Show Faction Name"], + AJM.SettingsToggleShowReputationName + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsReputationStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsReputationStatusWidthSlider:SetSliderValues( 5, 400, 1 ) + AJM.settingsControl.displayOptionsReputationStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeReputationStatusWidth ) + AJM.settingsControl.displayOptionsReputationStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsReputationStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsReputationStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeReputationStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create health status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Health Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowHealthStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowHealthStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowHealthStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsHealthStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsHealthStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsHealthStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeHealthStatusWidth ) + AJM.settingsControl.displayOptionsHealthStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsHealthStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsHealthStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeHealthStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create power status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Power Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowPowerStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowPowerStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowPowerStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsPowerStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangePowerStatusWidth ) + AJM.settingsControl.displayOptionsPowerStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangePowerStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing + -- Create Combo Point status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Combo Point Bar"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowComboStatus + ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left2, + movingTop, + L["Values"], + AJM.SettingsToggleShowComboStatusValues + ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left3, + movingTop, + L["Percentage"], + AJM.SettingsToggleShowComboStatusPercentage + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsComboStatusWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeComboStatusWidth ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeComboStatusHeight ) + movingTop = movingTop - sliderHeight - sectionSpacing +--[[ + -- Create bag information status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Bag Information"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowBagInformation = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowBagInformation + ) + AJM.settingsControl.displayOptionsCheckBoxShowFreeBagSlotsOnly = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left2, + movingTop, + L["Only Show Free Bag Slots"], + AJM.SettingsToggleShowFreeBagSlotsOnly + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsBagInformationWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeBagInformationWidth ) + AJM.settingsControl.displayOptionsBagInformationHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeBagInformationHeight ) + movingTop = movingTop - sliderHeight - verticalSpacing +--]] + --[[ + -- Create Ilvl information status. + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Players Item Level Information"], movingTop, true ) + movingTop = movingTop - headingHeight + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth, + left, + movingTop, + L["Show"], + AJM.SettingsToggleShowIlvlInformation + ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + thirdWidth + thirdWidth, + left2, + movingTop, + L["Only Show Equipped Item Level Only"], + AJM.SettingsToggleShowEquippedOnly + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + left, + movingTop, + L["Width"] + ) + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetSliderValues( 5, 200, 1 ) + AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeIlvlInformationWidth ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider = JambaHelperSettings:CreateSlider( + AJM.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["Height"] + ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetSliderValues( 5, 50, 1 ) + AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeIlvlInformationHeight ) + movingTop = movingTop - sliderHeight - verticalSpacing + --]] + return movingTop +end + +local function SettingsCreate() + AJM.settingsControl = {} + -- Create the settings panel. + JambaHelperSettings:CreateSettings( + AJM.settingsControl, + AJM.moduleDisplayName, + AJM.parentDisplayName, + AJM.SettingsPushSettingsClick + ) + local bottomOfDisplayOptions = SettingsCreateDisplayOptions( JambaHelperSettings:TopOfSettings() ) + AJM.settingsControl.widgetSettings.content:SetHeight( -bottomOfDisplayOptions ) + -- Help + local helpTable = {} + JambaHelperSettings:CreateHelp( AJM.settingsControl, helpTable, AJM:GetConfiguration() ) +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Populate. +------------------------------------------------------------------------------------------------------------- + +function AJM:BeforeJambaProfileChanged() + AJM:RefreshTeamListControlsHide() +end + +function AJM:OnJambaProfileChanged() + AJM:SettingsRefresh() +end + +function AJM:SettingsRefresh() + AJM.settingsControl.displayOptionsCheckBoxShowTeamList:SetValue( AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowTeamListOnlyOnMaster:SetValue( AJM.db.showTeamListOnMasterOnly ) + AJM.settingsControl.displayOptionsCheckBoxHideTeamListInCombat:SetValue( AJM.db.hideTeamListInCombat ) + AJM.settingsControl.displayOptionsCheckBoxEnableClique:SetValue( AJM.db.enableClique ) + AJM.settingsControl.displayOptionsCheckBoxStackVertically:SetValue( AJM.db.barsAreStackedVertically ) + AJM.settingsControl.displayOptionsCheckBoxTeamHorizontal:SetValue( AJM.db.teamListHorizontal ) + AJM.settingsControl.displayOptionsCheckBoxShowListTitle:SetValue( AJM.db.showListTitle ) + AJM.settingsControl.displayOptionsTeamListTransparencySlider:SetValue( AJM.db.frameAlpha ) + AJM.settingsControl.displayOptionsTeamListScaleSlider:SetValue( AJM.db.teamListScale ) + AJM.settingsControl.displayOptionsTeamListMediaStatus:SetValue( AJM.db.statusBarTexture ) + AJM.settingsControl.displayOptionsTeamListMediaBorder:SetValue( AJM.db.borderStyle ) + AJM.settingsControl.displayOptionsTeamListMediaBackground:SetValue( AJM.db.backgroundStyle ) + AJM.settingsControl.displayOptionsCheckBoxShowPortrait:SetValue( AJM.db.showCharacterPortrait ) + AJM.settingsControl.displayOptionsPortraitWidthSlider:SetValue( AJM.db.characterPortraitWidth ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatus:SetValue( AJM.db.showFollowStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusName:SetValue( AJM.db.followStatusShowName ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusLevel:SetValue( AJM.db.followStatusShowLevel ) + AJM.settingsControl.displayOptionsFollowStatusWidthSlider:SetValue( AJM.db.followStatusWidth ) + AJM.settingsControl.displayOptionsFollowStatusHeightSlider:SetValue( AJM.db.followStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatus:SetValue( AJM.db.showExperienceStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusValues:SetValue( AJM.db.experienceStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusPercentage:SetValue( AJM.db.experienceStatusShowPercentage ) + AJM.settingsControl.displayOptionsExperienceStatusWidthSlider:SetValue( AJM.db.experienceStatusWidth ) + AJM.settingsControl.displayOptionsExperienceStatusHeightSlider:SetValue( AJM.db.experienceStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatus:SetValue( AJM.db.showReputationStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationName:SetValue( AJM.db.showReputationName ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusValues:SetValue( AJM.db.reputationStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusPercentage:SetValue( AJM.db.reputationStatusShowPercentage ) + AJM.settingsControl.displayOptionsReputationStatusWidthSlider:SetValue( AJM.db.reputationStatusWidth ) + AJM.settingsControl.displayOptionsReputationStatusHeightSlider:SetValue( AJM.db.reputationStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatus:SetValue( AJM.db.showHealthStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusValues:SetValue( AJM.db.healthStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusPercentage:SetValue( AJM.db.healthStatusShowPercentage ) + AJM.settingsControl.displayOptionsHealthStatusWidthSlider:SetValue( AJM.db.healthStatusWidth ) + AJM.settingsControl.displayOptionsHealthStatusHeightSlider:SetValue( AJM.db.healthStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatus:SetValue( AJM.db.showPowerStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusValues:SetValue( AJM.db.powerStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusPercentage:SetValue( AJM.db.powerStatusShowPercentage ) + AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetValue( AJM.db.powerStatusWidth ) + AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetValue( AJM.db.powerStatusHeight ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus:SetValue( AJM.db.showComboStatus ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues:SetValue( AJM.db.comboStatusShowValues ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage:SetValue( AJM.db.comboStatusShowPercentage ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetValue( AJM.db.comboStatusWidth ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetValue( AJM.db.comboStatusHeight ) + AJM.settingsControl.displayOptionsBackgroundColourPicker:SetColor( AJM.db.frameBackgroundColourR, AJM.db.frameBackgroundColourG, AJM.db.frameBackgroundColourB, AJM.db.frameBackgroundColourA ) + AJM.settingsControl.displayOptionsBorderColourPicker:SetColor( AJM.db.frameBorderColourR, AJM.db.frameBorderColourG, AJM.db.frameBorderColourB, AJM.db.frameBorderColourA ) +-- AJM.settingsControl.displayOptionsCheckBoxShowBagInformation:SetValue( AJM.db.showBagInformation ) +-- AJM.settingsControl.displayOptionsCheckBoxShowFreeBagSlotsOnly:SetValue( AJM.db.showBagFreeSlotsOnly ) +-- AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetValue( AJM.db.bagInformationWidth ) +-- AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetValue( AJM.db.bagInformationHeight ) + --Ebony + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation:SetValue( AJM.db.showIlvlInformation ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly:SetValue( AJM.db.ShowEquippedOnly ) + AJM.settingsControl.displayOptionsCheckBoxstackName:SetValue( AJM.db.stackName ) + --AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetValue( AJM.db.ilvlInformationWidth ) + --AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetValue( AJM.db.ilvlInformationHeight ) + -- State. + -- Trying to change state in combat lockdown causes taint. Let's not do that. Eventually it would be nice to have a "proper state driven team display", + -- but this workaround is enough for now. + if not InCombatLockdown() then + AJM.settingsControl.displayOptionsCheckBoxShowTeamListOnlyOnMaster:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxHideTeamListInCombat:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxEnableClique:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxStackVertically:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxTeamHorizontal:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowListTitle:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsTeamListScaleSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsTeamListTransparencySlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsTeamListMediaStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsTeamListMediaBorder:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsTeamListMediaBackground:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowPortrait:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsPortraitWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusName:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowFollowStatusLevel:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsFollowStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsFollowStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowExperienceStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsExperienceStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsExperienceStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationName:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowReputationStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsReputationStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsReputationStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowHealthStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsHealthStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsHealthStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowPowerStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsPowerStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsPowerStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatus:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusValues:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowComboStatusPercentage:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsComboStatusWidthSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsComboStatusHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsBackgroundColourPicker:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsBorderColourPicker:SetDisabled( not AJM.db.showTeamList ) +-- AJM.settingsControl.displayOptionsCheckBoxShowBagInformation:SetDisabled( not AJM.db.showTeamList ) +-- AJM.settingsControl.displayOptionsCheckBoxShowFreeBagSlotsOnly:SetDisabled( not AJM.db.showTeamList ) +-- AJM.settingsControl.displayOptionsBagInformationWidthSlider:SetDisabled( not AJM.db.showTeamList ) +-- AJM.settingsControl.displayOptionsBagInformationHeightSlider:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowIlvlInformation:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxShowEquippedOnly:SetDisabled( not AJM.db.showTeamList ) + AJM.settingsControl.displayOptionsCheckBoxstackName:SetDisabled( not AJM.db.showTeamList ) + --AJM.settingsControl.displayOptionsIlvlInformationWidthSlider:SetDisabled( not AJM.db.showTeamList ) + --AJM.settingsControl.displayOptionsIlvlInformationHeightSlider:SetDisabled( not AJM.db.showTeamList ) + if AJM.teamListCreated == true then + AJM:RefreshTeamListControls() + AJM:SettingsUpdateBorderStyle() + AJM:SettingsUpdateStatusBarTexture() + AJM:SetTeamListVisibility() + AJM:SettingsUpdateFollowTextAll() + AJM:SettingsUpdateExperienceAll() + AJM:SettingsUpdateReputationAll() + AJM:SettingsUpdateHealthAll() + AJM:SettingsUpdatePowerAll() + AJM:SettingsUpdateComboAll() +-- AJM:SettingsUpdateBagInformationAll() + --AJM:SettingsUpdateIlvlInformationAll() + end + else + AJM.updateSettingsAfterCombat = true + end +end + +-- Settings received. +function AJM:JambaOnSettingsReceived( characterName, settings ) + if characterName ~= AJM.characterName then + -- Update the settings. + AJM.db.showTeamList = settings.showTeamList + AJM.db.showTeamListOnMasterOnly = settings.showTeamListOnMasterOnly + AJM.db.hideTeamListInCombat = settings.hideTeamListInCombat + AJM.db.enableClique = settings.enableClique + AJM.db.barsAreStackedVertically = settings.barsAreStackedVertically + AJM.db.teamListHorizontal = settings.teamListHorizontal + AJM.db.showListTitle = settings.showListTitle + AJM.db.teamListScale = settings.teamListScale + AJM.db.statusBarTexture = settings.statusBarTexture + AJM.db.borderStyle = settings.borderStyle + AJM.db.backgroundStyle = settings.backgroundStyle + AJM.db.showCharacterPortrait = settings.showCharacterPortrait + AJM.db.characterPortraitWidth = settings.characterPortraitWidth + AJM.db.showFollowStatus = settings.showFollowStatus + AJM.db.followStatusWidth = settings.followStatusWidth + AJM.db.followStatusHeight = settings.followStatusHeight + AJM.db.followStatusShowName = settings.followStatusShowName + AJM.db.followStatusShowLevel = settings.followStatusShowLevel + AJM.db.showExperienceStatus = settings.showExperienceStatus + AJM.db.experienceStatusWidth = settings.experienceStatusWidth + AJM.db.experienceStatusHeight = settings.experienceStatusHeight + AJM.db.experienceStatusShowValues = settings.experienceStatusShowValues + AJM.db.experienceStatusShowPercentage = settings.experienceStatusShowPercentage + AJM.db.showReputationStatus = settings.showReputationStatus + AJM.db.showReputationName = settings.showReputationName + AJM.db.reputationStatusWidth = settings.reputationStatusWidth + AJM.db.reputationStatusHeight = settings.reputationStatusHeight + AJM.db.reputationStatusShowValues = settings.reputationStatusShowValues + AJM.db.reputationStatusShowPercentage = settings.reputationStatusShowPercentage + AJM.db.showHealthStatus = settings.showHealthStatus + AJM.db.healthStatusWidth = settings.healthStatusWidth + AJM.db.healthStatusHeight = settings.healthStatusHeight + AJM.db.healthStatusShowValues = settings.healthStatusShowValues + AJM.db.healthStatusShowPercentage = settings.healthStatusShowPercentage + AJM.db.showPowerStatus = settings.showPowerStatus + AJM.db.powerStatusWidth = settings.powerStatusWidth + AJM.db.powerStatusHeight = settings.powerStatusHeight + AJM.db.powerStatusShowValues = settings.powerStatusShowValues + AJM.db.powerStatusShowPercentage = settings.powerStatusShowPercentage + AJM.db.showComboStatus = settings.showComboStatus + AJM.db.comboStatusWidth = settings.comboStatusWidth + AJM.db.comboStatusHeight = settings.comboStatusHeight + AJM.db.comboStatusShowValues = settings.comboStatusShowValues + AJM.db.comboStatusShowPercentage = settings.comboStatusShowPercentage +-- AJM.db.showBagInformation = settings.showBagInformation +-- AJM.db.showBagFreeSlotsOnly = settings.showBagFreeSlotsOnly +-- AJM.db.bagInformationWidth = settings.bagInformationWidth +-- AJM.db.bagInformationHeight = settings.bagInformationHeight + --EBS + AJM.db.showIlvlInformation = settings.showIlvlInformation + AJM.db.ShowEquippedOnly = settings.ShowEquippedOnly + AJM.db.stackName = settings.stackName + --AJM.db.ilvlInformationWidth = settings.ilvlInformationWidth + --AJM.db.ilvlInformationHeight = settings.ilvlInformationHeight + AJM.db.frameAlpha = settings.frameAlpha + AJM.db.framePoint = settings.framePoint + AJM.db.frameRelativePoint = settings.frameRelativePoint + AJM.db.frameXOffset = settings.frameXOffset + AJM.db.frameYOffset = settings.frameYOffset + AJM.db.frameBackgroundColourR = settings.frameBackgroundColourR + AJM.db.frameBackgroundColourG = settings.frameBackgroundColourG + AJM.db.frameBackgroundColourB = settings.frameBackgroundColourB + AJM.db.frameBackgroundColourA = settings.frameBackgroundColourA + AJM.db.frameBorderColourR = settings.frameBorderColourR + AJM.db.frameBorderColourG = settings.frameBorderColourG + AJM.db.frameBorderColourB = settings.frameBorderColourB + AJM.db.frameBorderColourA = settings.frameBorderColourA + -- Refresh the settings. + AJM:SettingsRefresh() + -- Tell the player. + AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Callbacks. +------------------------------------------------------------------------------------------------------------- + +function AJM:SettingsPushSettingsClick( event ) + AJM:JambaSendSettings() +end + +function AJM:SettingsToggleShowTeamList( event, checked ) + AJM.db.showTeamList = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowTeamListOnMasterOnly( event, checked ) + AJM.db.showTeamListOnMasterOnly = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleHideTeamListInCombat( event, checked ) + AJM.db.hideTeamListInCombat = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleEnableClique( event, checked ) + AJM.db.enableClique = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleStackVertically( event, checked ) + AJM.db.barsAreStackedVertically = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleTeamHorizontal( event, checked ) + AJM.db.teamListHorizontal = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowTeamListTitle( event, checked ) + AJM.db.showListTitle = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeScale( event, value ) + AJM.db.teamListScale = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeTransparency( event, value ) + AJM.db.frameAlpha = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeStatusBarTexture( event, value ) + AJM.db.statusBarTexture = value + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeBorderStyle( event, value ) + AJM.db.borderStyle = value + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeBackgroundStyle( event, value ) + AJM.db.backgroundStyle = value + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowPortrait( event, checked ) + AJM.db.showCharacterPortrait = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangePortraitWidth( event, value ) + AJM.db.characterPortraitWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowFollowStatus( event, checked ) + AJM.db.showFollowStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowFollowStatusName( event, checked ) + AJM.db.followStatusShowName = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowFollowStatusLevel( event, checked ) + AJM.db.followStatusShowLevel = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeFollowStatusWidth( event, value ) + AJM.db.followStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeFollowStatusHeight( event, value ) + AJM.db.followStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowExperienceStatus( event, checked ) + AJM.db.showExperienceStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowExperienceStatusValues( event, checked ) + AJM.db.experienceStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowExperienceStatusPercentage( event, checked ) + AJM.db.experienceStatusShowPercentage = checked + AJM.SettingsRefresh() +end + +function AJM:SettingsChangeExperienceStatusWidth( event, value ) + AJM.db.experienceStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeExperienceStatusHeight( event, value ) + AJM.db.experienceStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowReputationStatus( event, checked ) + AJM.db.showReputationStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowReputationName( event, checked ) + AJM.db.showReputationName = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowReputationStatusValues( event, checked ) + AJM.db.reputationStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowReputationStatusPercentage( event, checked ) + AJM.db.reputationStatusShowPercentage = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeReputationStatusWidth( event, value ) + AJM.db.reputationStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeReputationStatusHeight( event, value ) + AJM.db.reputationStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowHealthStatus( event, checked ) + AJM.db.showHealthStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowHealthStatusValues( event, checked ) + AJM.db.healthStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowHealthStatusPercentage( event, checked ) + AJM.db.healthStatusShowPercentage = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeHealthStatusWidth( event, value ) + AJM.db.healthStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeHealthStatusHeight( event, value ) + AJM.db.healthStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowPowerStatus( event, checked ) + AJM.db.showPowerStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowPowerStatusValues( event, checked ) + AJM.db.powerStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowPowerStatusPercentage( event, checked ) + AJM.db.powerStatusShowPercentage = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangePowerStatusWidth( event, value ) + AJM.db.powerStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangePowerStatusHeight( event, value ) + AJM.db.powerStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowComboStatus( event, checked ) + AJM.db.showComboStatus = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowComboStatusValues( event, checked ) + AJM.db.comboStatusShowValues = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowComboStatusPercentage( event, checked ) + AJM.db.comboStatusShowPercentage = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeComboStatusWidth( event, value ) + AJM.db.comboStatusWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeComboStatusHeight( event, value ) + AJM.db.comboStatusHeight = tonumber( value ) + AJM:SettingsRefresh() +end +function AJM:SettingsBackgroundColourPickerChanged( event, r, g, b, a ) + AJM.db.frameBackgroundColourR = r + AJM.db.frameBackgroundColourG = g + AJM.db.frameBackgroundColourB = b + AJM.db.frameBackgroundColourA = a + AJM:SettingsRefresh() +end + +function AJM:SettingsBorderColourPickerChanged( event, r, g, b, a ) + AJM.db.frameBorderColourR = r + AJM.db.frameBorderColourG = g + AJM.db.frameBorderColourB = b + AJM.db.frameBorderColourA = a + AJM:SettingsRefresh() +end + +--[[ +function AJM:SettingsToggleShowBagInformation( event, checked ) + AJM.db.showBagInformation = checked + AJM:SettingsRefresh() +end + + +function AJM:SettingsToggleShowFreeBagSlotsOnly( event, checked ) + AJM.db.showBagFreeSlotsOnly = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeBagInformationWidth( event, value ) + AJM.db.bagInformationWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeBagInformationHeight( event, value ) + AJM.db.bagInformationHeight = tonumber( value ) + AJM:SettingsRefresh() +end +--]] + +--ilvl +function AJM:SettingsToggleShowIlvlInformation( event, checked ) + AJM.db.showIlvlInformation = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleShowEquippedOnly( event, checked ) + AJM.db.ShowEquippedOnly = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsTogglestackName( event, checked ) + AJM.db.stackName = checked + AJM:SettingsRefresh() +end + +--[[ +function AJM:SettingsChangeIlvlInformationWidth( event, value ) + AJM.db.ilvlInformationWidth = tonumber( value ) + AJM:SettingsRefresh() +end + +function AJM:SettingsChangeIlvlInformationHeight( event, value ) + AJM.db.ilvlInformationHeight = tonumber( value ) + AJM:SettingsRefresh() +end +--]] + +------------------------------------------------------------------------------------------------------------- +-- Commands. +------------------------------------------------------------------------------------------------------------- + +-- A Jamba command has been recieved. +function AJM:JambaOnCommandReceived( characterName, commandName, ... ) + AJM:DebugMessage( "JambaOnCommandReceived", characterName ) + if commandName == AJM.COMMAND_FOLLOW_STATUS_UPDATE then + AJM:ProcessUpdateFollowStatusMessage( characterName, ... ) + end + if commandName == AJM.COMMAND_EXPERIENCE_STATUS_UPDATE then + AJM:ProcessUpdateExperienceStatusMessage( characterName, ... ) + end + if commandName == AJM.COMMAND_REPUTATION_STATUS_UPDATE then + AJM:ProcessUpdateReputationStatusMessage( characterName, ... ) + end +-- if commandName == AJM.COMMAND_BAGINFORMATION_UPDATE then +-- AJM:ProcessUpdateBagInformationMessage( characterName, ... ) +-- end +if commandName == AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE then + AJM:ProcessUpdateIlvlInformationMessage( characterName, ... ) + end + if commandName == AJM.COMMAND_COMBO_STATUS_UPDATE then + AJM:ProcessUpdateComboStatusMessage( characterName, ... ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Shared Media Callbacks +------------------------------------------------------------------------------------------------------------- + +function AJM:LibSharedMedia_Registered() +end + +function AJM:LibSharedMedia_SetGlobal() +end + +------------------------------------------------------------------------------------------------------------- +-- Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- +-- Range Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:RangeUpdateCommand() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + --AJM:Print("name", characterName ) + local name = Ambiguate( characterName, "none" ) + local range = UnitInRange( name ) + AJM:UpdateHealthStatus( name, nil, nil, range, nil ) + AJM:UpdatePowerStatus( name, nil, nil, range ) + AJM:UpdateComboStatus( name, nil, nil, range ) + AJM:UpdateReputationStatus( name, nil, nil, nil, nil, nil, range ) + AJM:UpdateExperienceStatus( name, nil, nil, nil, range ) + --AJM:ProcessUpdateBagInformationMessage( name, nil, nil, nil, range ) + end +end + + +------------------------------------------------------------------------------------------------------------- +-- Bag Information Updates. +------------------------------------------------------------------------------------------------------------- +--[[ +function AJM:ITEM_PUSH( event, ... ) + AJM:SendBagInformationUpdateCommand() +end + +function AJM:SendBagInformationUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showBagInformation == true then + if UnitIsGhost( "player" ) then + return + end + if UnitIsDead( "player" ) then + return + end + local slotsFree, totalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) + local curTotal, maxTotal, broken = 0, 0, 0 + + for i = 1, 18 do + local curItemDurability, maxItemDurability = GetInventoryItemDurability(i) + if curItemDurability and maxItemDurability then + curTotal = curTotal + curItemDurability + maxTotal = maxTotal + maxItemDurability + if maxItemDurability > 0 and curItemDurability == 0 then + broken = broken + 1 + end + end + end + local percent = curTotal / maxTotal * 100 + --return percent, broken + --AJM:Print("Durability", percent, broken) + --if AJM.previousSlotsFree ~= slotsFree or AJM.previousTotalSlots ~= totalSlots then + + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_BAGINFORMATION_UPDATE, slotsFree, totalSlots, range ) + else + AJM:JambaSendCommandToTeam( AJM.COMMAND_BAGINFORMATION_UPDATE, slotsFree, totalSlots, range) + end + --end + end +end + +function AJM:ProcessUpdateBagInformationMessage( characterName, slotsFree, totalSlots, range) + AJM:UpdateBagInformation( characterName, slotsFree, totalSlots, range) +end + +function AJM:SettingsUpdateBagInformationAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateBagInformation( characterName, nil, nil, nil, nil ) + end +end + +function AJM:UpdateBagInformation( characterName, slotsFree, totalSlots, range) + AJM:Print("Data", characterName, slotsFree, totalSlots, percent ) + if CanDisplayTeamList() == false then + return + end + if AJM.db.showBagInformation == false then + return + end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local bagInformationFrame = characterStatusBar["bagInformationFrame"] + local bagInformationFrameText = characterStatusBar["bagInformationFrameText"] + if slotsFree == nil then + slotsFree = bagInformationFrame.slotsFree + end + if totalSlots == nil then + totalSlots = bagInformationFrame.totalSlots + end + --if percent == nil or percent == false then + -- percent = bagInformationFrame.durability + --end + bagInformationFrame.slotsFree = slotsFree + bagInformationFrame.totalSlots = totalSlots + --bagInformationFrame.durability = percent + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + bagInformationFrame:SetAlpha( 0.5 ) + else + bagInformationFrame:SetAlpha( 1 ) + end + else + bagInformationFrame:SetAlpha( 1 ) + end + local text = "" + --AJM:Print("test", percent) + --local durability = gsub(percent, "%.[^|]+", "") + --AJM:Print("hello", durability) + --text = text..L["Dura"]..L[" "]..tostring(gsub(percent, "%.[^|]+", "") )..L["%"] + + if AJM.db.showBagFreeSlotsOnly == true then + text = text..("\n")..L["BgS"]..L[" "]..tostring(slotsFree) + else + text = text..("\n")..L["BgS"]..L[" "]..tostring((totalSlots - slotsFree)).."/"..tostring(totalSlots) + end + bagInformationFrameText:SetText( text ) + --AJM:Print("freespace", slotsFree, totalSlots) --Debug +end +--]] + +------------------------------------------------------------------------------------------------------------- +-- Ilvl Information Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:ITEMLVL_PUSH( event, ... ) + AJM:SendIlvlInformationUpdateCommand() +end + +function AJM:PLAYER_EQUIPMENT_CHANGED( event, ... ) + AJM:SendIlvlInformationUpdateCommand() +end + + +function AJM:SendIlvlInformationUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showIlvlInformation == true or AJM.db.followStatusShowLevel == true then + if UnitIsGhost( "player" ) then + return + end + if UnitIsDead( "player" ) then + return + end + local overall, equipped = GetAverageItemLevel() + local characterLevel = UnitLevel("player") + --if AJM.previousIlvl ~= overall then ---or AJM.previousTotalSlots ~= totalSlots then + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE, characterLevel, overall, equipped ) + else + AJM:JambaSendCommandToTeam( AJM.COMMAND_ITEMLEVELINFORMATION_UPDATE, characterLevel, overall, equipped ) + end + --end + end +end + +------------------------------------------------------------------------------------------------------------- +-- Follow Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:AUTOFOLLOW_BEGIN( event, ... ) + AJM:SendFollowStatusUpdateCommand( true ) +end + +function AJM:AUTOFOLLOW_END( event, followEndedReason, ... ) + AJM:SendFollowStatusUpdateCommand( false ) +end + +function AJM:SendFollowStatusUpdateCommand( isFollowing ) + if AJM.db.showTeamList == true and AJM.db.showFollowStatus == true then + -- Check to see if JambaFollow is enabled and follow strobing is on. If this is the case then + -- do not send the follow update. + local canSend = true + if JambaApi.Follow ~= nil then + if JambaApi.Follow.IsFollowingStrobing() == true then + canSend = false + end + end + if canSend == true then + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_FOLLOW_STATUS_UPDATE, isFollowing ) + else + AJM:JambaSendCommandToTeam( AJM.COMMAND_FOLLOW_STATUS_UPDATE, isFollowing ) + end + end + end +end + +function AJM:ProcessUpdateFollowStatusMessage( characterName, isFollowing ) + AJM:UpdateFollowStatus( characterName, isFollowing, false ) +end + +--TODO: Ebony,-- See if this code could be cleaned up a little as when in combat takes a few mins after to catch up. Sending add-on msg with combat? +function AJM:UpdateFollowStatus( characterName, isFollowing, isFollowLeader ) + if CanDisplayTeamList() == false then + return + end + if AJM.db.showFollowStatus == false then + return + end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local followBar = characterStatusBar["followBar"] + if isFollowing == true then + -- Following. + followBar:SetStatusBarColor( 0.05, 0.85, 0.05, 1.00 ) + else + if isFollowLeader == true then + -- Follow leader. + followBar:SetStatusBarColor( 0.55, 0.15, 0.15, 0.25 ) + else + -- Not following. + followBar:SetStatusBarColor( 0.85, 0.05, 0.05, 1.00 ) + end + end +end + +function AJM:ProcessUpdateIlvlInformationMessage( characterName, characterLevel, overall, equipped ) + AJM:SettingsUpdateFollowText( characterName, characterLevel, overall, equipped ) +end + + +function AJM:SettingsUpdateFollowTextAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:SettingsUpdateFollowText( characterName, nil, nil, nil ) + --AJM:SettingsUpdateFollowText( characterName, nil, nil, nil ) + end +end + + +function AJM:SettingsUpdateFollowText( characterName, characterLevel, overall, equipped ) + --AJM:Print("Info", characterName, characterLevel,overall, equipped) -- debug + if CanDisplayTeamList() == false then + return + end + if AJM.db.showFollowStatus == false then + return + end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local ilvlInformationFrame = characterStatusBar["ilvlInformationFrame"] + local ilvlInformationFrameText = characterStatusBar["ilvlInformationFrameText"] + if overall == nil then + overall = ilvlInformationFrame.overall + end + if equipped == nil then + equipped = ilvlInformationFrame.equipped + end + if characterLevel == nil then + characterLevel = ilvlInformationFrame.characterLevel + end + ilvlInformationFrame.overall = overall + ilvlInformationFrame.equipped = equipped + ilvlInformationFrame.characterLevel = characterLevel + local followBarText = characterStatusBar["followBarText"] + local text = "" + if AJM.db.followStatusShowName == true then + text = text..Ambiguate( characterName, "none" ) + end + if AJM.db.followStatusShowLevel == true then + if AJM.db.followStatusShowName == true then + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring( characterLevel )..L[")"] + else + text = text..L[" "]..L["("]..tostring( characterLevel )..L[")"] + end + else + text = tostring( characterLevel ) + end + end + if AJM.db.showIlvlInformation == true then + if AJM.db.ShowEquippedOnly == true then + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring (format("%.0f", equipped ))..L[")"] + else + text = text..L[" "]..L["("]..tostring (format("%.0f", equipped ))..L[")"] + end + else + if AJM.db.stackName == true then + text = text..L[" "]..("\n")..L["("]..tostring(format("%.0f", equipped )).."/"..tostring(format("%.0f", overall ))..L[")"] + else + text = text..L[" "]..L["("]..tostring(format("%.0f", equipped )).."/"..tostring(format("%.0f", overall ))..L[")"] + end + end + end + followBarText:SetText( text ) +end + +------------------------------------------------------------------------------------------------------------- +-- Experience Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:PLAYER_XP_UPDATE( event, ... ) + AJM:SendExperienceStatusUpdateCommand() +end + +function AJM:UPDATE_EXHAUSTION( event, ... ) + AJM:SendExperienceStatusUpdateCommand() +end + +function AJM:PLAYER_LEVEL_UP( event, ... ) + AJM:SendExperienceStatusUpdateCommand() + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() +end + +function AJM:SendExperienceStatusUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showExperienceStatus == true then + -- Hide the xp bar at max level as its nolonger needed. + local uLevel = UnitLevel("player") + local maxLevel = GetMaxPlayerLevel() + --[[ + if uLevel == maxLevel then + --AJM:Print("maxLevel", uLevel, maxLevel) --debug + AJM.db.showExperienceStatus = false + AJM.SettingsRefresh() + AJM:JambaSendSettings() + end + --]] + local playerExperience = UnitXP( "player" ) + local playerMaxExperience = UnitXPMax( "player" ) + local playerMaxLevel = GetMaxPlayerLevel() + local playerLevel = UnitLevel("player") + local exhaustionStateID, exhaustionStateName, exhaustionStateMultiplier = GetRestState() + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID) + else + AJM:DebugMessage( "SendExperienceStatusUpdateCommand TO TEAM!" ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID) + end + end +end + +function AJM:ProcessUpdateExperienceStatusMessage( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) + AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) +end + +function AJM:SettingsUpdateExperienceAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateExperienceStatus( characterName, nil, nil, nil, nil ) + end +end + +function AJM:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, range ) + --AJM:Print( "UpdateExperienceStatus", characterName, playerExperience, playerMaxExperience, exhaustionStateID, range) + + if CanDisplayTeamList() == false then + return + end + if AJM.db.showExperienceStatus == false then + return + end + + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local experienceBarText = characterStatusBar["experienceBarText"] + local experienceBar = characterStatusBar["experienceBar"] + if playerExperience == nil then + playerExperience = experienceBarText.playerExperience + end + if playerMaxExperience == nil then + playerMaxExperience = experienceBarText.playerMaxExperience + end + if exhaustionStateID == nil then + exhaustionStateID = experienceBarText.exhaustionStateID + end + + experienceBarText.playerExperience = playerExperience + experienceBarText.playerMaxExperience = playerMaxExperience + experienceBarText.exhaustionStateID = exhaustionStateID + experienceBar:SetMinMaxValues( 0, tonumber( playerMaxExperience ) ) + experienceBar:SetValue( tonumber( playerExperience ) ) + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + experienceBar:SetAlpha( 0.5 ) + else + experienceBar:SetAlpha( 1 ) + end + else + experienceBar:SetAlpha( 1 ) + end + local text = "" + if AJM.db.experienceStatusShowValues == true then + text = text..tostring( playerExperience )..L[" / "]..tostring( playerMaxExperience )..L[" "] + end + if AJM.db.experienceStatusShowPercentage == true then + if AJM.db.experienceStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerExperience/playerMaxExperience)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerExperience/playerMaxExperience)*100) )..L["%"] + end + end + experienceBarText:SetText( text ) + if exhaustionStateID == 1 then + experienceBar:SetStatusBarColor( 0.0, 0.39, 0.88, 1.0 ) + experienceBar.backgroundTexture:SetTexture( 0.0, 0.39, 0.88, 0.15 ) + else + experienceBar:SetStatusBarColor( 0.58, 0.0, 0.55, 1.0 ) + experienceBar.backgroundTexture:SetTexture( 0.58, 0.0, 0.55, 0.15 ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Reputation Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:CHAT_MSG_COMBAT_FACTION_CHANGE( event, ... ) + AJM:SendReputationStatusUpdateCommand() +end + +function AJM:SetWatchedFactionIndex( index ) + AJM:ScheduleTimer( "SendReputationStatusUpdateCommand", 5 ) +end + +function AJM:SendReputationStatusUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showReputationStatus == true then + local reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue = GetWatchedFactionInfo() + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_REPUTATION_STATUS_UPDATE, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue ) + else + AJM:JambaSendCommandToTeam( AJM.COMMAND_REPUTATION_STATUS_UPDATE, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue ) + end + end +end + +function AJM:ProcessUpdateReputationStatusMessage( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) + AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) +end + +function AJM:SettingsUpdateReputationAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateReputationStatus( characterName, nil, nil, nil, nil, nil, nil ) + end +end + +function AJM:UpdateReputationStatus( characterName, reputationName, reputationStandingID, reputationBarMin, reputationBarMax, reputationBarValue, range ) + if CanDisplayTeamList() == false then + return + end + if AJM.db.showReputationStatus == false then + return + end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local reputationBarText = characterStatusBar["reputationBarText"] + local reputationBar = characterStatusBar["reputationBar"] + if reputationName == nil then + reputationName = reputationBarText.reputationName + end + if reputationStandingID == nil then + reputationStandingID = reputationBarText.reputationStandingID + end + if reputationBarMin == nil then + reputationBarMin = reputationBarText.reputationBarMin + end + if reputationBarMax == nil then + reputationBarMax = reputationBarText.reputationBarMax + end + if reputationBarValue == nil then + reputationBarValue = reputationBarText.reputationBarValue + end + reputationBarText.reputationName = reputationName + reputationBarText.reputationStandingID = reputationStandingID + reputationBarText.reputationBarMin = reputationBarMin + reputationBarText.reputationBarMax = reputationBarMax + reputationBarText.reputationBarValue = reputationBarValue + reputationBar:SetMinMaxValues( tonumber( reputationBarMin ), tonumber( reputationBarMax ) ) + reputationBar:SetValue( tonumber( reputationBarValue ) ) + if reputationName == 0 then + reputationBarMin = 0 + reputationBarMax = 100 + reputationBarValue = 100 + reputationStandingID = 1 + end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + reputationBar:SetAlpha( 0.5 ) + else + reputationBar:SetAlpha( 1 ) + end + else + reputationBar:SetAlpha( 1 ) + end + local text = "" + if AJM.db.showReputationName == true then + if reputationName == 0 then + text = text..L["No Faction Selected"].." " + else + text = text..reputationName.." " + end + end + -- TODO: do we need to hook SetWatchedFactionIndex for when a watched faction changes? + if AJM.db.reputationStatusShowValues == true then + text = text..tostring( reputationBarValue-reputationBarMin )..L[" / "]..tostring( reputationBarMax-reputationBarMin )..L[" "] + end + if AJM.db.reputationStatusShowPercentage == true then + local textPercentage = tostring( floor( (reputationBarValue-reputationBarMin)/(reputationBarMax-reputationBarMin)*100 ) )..L["%"] + if AJM.db.reputationStatusShowValues == true then + text = text..L["("]..textPercentage..L[")"] + else + text = text..textPercentage + end + end + reputationBarText:SetText( text ) + local barColor = _G.FACTION_BAR_COLORS[reputationStandingID] + if barColor ~= nil then + reputationBar:SetStatusBarColor( barColor.r, barColor.g, barColor.b, 1.0 ) + reputationBar.backgroundTexture:SetTexture( barColor.r, barColor.g, barColor.b, 0.15 ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Health Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:UNIT_HEALTH( event, unit, ... ) + AJM:SendHealthStatusUpdateCommand( unit,nil ) + --AJM:Print("test2", unit) +end + +function AJM:UNIT_MAXHEALTH( event, unit, ... ) + AJM:SendHealthStatusUpdateCommand( unit, nil ) +end + + +function AJM:SendHealthStatusUpdateCommand( unit, range ) + if AJM.db.showTeamList == true and AJM.db.showHealthStatus == true then + local playerHealth = UnitHealth( unit ) + local playerMaxHealth = UnitHealthMax( unit ) + local isDead = UnitIsDeadOrGhost( unit ) + local characterName, characterRealm = UnitName( unit ) + local character = JambaUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) + --AJM:Print("HeathStats", character, playerHealth, playerMaxHealth, range) + AJM:UpdateHealthStatus( character, playerHealth, playerMaxHealth, range, isDead ) + end +end + +function AJM:SettingsUpdateHealthAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateHealthStatus( characterName, nil, nil, nil, nil ) + end +end + +function AJM:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, range, isDead ) + if CanDisplayTeamList() == false then + return + end + if AJM.db.showHealthStatus == false then + return + end + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local healthBarText = characterStatusBar["healthBarText"] + local healthBar = characterStatusBar["healthBar"] + if playerHealth == nil then + playerHealth = healthBarText.playerHealth + end + if playerMaxHealth == nil then + playerMaxHealth = healthBarText.playerMaxHealth + end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + healthBar:SetAlpha( 0.5 ) + else + healthBar:SetAlpha( 1 ) + end + else + healthBar:SetAlpha( 1 ) + end + healthBarText.playerHealth = playerHealth + healthBarText.playerMaxHealth = playerMaxHealth + healthBar:SetMinMaxValues( 0, tonumber( playerMaxHealth ) ) + healthBar:SetValue( tonumber( playerHealth ) ) + local text = "" + if UnitIsDeadOrGhost(Ambiguate( characterName, "none" ) ) == true then + --if isDead == true then + --AJM:Print("dead", characterName) + text = text..L["DEAD"] + else + if AJM.db.healthStatusShowValues == true then + text = text..tostring( playerHealth )..L[" / "]..tostring( playerMaxHealth )..L[" "] + end + if AJM.db.healthStatusShowPercentage == true then + if AJM.db.healthStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerHealth/playerMaxHealth)*100) )..L["%"] + end + end + end + healthBarText:SetText( text ) + AJM:SetStatusBarColourForHealth( healthBar, floor((playerHealth/playerMaxHealth)*100) ) +end + +function AJM:SetStatusBarColourForHealth( statusBar, statusValue ) + local r, g, b = 0, 0, 0 + statusValue = statusValue / 100 + if( statusValue > 0.5 ) then + r = (1.0 - statusValue) * 2 + g = 1.0 + else + r = 1.0 + g = statusValue * 2 + end + b = 0.0 + statusBar:SetStatusBarColor( r, g, b ) +end + +------------------------------------------------------------------------------------------------------------- +-- Power Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:UNIT_POWER( event, unit, ... ) + AJM:SendPowerStatusUpdateCommand( unit ) +end + +function AJM:UNIT_DISPLAYPOWER( event, unit, ... ) + AJM:SendPowerStatusUpdateCommand( unit ) +end + +function AJM:SendPowerStatusUpdateCommand( unit ) + if AJM.db.showTeamList == true and AJM.db.showPowerStatus == true then + local playerPower = UnitPower( unit ) + local playerMaxPower = UnitPowerMax( unit ) + local characterName, characterRealm = UnitName( unit ) + local character = JambaUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) + --AJM:Print("power", character, playerPower, playerMaxPower ) + AJM:UpdatePowerStatus( character, playerPower, playerMaxPower) + end +end + +function AJM:SettingsUpdatePowerAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdatePowerStatus( characterName, nil, nil, nil ) + end +end + +function AJM:UpdatePowerStatus( characterName, playerPower, playerMaxPower, range ) + if CanDisplayTeamList() == false then + return + end + if AJM.db.showPowerStatus == false then + return + end + local originalChatacterName = characterName + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + local powerBarText = characterStatusBar["powerBarText"] + local powerBar = characterStatusBar["powerBar"] + if playerPower == nil then + playerPower = powerBarText.playerPower + end + if playerMaxPower == nil then + playerMaxPower = powerBarText.playerMaxPower + end + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + powerBar:SetAlpha( 0.5 ) + else + powerBar:SetAlpha( 1 ) + end + else + powerBar:SetAlpha( 1 ) + end + powerBarText.playerPower = playerPower + powerBarText.playerMaxPower = playerMaxPower + powerBar:SetMinMaxValues( 0, tonumber( playerMaxPower ) ) + powerBar:SetValue( tonumber( playerPower ) ) + local text = "" + if AJM.db.powerStatusShowValues == true then + text = text..tostring( playerPower )..L[" / "]..tostring( playerMaxPower )..L[" "] + end + if AJM.db.powerStatusShowPercentage == true then + if AJM.db.powerStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerPower/playerMaxPower)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerPower/playerMaxPower)*100) )..L["%"] + end + end + powerBarText:SetText( text ) + AJM:SetStatusBarColourForPower( powerBar, originalChatacterName ) +end + +function AJM:SetStatusBarColourForPower( statusBar, unit ) + unit = Ambiguate( unit, "none" ) + local powerIndex, powerString, altR, altG, altB = UnitPowerType( unit ) + if powerString ~= nil and powerString ~= "" then + local r = PowerBarColor[powerString].r + local g = PowerBarColor[powerString].g + local b = PowerBarColor[powerString].b + statusBar:SetStatusBarColor( r, g, b, 1 ) + statusBar.backgroundTexture:SetTexture( r, g, b, 0.25 ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Combo Points Status Bar Updates. +------------------------------------------------------------------------------------------------------------- + +function AJM:UNIT_COMBO_POINTS( event, ... ) + --AJM:Print("hello") + AJM:SendComboStatusUpdateCommand() +end + + +--function AJM:UNIT_DISPLAYCOMBO( event, unit, ... ) +-- AJM:SendComboStatusUpdateCommand( unit ) +--end + +function AJM:SendComboStatusUpdateCommand() + if AJM.db.showTeamList == true and AJM.db.showComboStatus == true then + if select(2, UnitClass("player")) ~= "DRUID" and select(2, UnitClass("player")) ~= "ROGUE" == true then + return + end + + local playerCombo = UnitPower ( "player", 4) + local playerMaxCombo = UnitPowerMax( "player", 4) + --AJM:Print ("combo", playerCombo, playerMaxCombo) + if AJM.db.showTeamListOnMasterOnly == true then + AJM:JambaSendCommandToMaster( AJM.COMMAND_COMBO_STATUS_UPDATE, playerCombo, playerMaxCombo ) + else + AJM:DebugMessage( "SendComboStatusUpdateCommand TO TEAM!" ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_COMBO_STATUS_UPDATE, playerCombo, playerMaxCombo ) + end + end +end + +function AJM:ProcessUpdateComboStatusMessage( characterName, playerCombo, playerMaxCombo, range ) + AJM:UpdateComboStatus( characterName, playerCombo , playerMaxCombo, range ) +end + +function AJM:SettingsUpdateComboAll() + for characterName, characterStatusBar in pairs( AJM.characterStatusBar ) do + AJM:UpdateComboStatus( characterName, nil, nil, nil ) + end +end + +function AJM:UpdateComboStatus( characterName, playerCombo, playerMaxCombon, range ) + if CanDisplayTeamList() == false then + return + end + + if AJM.db.showComboStatus == false then + return + end + + local characterStatusBar = AJM.characterStatusBar[characterName] + if characterStatusBar == nil then + return + end + + local comboBarText = characterStatusBar["comboBarText"] + local comboBar = characterStatusBar["comboBar"] + + if playerCombo == nil then + playerCombo = comboBarText.playerCombo + end + + if playerMaxCombo == nil then + playerMaxCombo = comboBarText.playerMaxCombo + end + + comboBarText.playerCombo = playerCombo + comboBarText.playerMaxCombo = playerMaxCombo + comboBar:SetMinMaxValues( 0, tonumber( playerMaxCombo ) ) + comboBar:SetValue( tonumber( playerCombo ) ) + if UnitInParty(Ambiguate( characterName, "none" ) ) == true then + if range == false then + comboBar:SetAlpha( 0.5 ) + else + comboBar:SetAlpha( 1 ) + end + else + comboBar:SetAlpha( 1 ) + end + local text = "" + + if AJM.db.comboStatusShowValues == true then + text = text..tostring( playerCombo )..L[" / "]..tostring( playerMaxCombo )..L[" "] + end + + if AJM.db.ComboStatusShowPercentage == true then + if AJM.db.comboStatusShowValues == true then + text = text..L["("]..tostring( floor( (playerCombo/playerMaxCombo)*100) )..L["%"]..L[")"] + else + text = tostring( floor( (playerCombo/playerMaxCombo)*100) )..L["%"] + end + end + comboBarText:SetText( text ) +end + +--[[ +function AJM:SetStatusBarColourForCombo( statusBar, unit ) + local powerIndex, powerString, altR, altG, altB = UnitPowerType( unit ) + if comboString ~= nil and comboString ~= "" then + local r = ComboBarColor[powerString].r + local g = ComboBarColor[powerString].g + local b = ComboBarColor[powerString].b + statusBar:SetStatusBarColor( r, g, b, 1 ) + statusBar.backgroundTexture:SetTexture( r, g, b, 0.25 ) + end + +end +--]] + +------------------------------------------------------------------------------------------------------------- +-- Addon initialization, enabling and disabling. +------------------------------------------------------------------------------------------------------------- + +-- Initialise the module. +function AJM:OnInitialize() + AJM.previousSlotsFree = 0 + AJM.previousTotalSlots = 0 + -- Create the settings control. + SettingsCreate() + -- Initialise the JambaModule part of this module. + AJM:JambaModuleInitialize( AJM.settingsControl.widgetSettings.frame ) + -- Populate the settings. + AJM:SettingsRefresh() + -- Create the team list frame. + CreateJambaTeamListFrame() + AJM:SetTeamListVisibility() +end + +-- Called when the addon is enabled. +function AJM:OnEnable() + AJM:RegisterEvent( "PLAYER_REGEN_ENABLED" ) + AJM:RegisterEvent( "PLAYER_REGEN_DISABLED" ) + AJM:RegisterEvent( "AUTOFOLLOW_BEGIN" ) + AJM:RegisterEvent( "AUTOFOLLOW_END" ) + AJM:RegisterEvent( "PLAYER_XP_UPDATE" ) + AJM:RegisterEvent( "UPDATE_EXHAUSTION" ) + AJM:RegisterEvent( "PLAYER_LEVEL_UP" ) + AJM:RegisterEvent( "UNIT_HEALTH" ) + AJM:RegisterEvent( "UNIT_MAXHEALTH" ) + AJM:RegisterEvent( "UNIT_POWER", "UNIT_POWER" ) + AJM:RegisterEvent( "UNIT_MAXPOWER", "UNIT_POWER" ) + AJM:RegisterEvent( "PLAYER_EQUIPMENT_CHANGED" ) + AJM:RegisterEvent( "PLAYER_ENTERING_WORLD") + AJM:RegisterEvent( "UNIT_DISPLAYPOWER" ) + AJM:RegisterEvent( "UNIT_LEVEL" ) + AJM:RegisterEvent( "ITEMLVL_PUSH" ) + AJM:RegisterEvent( "GROUP_ROSTER_UPDATE" ) +-- AJM:RegisterEvent( "ITEM_PUSH" ) + AJM:RegisterEvent( "CHAT_MSG_COMBAT_FACTION_CHANGE" ) + AJM:RegisterEvent( "UNIT_COMBO_POINTS" ) + --Updating Bag information -- Chaneged again 4.1 this event fires even for bank bags. When moving an item in your inventory, this fires multiple times: once each for the source and destination bag +-- AJM:RegisterEvent( "BAG_UPDATE", "ITEM_PUSH" ) + --Updates everytime jamba Reads the UI_ERROR_MESSAGE Are This is not very good for me using a spambar! Need's a better system. + --AJM:RegisterEvent( "UI_ERROR_MESSAGE", "ITEM_PUSH" ) + --TODO: Clean up code + --AJM:RegisterEvent( "UNIT_PORTRAIT_UPDATE" ) + AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_Registered" ) + AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_SetGlobal" ) + AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_CHARACTER_ADDED, "OnCharactersChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_CHARACTER_REMOVED, "OnCharactersChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_ORDER_CHANGED, "OnCharactersChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_MASTER_CHANGED, "OnMasterChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged") + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged") + AJM:SecureHook( "SetWatchedFactionIndex" ) + AJM:ScheduleTimer( "RefreshTeamListControls", 20 ) + AJM:ScheduleTimer( "SendExperienceStatusUpdateCommand", 5 ) + AJM:ScheduleTimer( "SendReputationStatusUpdateCommand", 5 ) +-- AJM:ScheduleTimer( "SendBagInformationUpdateCommand", 5 ) + AJM:ScheduleTimer( "SendIlvlInformationUpdateCommand", 5 ) + --AJM:timerCount = ( 0 ) + --AJM:testTimer = + --self.timerCount = 0 + AJM:ScheduleRepeatingTimer("RangeUpdateCommand", 5) +end + +-- Called when the addon is disabled. +function AJM:OnDisable() +end + +-- this is not needed as the range timer would do this. +function AJM:PLAYER_ENTERING_WORLD( event, ... ) +-- AJM:SendBagInformationUpdateCommand() + AJM:SendExperienceStatusUpdateCommand() + AJM:SendIlvlInformationUpdateCommand() + AJM:SendReputationStatusUpdateCommand() +end + +function AJM:OnMasterChanged( message, characterName ) + AJM:SettingsRefresh() +end + +function AJM:UNIT_LEVEL( event, ... ) + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() +end + +function AJM:GROUP_ROSTER_UPDATE( event, ... ) + --AJM:SettingsUpdateFollowTextAll() + AJM:SendIlvlInformationUpdateCommand() +-- AJM:SendBagInformationUpdateCommand() +end + +function AJM:PLAYER_REGEN_ENABLED( event, ... ) + if AJM.db.hideTeamListInCombat == true then + AJM:SetTeamListVisibility() + end + if AJM.refreshHideTeamListControlsPending == true then + AJM:RefreshTeamListControlsHide() + AJM.refreshHideTeamListControlsPending = false + end + if AJM.refreshShowTeamListControlsPending == true then + AJM:RefreshTeamListControlsShow() + AJM.refreshShowTeamListControlsPending = false + end + if AJM.updateSettingsAfterCombat == true then + AJM:SettingsRefresh() + AJM.updateSettingsAfterCombat = false + end +end + +function AJM:PLAYER_REGEN_DISABLED( event, ... ) + if AJM.db.hideTeamListInCombat == true then + JambaDisplayTeamListFrame:Hide() + end +end + +function AJM:OnCharactersChanged() + AJM:RefreshTeamListControls() + AJM:SendIlvlInformationUpdateCommand() +end \ No newline at end of file diff --git a/Jamba-DisplayTeam/Locales/JambaDisplayTeam-Locale-enUS.lua b/Jamba-DisplayTeam/Locales/JambaDisplayTeam-Locale-enUS.lua index c34fb48..27f523b 100644 --- a/Jamba-DisplayTeam/Locales/JambaDisplayTeam-Locale-enUS.lua +++ b/Jamba-DisplayTeam/Locales/JambaDisplayTeam-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -42,12 +42,14 @@ L["Follow Status Bar"] = true L["Experience Bar"] = true L["Health Bar"] = true L["Power Bar"] = true +L["Combo Point Bar"] = true L["Jamba Team"] = true L["Hide Team Display"] = true L["Hide the display team panel."] = true L["Show Team Display"] = true L["Show the display team panel."] = true L["Hide Team List In Combat"] = true +L["Enable Clique Support - **reload UI to take effect**"] = true L["Transparency"] = true L["Border Colour"] = true L["Background Colour"] = true @@ -58,3 +60,9 @@ L["Only Show Free Bag Slots"] = true L["Reputation Bar"] = true L["Show Faction Name"] = true L["No Faction Selected"] = true +L["Show Item Level"] = true +L["Equipped iLvl Only"] = true +L["Stack Text"] = true +L["DEAD"] = true +L["BgS"] = true +L["Dura"] = true \ No newline at end of file diff --git a/Jamba-DisplayTeam/Locales/Locales.xml b/Jamba-DisplayTeam/Locales/Locales.xml index c19b2f1..0ef4e87 100644 --- a/Jamba-DisplayTeam/Locales/Locales.xml +++ b/Jamba-DisplayTeam/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-FTL/Jamba-FTL.toc b/Jamba-FTL/Jamba-FTL.toc index a6f125a..9947d3e 100644 --- a/Jamba-FTL/Jamba-FTL.toc +++ b/Jamba-FTL/Jamba-FTL.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-FTL -## Notes: Jamba-FTL -## Author: Olipcs, Ebony, Former Author: Jafula -## Version: 3.12 +## Interface: 60200 +## Title: JambaFTL +## Notes: JambaFTL +## Author: olipcs (although most of the code is originaly from Jafula) (any changes added to support 4.0.5 from ebony!) +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-FTL/JambaFTL.lua b/Jamba-FTL/JambaFTL.lua index 389c381..a9e4e7b 100644 --- a/Jamba-FTL/JambaFTL.lua +++ b/Jamba-FTL/JambaFTL.lua @@ -161,8 +161,9 @@ local function createFTLString() -- create a list of the Toons which should be used local activeToons = {} for index, characterName in JambaApi.TeamListOrdered() do - -- check if modifoers for a character exist - if AJM.db.CharListWithModifiers[characterName] then + --characterName = ( Ambiguate( characterName, "none" ) ) + -- check if modifoers for a character exist + if AJM.db.CharListWithModifiers[characterName] then -- check if useToon is true if AJM.db.CharListWithModifiers[characterName].useToon then -- check if onlyUseOnlineToons is activated and if so, if the toon is online @@ -199,14 +200,15 @@ local function createFTLString() -- create the string local ftlstring = "" for index, characterName in ipairs( activeToons ) do - ftlstring = ftlstring .. "[" + Name = ( Ambiguate( characterName, "none" ) ) + ftlstring = ftlstring .. "[" --first if not dontUseLeftRight is set (so its differeniated between l/r) if (not AJM.db.dontUseLeftRight) then if useLShift then if (not AJM.db.CharListWithModifiers[characterName].lshift) then ftlstring = ftlstring .. "no" end - ftlstring = ftlstring .. "mod:lshift," + ftlstring = ftlstring .. "mod:lshift," end if useRShift then if (not AJM.db.CharListWithModifiers[characterName].rshift) then @@ -259,7 +261,7 @@ local function createFTLString() ftlstring = ftlstring .. "mod:ctrl," end end - ftlstring = ftlstring .. "]" .. characterName .. ";" + ftlstring = ftlstring .. "]" .. Name .. ";" end return ftlstring end @@ -282,6 +284,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Follow/Jamba-Follow.toc b/Jamba-Follow/Jamba-Follow.toc index 60d9ef6..d3a6f35 100644 --- a/Jamba-Follow/Jamba-Follow.toc +++ b/Jamba-Follow/Jamba-Follow.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Follow -## Notes: Jamba-Follow +## Interface: 60200 +## Title: JambaFollow +## Notes: JambaFollow ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Follow/JambaFollow.lua b/Jamba-Follow/JambaFollow.lua index 3add88b..a876ef6 100644 --- a/Jamba-Follow/JambaFollow.lua +++ b/Jamba-Follow/JambaFollow.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -648,6 +648,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -681,8 +683,10 @@ function AJM:AreTeamMembersInCombat() -- Is the team member online? if JambaApi.GetCharacterOnlineStatus( characterName ) == true then -- Yes, is the character in combat? - if UnitAffectingCombat( characterName ) then - inCombat = true + --if UnitAffectingCombat( characterName ) then + -- Ebony This API does not like A realmName so better remove it if its from the server we playing on. + if UnitAffectingCombat( Ambiguate( characterName, "none" ) ) then + inCombat = true break end end @@ -927,10 +931,11 @@ end function AJM:ReceiveCommandFollowTrain( tag ) if JambaApi.DoesCharacterHaveTag( AJM.characterName, tag ) then local characterInFront = nil - for index, character in JambaApi.TeamListOrdered() do - if character == self.characterName then + for index, character in JambaApi.TeamListOrderedOnline() do + if character == AJM.characterName then if characterInFront ~= nil then - FollowUnit( characterInFront ) + --FollowUnit( characterInFront ) + FollowUnit( Ambiguate( characterInFront, "none" ) ) end return else @@ -944,7 +949,6 @@ end function AJM:CommandSetFollowMaster( info, parameters ) local target, tag = strsplit( " ", parameters ) - target = JambaUtilities:Capitalise( target ) if tag ~= nil and tag:trim() ~= "" then AJM:JambaSendCommandToTeam( AJM.COMMAND_SET_FOLLOW_MASTER, target, tag ) else @@ -1062,7 +1066,7 @@ end function AJM:FollowTarget( target ) -- Attempting to follow self? Note: if target ever is party1, etc, then this will not catch the same character. - if JambaUtilities:Capitalise( target ) == JambaUtilities:Capitalise( AJM.characterName ) then + if JambaUtilities:Lowercase( target ) == JambaUtilities:Lowercase( AJM.characterName ) then return end local canFollowTarget = true @@ -1092,8 +1096,9 @@ function AJM:FollowTarget( target ) if (AJM.db.autoFollowAfterCombat == true) or (AJM.followingStrobing == true) then AJM.jambaSetFollowTarget = true end + --AJM:Print( target ) -- Follow unit only works when in a party or raid for resolving against player names. - FollowUnit( target ) + FollowUnit( Ambiguate( target, "none" ) ) end end diff --git a/Jamba-Follow/Locales/JambaFollow-Locale-enUS.lua b/Jamba-Follow/Locales/JambaFollow-Locale-enUS.lua index 43c6bbb..330b19f 100644 --- a/Jamba-Follow/Locales/JambaFollow-Locale-enUS.lua +++ b/Jamba-Follow/Locales/JambaFollow-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Follow/Locales/Locales.xml b/Jamba-Follow/Locales/Locales.xml index 8172d4a..9d5d038 100644 --- a/Jamba-Follow/Locales/Locales.xml +++ b/Jamba-Follow/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-ItemUse/Bindings.xml b/Jamba-ItemUse/Bindings.xml index e05dc41..70d5933 100644 --- a/Jamba-ItemUse/Bindings.xml +++ b/Jamba-ItemUse/Bindings.xml @@ -1,69 +1,68 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Bindings> - <Binding name="JAMBAITEMUSE1" header="JAMBAITEMUSE" category="ADDONS"> + <Binding name="JAMBAITEMUSE1" header="JAMBAITEMUSE" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE2" category="ADDONS"> + <Binding name="JAMBAITEMUSE2" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE3" category="ADDONS"> + <Binding name="JAMBAITEMUSE3" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE4" category="ADDONS"> + <Binding name="JAMBAITEMUSE4" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE5" category="ADDONS"> + <Binding name="JAMBAITEMUSE5" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE6" category="ADDONS"> + <Binding name="JAMBAITEMUSE6" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE7" category="ADDONS"> + <Binding name="JAMBAITEMUSE7" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE8" category="ADDONS"> + <Binding name="JAMBAITEMUSE8" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE9" category="ADDONS"> + <Binding name="JAMBAITEMUSE9" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE10" category="ADDONS"> + <Binding name="JAMBAITEMUSE10" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE11" category="ADDONS"> + <Binding name="JAMBAITEMUSE11" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE12" category="ADDONS"> + <Binding name="JAMBAITEMUSE12" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE13" category="ADDONS"> + <Binding name="JAMBAITEMUSE13" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE14" category="ADDONS"> + <Binding name="JAMBAITEMUSE14" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE15" category="ADDONS"> + <Binding name="JAMBAITEMUSE15" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE16" category="ADDONS"> + <Binding name="JAMBAITEMUSE16" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE17" category="ADDONS"> + <Binding name="JAMBAITEMUSE17" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE18" category="ADDONS"> + <Binding name="JAMBAITEMUSE18" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE19" category="ADDONS"> + <Binding name="JAMBAITEMUSE19" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBAITEMUSE20" category="ADDONS"> + <Binding name="JAMBAITEMUSE20" category="Jamba"> --[[dummy]] </Binding> </Bindings> diff --git a/Jamba-ItemUse/Jamba-ItemUse.toc b/Jamba-ItemUse/Jamba-ItemUse.toc index dfd0ab0..1257889 100644 --- a/Jamba-ItemUse/Jamba-ItemUse.toc +++ b/Jamba-ItemUse/Jamba-ItemUse.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-ItemUse -## Notes: Jamba-ItemUse +## Interface: 60200 +## Title: JambaItemUse +## Notes: JambaItemUse ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-ItemUse/JambaItemUse.lua b/Jamba-ItemUse/JambaItemUse.lua index bf258e0..fc9f4fc 100644 --- a/Jamba-ItemUse/JambaItemUse.lua +++ b/Jamba-ItemUse/JambaItemUse.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -65,6 +65,7 @@ AJM.settings = { itemUseVerticalSpacing = 3, itemUseHorizontalSpacing = 2, autoAddQuestItemsToBar = true, + itemBarsSynchronized = true, numberOfItems = 10, numberOfRows = 2, messageArea = JambaApi.DefaultWarningArea(), @@ -263,6 +264,32 @@ function AJM:SettingsUpdateBorderStyle() frame:SetBackdropBorderColor( AJM.db.frameBorderColourR, AJM.db.frameBorderColourG, AJM.db.frameBorderColourB, AJM.db.frameBorderColourA ) end +-- updates after the quest has been handed in, +function AJM:UpdateQuestItemsInBar() + local state = "0" + for iterateItems = 1, AJM.maximumNumberOfItems, 1 do + local itemContainer = AJM.itemContainer[iterateItems] + if itemContainer == nil then + AJM:CreateJambaItemUseItemContainer( iterateItems, parentFrame ) + itemContainer = AJM.itemContainer[iterateItems] + end + local containerButton = itemContainer["container"] + local itemInfo = AJM:GetItemFromItemDatabase( iterateItems ) + local kind = itemInfo.kind + local action = itemInfo.action + if kind == "item" then + local itemLink,_,_,_,_,questItem = GetItemInfo( action ) + if questItem == "Quest" then + --AJM:Print("Checking Item...", itemLink, action) + if AJM:IsInInventory( itemLink ) == false then + --AJM:Print("NOT IN BAGS", itemLink) + AJM.db.itemsAdvanced[iterateItems] = nil + end + end + end + end +end + function AJM:UpdateItemsInBar() local state = "0" local parentFrame = JambaItemUseFrame @@ -280,10 +307,10 @@ function AJM:UpdateItemsInBar() action = action:sub(6) end --AJM:Print(state, kind, action) - if kind == "mount" or kind == "battlepet" then + if kind == "mount" or kind == "battlepet" then containerButton:ClearStates() - else - containerButton:SetState(state, kind, action) + else + containerButton:SetState(state, kind, action) end end end @@ -310,7 +337,7 @@ end function AJM:OnButtonContentsChanged( event, button, state, type, value, ... ) if type == "mount" or type == "battlepet" then - return + return end AJM:AddItemToItemDatabase( button.itemNumber, type, value ) AJM:JambaSendSettings() @@ -356,6 +383,8 @@ function AJM:CreateJambaItemUseItemContainer( itemNumber, parentFrame ) itemContainer["container"] = containerButton end +--TODO CLEAN UP NOLONGER NEEDED +--[[ function AJM:CheckForQuestItemAndAddToBar() local isQuest local questId @@ -371,6 +400,10 @@ function AJM:CheckForQuestItemAndAddToBar() -- Don't check slots that have no items and don't check anything in the keyring bag (-2) if link ~= nil and bag ~= -2 then -- Starts a quest items. + -- Battlepet links break tooltips! + if string.find(link, "battlepet") then + return + end LibGratuity:SetHyperlink( link ) if LibGratuity:Find( ITEM_STARTS_QUEST ) then AJM:AddAnItemToTheBarIfNotExists( link, true ) @@ -392,6 +425,57 @@ function AJM:CheckForQuestItemAndAddToBar() end end end +--]] + +--ebony test Using the wowapi and not the scanning of tooltips +function AJM:CheckForQuestItemAndAddToBar() + for bag = 0,4,1 do + for slot = 1,GetContainerNumSlots(bag),1 do + local IsQuestItem,StartsQuest,_ = GetContainerItemQuestInfo(bag,slot) + local _,_,_,_,readable,_,itemLink = GetContainerItemInfo(bag,slot) -- readable??? + if not IsQuestItem and StartsQuest then + local itemString = GetItemInfo(itemLink) + AJM:AddAnItemToTheBarIfNotExists( itemLink, true ) + end + end + end + for iterateQuests=1,GetNumQuestLogEntries() do + local questLogTitleText,_,_,_,isHeader = GetQuestLogTitle(iterateQuests) + if not isHeader then + local questItemLink, questItemIcon, questItemCharges = GetQuestLogSpecialItemInfo( iterateQuests ) + if questItemLink then + local itemName = GetItemInfo(questItemLink) + local questname,rank = GetItemSpell(questItemLink) -- Only means to detect if the item is usable + if questname then + if JambaUtilities:DoItemLinksContainTheSameItem( questItemLink, questItemLink ) == true then + AJM:AddAnItemToTheBarIfNotExists( questItemLink, false ) + end + end + end + end + end +end + +--Checks the item is in the player players bag +function AJM:IsInInventory(itemLink) + for bag = 0,4,1 do + for slot = 1,GetContainerNumSlots(bag),1 do + --AJM:Debug( "Bags OK. checking", itemLink ) + local _,_,_,_,_,_,_,_,_,Link = GetContainerItemInfo(bag,slot) + if Link then + --AJM:Debug( "Bags OK. checking", itemLink, Link ) + local itemString = GetItemInfo( Link ) + --AJM:Debug( "Bags OK. checking", itemLink, itemString ) + if itemLink == itemString then + --AJM:Print( "True" ) + return true + end + end + end + end + return false +end + function AJM:AddAnItemToTheBarIfNotExists( itemLink, startsQuest ) local itemInfo @@ -408,6 +492,13 @@ function AJM:AddAnItemToTheBarIfNotExists( itemLink, startsQuest ) if alreadyExists == false then for iterateItems = 1, AJM.db.numberOfItems, 1 do itemInfo = AJM:GetItemFromItemDatabase( iterateItems ) + --TODO LOOK in if we need this i don't think we do. + --AJM:Print( "ITEMiD", itemLink) + --ebonyfassttest + --AJM:Print( "checking item is in players bag.") + --Checks the items we talking about is in the bags of the player. + --if AJM:IsInInventory( itemLink ) == true then + --AJM:Print( "is in bags") if itemInfo.kind == "empty" then AJM:AddItemToItemDatabase( iterateItems, "item", itemId ) AJM:JambaSendSettings() @@ -416,6 +507,7 @@ function AJM:AddAnItemToTheBarIfNotExists( itemLink, startsQuest ) AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["New item that starts a quest found!"], false ) end return + --end end end end @@ -508,6 +600,15 @@ local function SettingsCreateOptions( top ) movingTop, L["Only On Master"], AJM.SettingsToggleShowItemUseOnlyOnMaster + ) + movingTop = movingTop - checkBoxHeight - verticalSpacing + AJM.settingsControl.displayOptionsCheckBoxItemBarsSynchronized = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + left, + movingTop, + L["Keep Item Bars On Minions Synchronized"], + AJM.SettingsToggleItemBarsSynchronized ) movingTop = movingTop - checkBoxHeight - verticalSpacing AJM.settingsControl.displayOptionsCheckBoxAutoAddQuestItem = JambaHelperSettings:CreateCheckBox( @@ -670,6 +771,7 @@ function AJM:SettingsRefresh() AJM.settingsControl.displayOptionsItemUseNumberOfItems:SetValue( AJM.db.numberOfItems ) AJM.settingsControl.displayOptionsItemUseNumberOfRows:SetValue( AJM.db.numberOfRows ) AJM.settingsControl.displayOptionsCheckBoxAutoAddQuestItem:SetValue( AJM.db.autoAddQuestItemsToBar ) + AJM.settingsControl.displayOptionsCheckBoxItemBarsSynchronized:SetValue( AJM.db.itemBarsSynchronized ) AJM.settingsControl.displayOptionsItemUseScaleSlider:SetValue( AJM.db.itemUseScale ) AJM.settingsControl.displayOptionsItemUseTransparencySlider:SetValue( AJM.db.frameAlpha ) AJM.settingsControl.displayOptionsItemUseMediaBorder:SetValue( AJM.db.borderStyle ) @@ -686,6 +788,7 @@ function AJM:SettingsRefresh() AJM.settingsControl.displayOptionsItemUseNumberOfItems:SetDisabled( not AJM.db.showItemUse ) AJM.settingsControl.displayOptionsItemUseNumberOfRows:SetDisabled( not AJM.db.showItemUse ) AJM.settingsControl.displayOptionsCheckBoxAutoAddQuestItem:SetDisabled( not AJM.db.showItemUse ) + AJM.settingsControl.displayOptionsCheckBoxItemBarsSynchronized:SetDisabled( not AJM.db.showItemUse ) AJM.settingsControl.displayOptionsItemUseScaleSlider:SetDisabled( not AJM.db.showItemUse ) AJM.settingsControl.displayOptionsItemUseTransparencySlider:SetDisabled( not AJM.db.showItemUse ) AJM.settingsControl.displayOptionsItemUseMediaBorder:SetDisabled( not AJM.db.showItemUse ) @@ -728,6 +831,11 @@ function AJM:SettingsToggleAutoAddQuestItem( event, checked ) AJM:SettingsRefresh() end +function AJM:SettingsToggleItemBarsSynchronized( event, checked ) + AJM.db.itemBarsSynchronized = checked + AJM:SettingsRefresh() +end + function AJM:SettingsChangeNumberOfItems( event, value ) AJM.db.numberOfItems = tonumber( value ) AJM:SettingsRefresh() @@ -809,6 +917,7 @@ function AJM:OnEnable() AJM:RegisterEvent( "PLAYER_REGEN_DISABLED" ) AJM:RegisterEvent( "BAG_UPDATE" ) AJM:RegisterEvent( "ITEM_PUSH" ) + AJM:RegisterEvent( "UNIT_QUEST_LOG_CHANGED", "QUEST_UPDATE" ) AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_Registered" ) AJM.SharedMedia.RegisterCallback( AJM, "LibSharedMedia_SetGlobal" ) AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_MASTER_CHANGED, "OnMasterChanged" ) @@ -842,10 +951,13 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.itemUseVerticalSpacing = settings.itemUseVerticalSpacing AJM.db.itemUseHorizontalSpacing = settings.itemUseHorizontalSpacing AJM.db.autoAddQuestItemsToBar = settings.autoAddQuestItemsToBar + AJM.db.itemBarsSynchronized = settings.itemBarsSynchronized AJM.db.numberOfItems = settings.numberOfItems AJM.db.numberOfRows = settings.numberOfRows AJM.db.messageArea = settings.messageArea - AJM.db.itemsAdvanced = JambaUtilities:CopyTable( settings.itemsAdvanced ) + if AJM.db.itemBarsSynchronized == true then + AJM.db.itemsAdvanced = JambaUtilities:CopyTable( settings.itemsAdvanced ) + end AJM.db.frameAlpha = settings.frameAlpha AJM.db.framePoint = settings.framePoint AJM.db.frameRelativePoint = settings.frameRelativePoint @@ -863,6 +975,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -900,6 +1014,12 @@ function AJM:BAG_UPDATE() end end +function AJM:QUEST_UPDATE() + if not InCombatLockdown() then + AJM:UpdateQuestItemsInBar() end +end + + function AJM:ITEM_PUSH() if AJM.db.autoAddQuestItemsToBar == true then AJM:ScheduleTimer( "CheckForQuestItemAndAddToBar", 2 ) diff --git a/Jamba-ItemUse/Locales/JambaItemUse-Locale-enUS.lua b/Jamba-ItemUse/Locales/JambaItemUse-Locale-enUS.lua index c5b41d4..ee0fe64 100644 --- a/Jamba-ItemUse/Locales/JambaItemUse-Locale-enUS.lua +++ b/Jamba-ItemUse/Locales/JambaItemUse-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -60,6 +60,7 @@ L["Item 18"] = true L["Item 19"] = true L["Item 20"] = true L["Automatically Add Quest Items To Bar"] = true +L["Keep Item Bars On Minions Synchronized"] = true L["Number Of Rows"] = true L["New item that starts a quest found!"] = true L["Clear Item Bar"] = true diff --git a/Jamba-ItemUse/Locales/Locales.xml b/Jamba-ItemUse/Locales/Locales.xml index 2c2de5d..14d9304 100644 --- a/Jamba-ItemUse/Locales/Locales.xml +++ b/Jamba-ItemUse/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Macro/Jamba-Macro.toc b/Jamba-Macro/Jamba-Macro.toc index 887f298..ce982cd 100644 --- a/Jamba-Macro/Jamba-Macro.toc +++ b/Jamba-Macro/Jamba-Macro.toc @@ -1,14 +1,12 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba-Macro ## Notes: Jamba-Macro ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba ## SavedVariables: JambaMacroProfileDB ## LoadOnDemand: 1 Locales\Locales.xml -JambaMacro.lua - - +JambaMacro.lua \ No newline at end of file diff --git a/Jamba-Macro/JambaMacro.lua b/Jamba-Macro/JambaMacro.lua index b00a4bb..035a8cd 100644 --- a/Jamba-Macro/JambaMacro.lua +++ b/Jamba-Macro/JambaMacro.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -127,6 +127,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsMacroSetsRowClick( 1, 1 ) -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Macro/Locales/Jamba-Macro-Locale-enUS.lua b/Jamba-Macro/Locales/Jamba-Macro-Locale-enUS.lua new file mode 100644 index 0000000..944995c --- /dev/null +++ b/Jamba-Macro/Locales/Jamba-Macro-Locale-enUS.lua @@ -0,0 +1,75 @@ +--[[ +Jamba - Jafula's Awesome Multi-Boxer Assistant +Copyright 2008 - 2016 Michael "Jafula" Miller +License: The MIT License +]]-- + +local L = LibStub("AceLocale-3.0"):NewLocale( "Jamba-Macro", "enUS", true ) +L["Slash Commands"] = true +L["Macro"] = true +L["Push Settings"] = true +L["Push the macro settings to all characters in the team."] = true +L["Settings received from A."] = function( characterName ) + return string.format( "Settings received from %s.", characterName ) +end +L["Use"] = true +L["Add"] = true +L["Remove"] = true +L["Copy"] = true +L["Show"] = true +L["Variable Sets"] = true +L["Variables"] = true +L["Macro Sets"] = true +L["Macros"] = true +L["Edit Variable"] = true +L["Variable Name"] = true +L["Variable Value"] = true +L["Variable Tag (prefix ! for not this tag)"] = true +L["Edit Macro"] = true +L["Macro Name"] = true +L["Macro Text"] = true +L["Macro Key"] = true +L["Macro Tag (prefix ! for not this tag)"] = true +L["Macro: Macros"] = true +L["Macro: Variables"] = true +L["Macro Sets Control"] = true +L["Enable"] = true +L["Disable"] = true +L["Configure Macro Set"] = true +L["Variable Set"] = true +L["Tag"] = true +L["On"] = true +L["Off"] = true +L["Build Macros (Team)"] = true +L["Enter name for this SET of variables:"] = true +L['Are you sure you wish to remove "%s" from the variable SET list?'] = true +L["Enter name for this variable:"] = true +L['Are you sure you wish to remove "%s" from the variable list?'] = true +L["Enter name for this SET of macros:"] = true +L['Are you sure you wish to remove "%s" from the macro SET list?'] = true +L["Enter name for this macro:"] = true +L['Are you sure you wish to remove "%s" from the macro list?'] = true +L["Enter name for the copy of this SET of variables:"] = true +L["Enter name for the copy of this SET of macros:"] = true +L["/click JMB_"] = true +L["Macro Usage - press key assigned or copy /click below."] = true +L["Use Macro and Variable Set"] = true +L["Update the macros to use the specified macro and variable sets."] = true +L["Can not find macro set: X"] = function( macroSetName ) + return string.format( "Can not find macro set: %s", macroSetName ) +end +L["Can not find variable set: X"] = function( variableSetName ) + return string.format( "Can not find variable set: %s", variableSetName ) +end +L["Variable names must only be made up of letters and numbers."] = true +L["Macro names must only be made up of letters and numbers."] = true +L["Macro tags must only be made up of letters and numbers."] = true +L["Please choose a macro set to use."] = true +L["Please choose a variable set to use."] = true +L["Using macros set: X"] = function( macroSetName ) + return string.format( "Using macros set: %s", macroSetName ) +end +L["Using variables set: X"] = function( variableSetName ) + return string.format( "Using variables set: %s", variableSetName ) +end +L["In combat, waiting until after combat to update the macros."] = true diff --git a/Jamba-Macro/Locales/JambaMacro-Locale-enUS.lua b/Jamba-Macro/Locales/JambaMacro-Locale-enUS.lua deleted file mode 100644 index 9a6334c..0000000 --- a/Jamba-Macro/Locales/JambaMacro-Locale-enUS.lua +++ /dev/null @@ -1,75 +0,0 @@ ---[[ -Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller -License: The MIT License -]]-- - -local L = LibStub("AceLocale-3.0"):NewLocale( "Jamba-Macro", "enUS", true ) -L["Slash Commands"] = true -L["Macro"] = true -L["Push Settings"] = true -L["Push the macro settings to all characters in the team."] = true -L["Settings received from A."] = function( characterName ) - return string.format( "Settings received from %s.", characterName ) -end -L["Use"] = true -L["Add"] = true -L["Remove"] = true -L["Copy"] = true -L["Show"] = true -L["Variable Sets"] = true -L["Variables"] = true -L["Macro Sets"] = true -L["Macros"] = true -L["Edit Variable"] = true -L["Variable Name"] = true -L["Variable Value"] = true -L["Variable Tag (prefix ! for not this tag)"] = true -L["Edit Macro"] = true -L["Macro Name"] = true -L["Macro Text"] = true -L["Macro Key"] = true -L["Macro Tag (prefix ! for not this tag)"] = true -L["Macro: Macros"] = true -L["Macro: Variables"] = true -L["Macro Sets Control"] = true -L["Enable"] = true -L["Disable"] = true -L["Configure Macro Set"] = true -L["Variable Set"] = true -L["Tag"] = true -L["On"] = true -L["Off"] = true -L["Build Macros (Team)"] = true -L["Enter name for this SET of variables:"] = true -L['Are you sure you wish to remove "%s" from the variable SET list?'] = true -L["Enter name for this variable:"] = true -L['Are you sure you wish to remove "%s" from the variable list?'] = true -L["Enter name for this SET of macros:"] = true -L['Are you sure you wish to remove "%s" from the macro SET list?'] = true -L["Enter name for this macro:"] = true -L['Are you sure you wish to remove "%s" from the macro list?'] = true -L["Enter name for the copy of this SET of variables:"] = true -L["Enter name for the copy of this SET of macros:"] = true -L["/click JMB_"] = true -L["Macro Usage - press key assigned or copy /click below."] = true -L["Use Macro and Variable Set"] = true -L["Update the macros to use the specified macro and variable sets."] = true -L["Can not find macro set: X"] = function( macroSetName ) - return string.format( "Can not find macro set: %s", macroSetName ) -end -L["Can not find variable set: X"] = function( variableSetName ) - return string.format( "Can not find variable set: %s", variableSetName ) -end -L["Variable names must only be made up of letters and numbers."] = true -L["Macro names must only be made up of letters and numbers."] = true -L["Macro tags must only be made up of letters and numbers."] = true -L["Please choose a macro set to use."] = true -L["Please choose a variable set to use."] = true -L["Using macros set: X"] = function( macroSetName ) - return string.format( "Using macros set: %s", macroSetName ) -end -L["Using variables set: X"] = function( variableSetName ) - return string.format( "Using variables set: %s", variableSetName ) -end -L["In combat, waiting until after combat to update the macros."] = true diff --git a/Jamba-Macro/Locales/Locales.xml b/Jamba-Macro/Locales/Locales.xml index 16783c7..bd8b828 100644 --- a/Jamba-Macro/Locales/Locales.xml +++ b/Jamba-Macro/Locales/Locales.xml @@ -1,10 +1,9 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> - <Script file="JambaMacro-Locale-enUS.lua" /> + <Script file="Jamba-Macro-Locale-enUS.lua" /> </Ui> \ No newline at end of file diff --git a/Jamba-Proc/Jamba-Proc.toc b/Jamba-Proc/Jamba-Proc.toc index 164eeca..517e530 100644 --- a/Jamba-Proc/Jamba-Proc.toc +++ b/Jamba-Proc/Jamba-Proc.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Proc -## Notes: Jamba-Proc +## Interface: 60200 +## Title: JambaProc +## Notes: JambaProc ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Proc/JambaProc.lua b/Jamba-Proc/JambaProc.lua index 37c95da..863420d 100644 --- a/Jamba-Proc/JambaProc.lua +++ b/Jamba-Proc/JambaProc.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -31,7 +31,7 @@ AJM.moduleDisplayName = L["Proc"] -- Settings - the values to store and their defaults for the settings database. AJM.settings = { profile = { - procEnabled = true, + procEnabled = false, procEnabledOnMasterOnly = true, procTimerBarHeight = 22, procTimerBarWidth = 350, @@ -211,6 +211,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:UpdateShowConfigBars() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Proc/Locales/JambaProc-Locale-enUS.lua b/Jamba-Proc/Locales/JambaProc-Locale-enUS.lua index 0c78ebf..637c950 100644 --- a/Jamba-Proc/Locales/JambaProc-Locale-enUS.lua +++ b/Jamba-Proc/Locales/JambaProc-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Proc/Locales/Locales.xml b/Jamba-Proc/Locales/Locales.xml index 437f9c6..a3d739b 100644 --- a/Jamba-Proc/Locales/Locales.xml +++ b/Jamba-Proc/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Purchase/Jamba-Purchase.toc b/Jamba-Purchase/Jamba-Purchase.toc index d631fa9..92111db 100644 --- a/Jamba-Purchase/Jamba-Purchase.toc +++ b/Jamba-Purchase/Jamba-Purchase.toc @@ -1,8 +1,8 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba-Purchase ## Notes: Jamba-Purchase ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Purchase/JambaPurchase.lua b/Jamba-Purchase/JambaPurchase.lua index eebb3bf..e6193de 100644 --- a/Jamba-Purchase/JambaPurchase.lua +++ b/Jamba-Purchase/JambaPurchase.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -115,6 +115,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Purchase/Locales/JambaPurchase-Locale-enUS.lua b/Jamba-Purchase/Locales/JambaPurchase-Locale-enUS.lua index 7f5e8ef..f55a4ac 100644 --- a/Jamba-Purchase/Locales/JambaPurchase-Locale-enUS.lua +++ b/Jamba-Purchase/Locales/JambaPurchase-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Purchase/Locales/Locales.xml b/Jamba-Purchase/Locales/Locales.xml index 90c7ce8..ba0e513 100644 --- a/Jamba-Purchase/Locales/Locales.xml +++ b/Jamba-Purchase/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Quest/Jamba-Quest.toc b/Jamba-Quest/Jamba-Quest.toc index c448ac5..55527a0 100644 --- a/Jamba-Quest/Jamba-Quest.toc +++ b/Jamba-Quest/Jamba-Quest.toc @@ -1,16 +1,12 @@ -## Interface: 60100 -## Title: Jamba-Quest -## Notes: Jamba-Quest +## Interface: 60200 +## Title: JambaQuest +## Notes: JambaQuest ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba ## SavedVariables: JambaQuestProfileDB ## LoadOnDemand: 1 Locales\Locales.xml -JambaQuest.lua -Overrides.lua - - - +JambaQuest.lua \ No newline at end of file diff --git a/Jamba-Quest/JambaQuest.lua b/Jamba-Quest/JambaQuest.lua index 2dba1f5..6146351 100644 --- a/Jamba-Quest/JambaQuest.lua +++ b/Jamba-Quest/JambaQuest.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -175,11 +175,10 @@ function AJM:OnEnable() AJM:SecureHook( "DeclineQuest" ) AJM:SecureHook( "GetQuestReward" ) AJM:SecureHook( "ToggleFrame" ) + AJM:SecureHook( "ToggleQuestLog" ) AJM:SecureHook( WorldMapFrame, "Hide", "QuestLogFrameHide" ) - --AJM:SecureHook( QuestLogFrame, "Hide", "QuestLogFrameHide" ) AJM:SecureHook( "SelectQuestLogEntry" ) AJM:SecureHook( "ShowQuestComplete" ) --- QuestDetailAcceptButton:HookScript( "OnClick", function() AJM:MagicAutoAcceptQuestGrrrr() end ) end -- Called when the addon is disabled. @@ -272,7 +271,7 @@ function AJM:SettingsCreateQuestControl( top ) -- Create a heading for quest selection. JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Quest Selection & Acceptance"], movingTop, false ) movingTop = movingTop - headingHeight - -- Radio box: Slave select, accept and decline quest with master. + -- Radio box: Minion select, accept and decline quest with master. AJM.settingsControl.checkBoxMirrorMasterQuestSelectionAndDeclining = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, @@ -304,14 +303,14 @@ function AJM:SettingsCreateQuestControl( top ) AJM.SettingsToggleAcceptQuests ) movingTop = movingTop - checkBoxHeight - -- Radio box: Slave accept quest with master. - AJM.settingsControl.checkBoxSlaveMirrorMasterAccept = JambaHelperSettings:CreateCheckBox( + -- Radio box: Minion accept quest with master. + AJM.settingsControl.checkBoxMinionMirrorMasterAccept = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, column1Left + indent, movingTop, L["Toon Accept Quest From Team"], - AJM.SettingsToggleSlaveMirrorMasterAccept + AJM.SettingsToggleMinionMirrorMasterAccept ) movingTop = movingTop - checkBoxHeight -- Radio box: All auto accept any quest. @@ -413,14 +412,14 @@ function AJM:SettingsCreateQuestControl( top ) AJM.SettingsToggleMasterAutoShareQuestOnAccept ) movingTop = movingTop - checkBoxHeight - -- Check box: Slave auto accept escort quest from master. - AJM.settingsControl.checkBoxSlaveAutoAcceptEscortQuest = JambaHelperSettings:CreateCheckBox( + -- Check box: Minion auto accept escort quest from master. + AJM.settingsControl.checkBoxMinionAutoAcceptEscortQuest = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, column1Left, movingTop, L["Toon Auto Accept Escort Quest From Team"], - AJM.SettingsToggleSlaveAutoAcceptEscortQuest + AJM.SettingsToggleMinionAutoAcceptEscortQuest ) movingTop = movingTop - checkBoxHeight -- Create a heading for other options. @@ -518,7 +517,7 @@ function AJM:SettingsCreateQuestCompletionControl( top ) L["Quest Has No Rewards Or One Reward:"] ) movingTop = movingTop - labelHeight - -- Radio box: No choice, slave do nothing. + -- Radio box: No choice, minion do nothing. AJM.settingsControlCompletion.checkBoxNoChoiceAllDoNothing = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, @@ -529,16 +528,16 @@ function AJM:SettingsCreateQuestCompletionControl( top ) ) AJM.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetType( "radio" ) movingTop = movingTop - radioBoxHeight - -- Radio box: No choice, slave complete quest with master. - AJM.settingsControlCompletion.checkBoxNoChoiceSlaveCompleteQuestWithMaster = JambaHelperSettings:CreateCheckBox( + -- Radio box: No choice, minion complete quest with master. + AJM.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left, movingTop, L["Toon Complete Quest With Team"], - AJM.SettingsToggleNoChoiceSlaveCompleteQuestWithMaster + AJM.SettingsToggleNoChoiceMinionCompleteQuestWithMaster ) - AJM.settingsControlCompletion.checkBoxNoChoiceSlaveCompleteQuestWithMaster:SetType( "radio" ) + AJM.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetType( "radio" ) movingTop = movingTop - radioBoxHeight -- Radio box: No Choice, all automatically complete quest. AJM.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest = JambaHelperSettings:CreateCheckBox( @@ -560,20 +559,20 @@ function AJM:SettingsCreateQuestCompletionControl( top ) L["Quest Has More Than One Reward:"] ) movingTop = movingTop - labelHeight - -- Radio box: Has choice, slave do nothing. - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveDoNothing = JambaHelperSettings:CreateCheckBox( + -- Radio box: Has choice, minion do nothing. + AJM.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left, movingTop, L["Toon Do Nothing"], - AJM.SettingsToggleHasChoiceSlaveDoNothing + AJM.SettingsToggleHasChoiceMinionDoNothing ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveDoNothing:SetType( "radio" ) --- movingTop = movingTop - radioBoxHeight + AJM.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight -- TODO: Fix or remove. -- Radio box: Has choice, choose best reward. --- AJM.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter = JambaHelperSettings:CreateCheckBox( +-- AJM.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter = JambaHelperSettings:CreateCheckBox( -- AJM.settingsControlCompletion, -- headingWidth, -- column1Left, @@ -591,54 +590,55 @@ function AJM:SettingsCreateQuestCompletionControl( top ) -- movingTop, -- L["And Claims It As Well"], -- AJM.SettingsToggleActuallyGetTheBestReward +-- -- ) movingTop = movingTop - checkBoxHeight - -- Radio box: Has choice, slave complete quest with master. - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveCompleteQuestWithMaster = JambaHelperSettings:CreateCheckBox( + -- Radio box: Has choice, minion complete quest with master. + AJM.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left, movingTop, L["Toon Complete Quest With Team"], - AJM.SettingsToggleHasChoiceSlaveCompleteQuestWithMaster + AJM.SettingsToggleHasChoiceMinionCompleteQuestWithMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveCompleteQuestWithMaster:SetType( "radio" ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetType( "radio" ) movingTop = movingTop - radioBoxHeight - -- Radio box: Has choice, slave must choose own reward. - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveMustChooseOwnReward = JambaHelperSettings:CreateCheckBox( + -- Radio box: Has choice, minion must choose own reward. + AJM.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left + indent, movingTop, L["Toon Must Choose Own Reward"], - AJM.SettingsToggleHasChoiceSlaveMustChooseOwnReward + AJM.SettingsToggleHasChoiceMinionMustChooseOwnReward ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveMustChooseOwnReward:SetType( "radio" ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetType( "radio" ) movingTop = movingTop - radioBoxHeight - -- Radio box: Has choice, slave choose same reward as master. - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveChooseSameRewardAsMaster = JambaHelperSettings:CreateCheckBox( + -- Radio box: Has choice, minion choose same reward as master. + AJM.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left + indent, movingTop, L["Toon Choose Same Reward As Team"], - AJM.SettingsToggleHasChoiceSlaveChooseSameRewardAsMaster + AJM.SettingsToggleHasChoiceMinionChooseSameRewardAsMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveChooseSameRewardAsMaster:SetType( "radio" ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetType( "radio" ) movingTop = movingTop - radioBoxHeight - -- Radio box: Has choice, slave reward choice depends on modifier key pressed down. - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveRewardChoiceModifierConditional = JambaHelperSettings:CreateCheckBox( + -- Radio box: Has choice, minion reward choice depends on modifier key pressed down. + AJM.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left + indent, movingTop, L["If Modifier Keys Pressed, Toon Choose Same Reward"], - AJM.SettingsToggleHasChoiceSlaveRewardChoiceModifierConditional + AJM.SettingsToggleHasChoiceMinionRewardChoiceModifierConditional ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveRewardChoiceModifierConditional:SetType( "radio" ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetType( "radio" ) movingTop = movingTop - radioBoxHeight -- Label continuing radio box above. - AJM.settingsControlCompletion.labelHasChoiceSlaveRewardChoiceModifierConditional = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControlCompletion.labelHasChoiceMinionRewardChoiceModifierConditional = JambaHelperSettings:CreateContinueLabel( AJM.settingsControlCompletion, headingWidth, column1Left + indentContinueLabel, @@ -674,18 +674,18 @@ function AJM:SettingsCreateQuestCompletionControl( top ) AJM.SettingsToggleHasChoiceAltKeyModifier ) movingTop = movingTop - checkBoxHeight - -- Check box: Has choice, override, if slave already has reward selected, choose that reward. - AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseSlaveRewardSelected = JambaHelperSettings:CreateCheckBox( + -- Check box: Has choice, override, if minion already has reward selected, choose that reward. + AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCompletion, headingWidth, column1Left + indent, movingTop, L["Override: If Toon Already Has Reward Selected,"], - AJM.SettingsToggleHasChoiceOverrideUseSlaveRewardSelected + AJM.SettingsToggleHasChoiceOverrideUseMinionRewardSelected ) movingTop = movingTop - checkBoxHeight -- Label continuing check box above. - AJM.settingsControlCompletion.labelHasChoiceOverrideUseSlaveRewardSelected = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControlCompletion.labelHasChoiceOverrideUseMinionRewardSelected = JambaHelperSettings:CreateContinueLabel( AJM.settingsControlCompletion, headingWidth, column1Left + indentSpecial, @@ -742,6 +742,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -761,7 +763,7 @@ function AJM:SettingsRefresh() AJM.settingsControl.checkBoxMirrorMasterQuestSelectionAndDeclining:SetValue( AJM.db.mirrorMasterQuestSelectionAndDeclining ) AJM.settingsControl.checkBoxAllAutoSelectQuests:SetValue( AJM.db.allAutoSelectQuests ) AJM.settingsControl.checkBoxAcceptQuests:SetValue( AJM.db.acceptQuests ) - AJM.settingsControl.checkBoxSlaveMirrorMasterAccept:SetValue( AJM.db.slaveMirrorMasterAccept ) + AJM.settingsControl.checkBoxMinionMirrorMasterAccept:SetValue( AJM.db.slaveMirrorMasterAccept ) AJM.settingsControl.checkBoxDoNotAutoAccept:SetValue( AJM.db.doNotAutoAccept ) AJM.settingsControl.checkBoxAllAcceptAnyQuest:SetValue( AJM.db.allAcceptAnyQuest ) AJM.settingsControl.checkBoxOnlyAcceptQuestsFrom:SetValue( AJM.db.onlyAcceptQuestsFrom ) @@ -772,7 +774,7 @@ function AJM:SettingsRefresh() AJM.settingsControl.checkBoxAcceptFromRaid:SetValue( AJM.db.acceptFromRaid ) AJM.settingsControl.checkBoxAcceptFromGuild:SetValue( AJM.db.acceptFromGuild ) AJM.settingsControl.checkBoxMasterAutoShareQuestOnAccept:SetValue( AJM.db.masterAutoShareQuestOnAccept ) - AJM.settingsControl.checkBoxSlaveAutoAcceptEscortQuest:SetValue( AJM.db.slaveAutoAcceptEscortQuest ) + AJM.settingsControl.checkBoxMinionAutoAcceptEscortQuest:SetValue( AJM.db.slaveAutoAcceptEscortQuest ) AJM.settingsControl.checkBoxShowJambaQuestLogWithWoWQuestLog:SetValue( AJM.db.showJambaQuestLogWithWoWQuestLog ) AJM.settingsControl.checkBoxOverrideQuestAutoSelectAndComplete:SetValue( AJM.db.overrideQuestAutoSelectAndComplete ) AJM.settingsControl.dropdownMessageArea:SetValue( AJM.db.messageArea ) @@ -780,22 +782,22 @@ function AJM:SettingsRefresh() -- Quest completion options. AJM.settingsControlCompletion.checkBoxEnableAutoQuestCompletion:SetValue( AJM.db.enableAutoQuestCompletion ) AJM.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetValue( AJM.db.noChoiceAllDoNothing ) - AJM.settingsControlCompletion.checkBoxNoChoiceSlaveCompleteQuestWithMaster:SetValue( AJM.db.noChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetValue( AJM.db.noChoiceSlaveCompleteQuestWithMaster ) AJM.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest:SetValue( AJM.db.noChoiceAllAutoCompleteQuest ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveDoNothing:SetValue( AJM.db.hasChoiceSlaveDoNothing ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveCompleteQuestWithMaster:SetValue( AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveChooseSameRewardAsMaster:SetValue( AJM.db.hasChoiceSlaveChooseSameRewardAsMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveMustChooseOwnReward:SetValue( AJM.db.hasChoiceSlaveMustChooseOwnReward ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetValue( AJM.db.hasChoiceSlaveDoNothing ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetValue( AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetValue( AJM.db.hasChoiceSlaveChooseSameRewardAsMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetValue( AJM.db.hasChoiceSlaveMustChooseOwnReward ) -- Ebony Fix or remove, -- AJM.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter:SetValue( AJM.db.hasChoiceAquireBestQuestRewardForCharacter ) -- AJM.settingsControlCompletion.checkBoxActuallyGetTheBestReward:SetValue( AJM.db.hasChoiceAquireBestQuestRewardForCharacterAndGet ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveRewardChoiceModifierConditional:SetValue( AJM.db.hasChoiceSlaveRewardChoiceModifierConditional ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetValue( AJM.db.hasChoiceSlaveRewardChoiceModifierConditional ) AJM.settingsControlCompletion.checkBoxHasChoiceCtrlKeyModifier:SetValue( AJM.db.hasChoiceCtrlKeyModifier ) AJM.settingsControlCompletion.checkBoxHasChoiceShiftKeyModifier:SetValue( AJM.db.hasChoiceShiftKeyModifier ) AJM.settingsControlCompletion.checkBoxHasChoiceAltKeyModifier:SetValue( AJM.db.hasChoiceAltKeyModifier ) - AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseSlaveRewardSelected:SetValue( AJM.db.hasChoiceOverrideUseSlaveRewardSelected ) + AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected:SetValue( AJM.db.hasChoiceOverrideUseSlaveRewardSelected ) -- Ensure correct state (general and acceptance options). - AJM.settingsControl.checkBoxSlaveMirrorMasterAccept:SetDisabled( not AJM.db.acceptQuests ) + AJM.settingsControl.checkBoxMinionMirrorMasterAccept:SetDisabled( not AJM.db.acceptQuests ) AJM.settingsControl.checkBoxDoNotAutoAccept:SetDisabled( not AJM.db.acceptQuests ) AJM.settingsControl.checkBoxAllAcceptAnyQuest:SetDisabled( not AJM.db.acceptQuests ) AJM.settingsControl.checkBoxOnlyAcceptQuestsFrom:SetDisabled( not AJM.db.acceptQuests ) @@ -809,21 +811,21 @@ function AJM:SettingsRefresh() AJM.settingsControlCompletion.labelQuestNoRewardsOrOneReward:SetDisabled( not AJM.db.enableAutoQuestCompletion ) AJM.settingsControlCompletion.labelQuestHasMoreThanOneReward:SetDisabled( not AJM.db.enableAutoQuestCompletion ) AJM.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetDisabled( not AJM.db.enableAutoQuestCompletion ) - AJM.settingsControlCompletion.checkBoxNoChoiceSlaveCompleteQuestWithMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion ) + AJM.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion ) AJM.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest:SetDisabled( not AJM.db.enableAutoQuestCompletion ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveDoNothing:SetDisabled( not AJM.db.enableAutoQuestCompletion ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetDisabled( not AJM.db.enableAutoQuestCompletion ) -- AJM.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter:SetDisabled( not AJM.db.enableAutoQuestCompletion ) -- AJM.settingsControlCompletion.checkBoxActuallyGetTheBestReward:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceAquireBestQuestRewardForCharacter ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveCompleteQuestWithMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveChooseSameRewardAsMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveMustChooseOwnReward:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) - AJM.settingsControlCompletion.checkBoxHasChoiceSlaveRewardChoiceModifierConditional:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) - AJM.settingsControlCompletion.labelHasChoiceSlaveRewardChoiceModifierConditional:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.labelHasChoiceMinionRewardChoiceModifierConditional:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) AJM.settingsControlCompletion.checkBoxHasChoiceCtrlKeyModifier:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster or not AJM.db.hasChoiceSlaveRewardChoiceModifierConditional ) AJM.settingsControlCompletion.checkBoxHasChoiceShiftKeyModifier:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster or not AJM.db.hasChoiceSlaveRewardChoiceModifierConditional ) AJM.settingsControlCompletion.checkBoxHasChoiceAltKeyModifier:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster or not AJM.db.hasChoiceSlaveRewardChoiceModifierConditional ) - AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseSlaveRewardSelected:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) - AJM.settingsControlCompletion.labelHasChoiceOverrideUseSlaveRewardSelected:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) + AJM.settingsControlCompletion.labelHasChoiceOverrideUseMinionRewardSelected:SetDisabled( not AJM.db.enableAutoQuestCompletion or not AJM.db.hasChoiceSlaveCompleteQuestWithMaster ) end function AJM:SettingsPushSettingsClick( event ) @@ -847,7 +849,7 @@ function AJM:SettingsToggleAcceptQuests( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleSlaveMirrorMasterAccept( event, checked ) +function AJM:SettingsToggleMinionMirrorMasterAccept( event, checked ) AJM.db.slaveMirrorMasterAccept = checked AJM:SettingsRefresh() end @@ -913,7 +915,7 @@ function AJM:SettingsToggleMasterAutoShareQuestOnAccept( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleSlaveAutoAcceptEscortQuest( event, checked ) +function AJM:SettingsToggleMinionAutoAcceptEscortQuest( event, checked ) AJM.db.slaveAutoAcceptEscortQuest = checked AJM:SettingsRefresh() end @@ -935,7 +937,7 @@ function AJM:SettingsToggleNoChoiceAllDoNothing( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleNoChoiceSlaveCompleteQuestWithMaster( event, checked ) +function AJM:SettingsToggleNoChoiceMinionCompleteQuestWithMaster( event, checked ) AJM.db.noChoiceSlaveCompleteQuestWithMaster = checked AJM.db.noChoiceAllDoNothing = not checked AJM.db.noChoiceAllAutoCompleteQuest = not checked @@ -949,14 +951,14 @@ function AJM:SettingsToggleNoChoiceAllAutoCompleteQuest( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleHasChoiceSlaveDoNothing( event, checked ) +function AJM:SettingsToggleHasChoiceMinionDoNothing( event, checked ) AJM.db.hasChoiceSlaveDoNothing = checked AJM.db.hasChoiceAquireBestQuestRewardForCharacter = not checked AJM.db.hasChoiceSlaveCompleteQuestWithMaster = not checked AJM:SettingsRefresh() end -function AJM:SettingsToggleHasChoiceSlaveCompleteQuestWithMaster( event, checked ) +function AJM:SettingsToggleHasChoiceMinionCompleteQuestWithMaster( event, checked ) AJM.db.hasChoiceSlaveCompleteQuestWithMaster = checked AJM.db.hasChoiceAquireBestQuestRewardForCharacter = not checked AJM.db.hasChoiceSlaveDoNothing = not checked @@ -975,21 +977,21 @@ end -- AJM:SettingsRefresh() --end -function AJM:SettingsToggleHasChoiceSlaveChooseSameRewardAsMaster( event, checked ) +function AJM:SettingsToggleHasChoiceMinionChooseSameRewardAsMaster( event, checked ) AJM.db.hasChoiceSlaveChooseSameRewardAsMaster = checked AJM.db.hasChoiceSlaveMustChooseOwnReward = not checked AJM.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked AJM:SettingsRefresh() end -function AJM:SettingsToggleHasChoiceSlaveMustChooseOwnReward( event, checked ) +function AJM:SettingsToggleHasChoiceMinionMustChooseOwnReward( event, checked ) AJM.db.hasChoiceSlaveMustChooseOwnReward = checked AJM.db.hasChoiceSlaveChooseSameRewardAsMaster = not checked AJM.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked AJM:SettingsRefresh() end -function AJM:SettingsToggleHasChoiceSlaveRewardChoiceModifierConditional( event, checked ) +function AJM:SettingsToggleHasChoiceMinionRewardChoiceModifierConditional( event, checked ) AJM.db.hasChoiceSlaveRewardChoiceModifierConditional = checked AJM.db.hasChoiceSlaveChooseSameRewardAsMaster = not checked AJM.db.hasChoiceSlaveMustChooseOwnReward = not checked @@ -1011,7 +1013,7 @@ function AJM:SettingsToggleHasChoiceAltKeyModifier( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleHasChoiceOverrideUseSlaveRewardSelected( event, checked ) +function AJM:SettingsToggleHasChoiceOverrideUseMinionRewardSelected( event, checked ) AJM.db.hasChoiceOverrideUseSlaveRewardSelected = checked AJM:SettingsRefresh() end @@ -1300,9 +1302,8 @@ function AJM:DoShowQuestComplete( sender, questName ) local questIndex = AJM:GetQuestLogIndexByName( questName ) if questIndex ~= 0 then ShowQuestComplete( questIndex ) - --fixed this (this seems to be thenew code) - -- WatchFrameAutoQuest_ClearPopUpByLogIndex( questIndex ) - AutoQuestPopupTracker_RemovePopUp ( questIndex ) + --TODO fix this or remove + --WatchFrameAutoQuest_ClearPopUpByLogIndex( questIndex ) end AJM.isInternalCommand = false end @@ -1312,9 +1313,9 @@ end ------------------------------------------------------------------------------------------------------------- function AJM:CheckForOverrideAndChooseQuestReward( questIndex ) - -- Yes, override if slave has reward selected? + -- Yes, override if minion has reward selected? if (AJM.db.hasChoiceOverrideUseSlaveRewardSelected == true) and (QuestInfoFrame.itemChoice > 0) then - -- Yes, choose slaves reward. + -- Yes, choose minions reward. GetQuestReward( QuestInfoFrame.itemChoice ) else -- No, choose masters reward. @@ -1323,10 +1324,10 @@ function AJM:CheckForOverrideAndChooseQuestReward( questIndex ) end function AJM:CheckForOverrideAndDoNotChooseQuestReward( questIndex ) - -- Yes, override if slave has reward selected? + -- Yes, override if minion has reward selected? if QuestInfoFrame.itemChoice ~= nil then if (AJM.db.hasChoiceOverrideUseSlaveRewardSelected == true) and (QuestInfoFrame.itemChoice > 0) then - -- Yes, choose slaves reward. + -- Yes, choose minions reward. GetQuestReward( QuestInfoFrame.itemChoice ) end end @@ -1387,7 +1388,7 @@ function AJM:DoChooseQuestReward( sender, questIndex, modifierKeysPressed, rewar end if (AJM.db.hasChoiceAquireBestQuestRewardForCharacter == true) and (rewardPickedAlready == true) then if QuestInfoFrame.itemChoice > 0 then - -- Yes, choose slaves reward. + -- Yes, choose minions reward. GetQuestReward( QuestInfoFrame.itemChoice ) end end @@ -1398,6 +1399,7 @@ function AJM:DoChooseQuestReward( sender, questIndex, modifierKeysPressed, rewar end --TODO FIX or Remove! +--[[ function AJM:GetBestRewardIndexForCharacter() -- Originally provided by loop: http://www.dual-boxing.com/showpost.php?p=257610&postcount=1505 -- New version provided by Mischanix via jamba.uservoice.com. @@ -1473,7 +1475,7 @@ function AJM:GetBestRewardIndexForCharacter() } local _, class = UnitClass("player") -- Original canWear - here for documentation purposes - Jafula. - --[[ + END local canWear = { DEATHKNIGHT = {"Cloth", "Leather", "Mail", "Plate", "Axe", "Mace", "Polearm", "Sword"}, DRUID = {"Cloth", "Leather", "Dagger", "Fist Weapon", "Mace", "Polearm", "Staff"}, @@ -1486,7 +1488,7 @@ function AJM:GetBestRewardIndexForCharacter() WARLOCK = {"Cloth", "Dagger", "Staff", "Sword", "Wand"}, WARRIOR = {"Cloth", "Leather", "Mail", "Plate", "Axe", "Dagger", "Fist Weapon", "Mace", "Polearm", "Staff", "Sword", "Bow", "Crossbow", "Gun", "Thrown"} } - ]]-- + END -- Removed lower tier armour from canWear table (i.e. DKs, Paladins, Warriers can only wear Plate). -- I personally would not pick up a lower tiered piece for my toons. Jafula. local canWear = { @@ -1605,6 +1607,7 @@ function AJM:GetBestRewardIndexForCharacter() end return bestQuestItemIndex end +]]-- ------------------------------------------------------------------------------------------------------------- -- NPC QUEST PROCESSING - ACCEPTING @@ -1616,7 +1619,8 @@ function AJM:QUEST_ACCEPTED( ... ) if AJM.db.masterAutoShareQuestOnAccept == true then if JambaApi.IsCharacterTheMaster( AJM.characterName ) == true then if AJM.isInternalCommand == false then - AJM:JambaSendMessageToTeam( AJM.db.messageArea, "Attempting to auto share newly accepted quest.", false ) + -- Remove some spam, + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, "Attempting to auto share newly accepted quest.", false ) SelectQuestLogEntry( questIndex ) if AJM:IsCurrentlySelectedQuestValid() == true then if GetQuestLogPushable() and GetNumSubgroupMembers() > 0 then @@ -1632,38 +1636,38 @@ end function AJM:AcceptQuest() if AJM.db.acceptQuests == true then - if AJM.db.slaveMirrorMasterAccept == true then + if AJM.db.slaveMirrorMasterAccept == true then if AJM.isInternalCommand == false then - AJM:DebugMessage( "AcceptQuest" ) + AJM:DebugMessage( "AcceptQuest" ) AJM:JambaSendCommandToTeam( AJM.COMMAND_ACCEPT_QUEST ) end end - end + end end ---ebony function AJM:DoAcceptQuest( sender ) - if AJM.db.acceptQuests == true and AJM.db.slaveMirrorMasterAccept == true and QuestFrame:IsVisible() then + if AJM.db.acceptQuests == true and AJM.db.slaveMirrorMasterAccept == true then local questIndex = AJM:GetQuestLogIndexByName( questName ) - AJM.isInternalCommand = true - AJM:DebugMessage( "DoAcceptQuest" ) - AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Accepted Quest: A"]( GetTitleText() ), false ) - AcceptQuest() - HideUIPanel( QuestFrame ) - --ebony - --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Accepted Quest: A"]( GetTitleText() ), false ) - AJM.isInternalCommand = false + --Olny works if the quest frame is open. Stops sending a blank quest. + if QuestFrame:IsShown() == true then + AJM.isInternalCommand = true + AJM:DebugMessage( "DoAcceptQuest" ) + AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Accepted Quest: A"]( GetTitleText() ), false ) + AcceptQuest() + HideUIPanel( QuestFrame ) + AJM.isInternalCommand = false + end end end - +-- Auto quest magic! function AJM:AcknowledgeAutoAcceptQuest() if AJM.db.acceptQuests == true then - if AJM.db.slaveMirrorMasterAccept == true then + if AJM.db.slaveMirrorMasterAccept == true then if AJM.isInternalCommand == false then - AJM:DebugMessage( "MagicAutoAcceptQuestGrrrr" ) - AJM:JambaSendCommandToTeam( AJM.COMMAND_ACCEPT_QUEST_FAKE ) - end + AJM:DebugMessage( "MagicAutoAcceptQuestGrrrr", QuestGetAutoAccept() ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_ACCEPT_QUEST_FAKE ) + end end end end @@ -1684,13 +1688,14 @@ end -- QUEST PROCESSING - AUTO ACCEPTING ------------------------------------------------------------------------------------------------------------- +--TODO: this could do with some work with Friends. function AJM:CanAutoAcceptSharedQuestFromPlayer() local canAccept = false if AJM.db.allAcceptAnyQuest == true then canAccept = true elseif AJM.db.onlyAcceptQuestsFrom == true then local questSourceName, questSourceRealm = UnitName( "npc" ) - + local character = JambaUtilities:AddRealmToNameIfNotNil( questSourceName, questSourceRealm ) if AJM.db.acceptFromTeam == true then if JambaApi.IsCharacterInTeam( character ) == true then canAccept = true @@ -1699,7 +1704,7 @@ function AJM:CanAutoAcceptSharedQuestFromPlayer() if AJM.db.acceptFromFriends == true then for friendIndex = 1, GetNumFriends() do local friendName = GetFriendInfo( friendIndex ) - if character == friendName then + if questSourceName == friendName then canAccept = true break end @@ -1707,6 +1712,7 @@ function AJM:CanAutoAcceptSharedQuestFromPlayer() end if AJM.db.acceptFromParty == true then if UnitInParty( "npc" ) then + AJM:DebugMessage( "test" ) canAccept = true end end @@ -1724,37 +1730,41 @@ function AJM:CanAutoAcceptSharedQuestFromPlayer() return canAccept end ---ebony wip function AJM:QUEST_DETAIL() AJM:DebugMessage( "QUEST_DETAIL" ) if AJM.db.acceptQuests == true then - -- Who is this quest from. + -- Who is this quest from. if UnitIsPlayer( "npc" ) then -- Quest is shared from a player. if AJM:CanAutoAcceptSharedQuestFromPlayer() == true then - AJM.isInternalCommand = true - AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Automatically Accepted Quest: A"]( GetTitleText() ), false ) - AcceptQuest() - HideUIPanel( QuestFrame ) - --ebony see under. - AJM.isInternalCommand = false + --TODO: is this even needed??? Can auto quests be shared from other players?? unsure so we add it in anyway. + if ( QuestFrame.autoQuest ) then + AcknowledgeAutoAcceptQuest() + else + AJM.isInternalCommand = true + AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Automatically Accepted Quest: A"]( GetTitleText() ), false ) + AcceptQuest() + AJM.isInternalCommand = false + end end else -- Quest is from an NPC. if (AJM.db.allAcceptAnyQuest == true) or ((AJM.db.onlyAcceptQuestsFrom == true) and (AJM.db.acceptFromNpc == true)) then - AJM.isInternalCommand = true - AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Automatically Accepted Quest: A"]( GetTitleText() ), false ) - AcceptQuest() - HideUIPanel( QuestFrame ) - -- AJM:DebugMessage( "QUEST_DETAIL - auto accept is: ", QuestGetAutoAccept() ) - --ebony questNameGetTitleText - --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Automatically Accepted Quest: A"]( GetTitleText() ), false ) - AJM.isInternalCommand = false + --AutoQuest is Accepted no need to accept it again. + if ( QuestFrame.autoQuest ) then + AcknowledgeAutoAcceptQuest() + else + AJM.isInternalCommand = true + --AJM:DebugMessage( "QUEST_DETAIL - auto accept is: ", QuestGetAutoAccept() ) + AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Automatically Accepted Quest: A"]( GetTitleText() ), false ) + AcceptQuest() + HideUIPanel( QuestFrame ) + AJM.isInternalCommand = false + end end end end end - ------------------------------------------------------------------------------------------------------------- -- ESCORT QUEST ------------------------------------------------------------------------------------------------------------- @@ -1778,7 +1788,7 @@ end function AJM.JambaQuestSelectButtonClicked() if AJM:IsCurrentlySelectedQuestValid() == true then - AJM:JambaSendCommandToTeam( AJM.COMMAND_SELECT_QUEST_LOG_ENTRY, AJM.CurrentlySelectedQuest, AJM.selectedTag ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_SELECT_QUEST_LOG_ENTRY, AJM.currentlySelectedQuest, AJM.selectedTag ) else AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["You must select a quest from the quest log in order to action it on your other characters."], false ) end @@ -1808,12 +1818,12 @@ function AJM.TrackAllNextQuest() SelectQuestLogEntry( AJM.iterateQuests ) if AJM:IsCurrentlySelectedQuestValid() == true then local watch = 0 - local questIndex = AJM:GetQuestLogIndexByName( AJM.CurrentlySelectedQuest ) + local questIndex = AJM:GetQuestLogIndexByName( AJM.currentlySelectedQuest ) if questIndex ~= 0 then AddQuestWatch( questIndex ) watch = 1 end - AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.CurrentlySelectedQuest, watch, AJM.selectedTag ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.currentlySelectedQuest, watch, AJM.selectedTag ) end end end @@ -1837,12 +1847,12 @@ function AJM.TrackNoneNextQuest() SelectQuestLogEntry( AJM.iterateQuests ) if AJM:IsCurrentlySelectedQuestValid() == true then local watch = 0 - local questIndex = AJM:GetQuestLogIndexByName( AJM.CurrentlySelectedQuest ) + local questIndex = AJM:GetQuestLogIndexByName( AJM.currentlySelectedQuest ) if questIndex ~= 0 then RemoveQuestWatch( questIndex ) watch = 0 end - AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.CurrentlySelectedQuest, watch, AJM.selectedTag ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.currentlySelectedQuest, watch, AJM.selectedTag ) end end end @@ -1855,7 +1865,7 @@ end function AJM.JambaQuestTrackToggleButtonClicked() if AJM:IsCurrentlySelectedQuestValid() == true then local watch = 0 - local questIndex = AJM:GetQuestLogIndexByName( AJM.CurrentlySelectedQuest ) + local questIndex = AJM:GetQuestLogIndexByName( AJM.currentlySelectedQuest ) if questIndex ~= 0 then if IsQuestWatched( questIndex ) then RemoveQuestWatch( questIndex ) @@ -1865,7 +1875,7 @@ function AJM.JambaQuestTrackToggleButtonClicked() watch = 1 end end - AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.CurrentlySelectedQuest, watch, AJM.selectedTag ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.currentlySelectedQuest, watch, AJM.selectedTag ) else AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["You must select a quest from the quest log in order to action it on your other characters."], false ) end @@ -1885,7 +1895,7 @@ function AJM.TrackToggleNextQuest() SelectQuestLogEntry( AJM.iterateQuests ) if AJM:IsCurrentlySelectedQuestValid() == true then local watch = 0 - local questIndex = AJM:GetQuestLogIndexByName( AJM.CurrentlySelectedQuest ) + local questIndex = AJM:GetQuestLogIndexByName( AJM.currentlySelectedQuest ) if questIndex ~= 0 then if IsQuestWatched( questIndex ) then RemoveQuestWatch( questIndex ) @@ -1895,7 +1905,7 @@ function AJM.TrackToggleNextQuest() watch = 1 end end - AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.CurrentlySelectedQuest, watch, AJM.selectedTag ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_TRACK, AJM.currentlySelectedQuest, watch, AJM.selectedTag ) end end end @@ -1927,8 +1937,9 @@ end function AJM.AbandonNextQuest() local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( AJM.iterateQuests ) - if isHeader == nil then + if isHeader == false then if title ~= nil then + AJM:DebugMessage ( "AbandonQuest" ) SelectQuestLogEntry( AJM.iterateQuests ) SetAbandonQuest() AbandonQuest() @@ -1954,7 +1965,6 @@ function AJM.JambaQuestShareAllButtonClicked() end end ---ebony function AJM.PushNextQuest() local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( AJM.iterateQuests ) if isHeader == nil then @@ -2020,14 +2030,14 @@ function AJM:CreateJambaQuestLogFrame() local buttonWidthTag = 120 local buttonWidthToggle = 140 local buttonTop = -10 - --local buttonTopSecondRow = buttonTop - buttonHeight - 2 +-- local buttonTopSecondRow = buttonTop - buttonHeight - 2 local left = 8 local spacing = 1 - -- Tags should this get removed at some point? + -- Tags local dropDownTag = AceGUI:Create( "Dropdown" ) dropDownTag.frame:SetParent( frame ) dropDownTag:SetLabel( "" ) - dropDownTag:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, -10 ) + dropDownTag:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, -5 ) dropDownTag:SetWidth( buttonWidthTag ) dropDownTag:SetList( JambaApi.AllTagsList() ) dropDownTag:SetCallback( "OnValueChanged", AJM.JambaQuestTagDropDownOnClick ) @@ -2045,7 +2055,6 @@ function AJM:CreateJambaQuestLogFrame() selectButton:SetWidth( buttonWidth ) selectButton:SetText( L["Select"] ) left = left + buttonWidth + spacing - --left = left + 70 -- Share / Share All. local shareButton = CreateFrame( "Button", frameName.."ButtonShare", frame, "UIPanelButtonTemplate" ) shareButton:SetScript( "OnClick", AJM.JambaQuestShareButtonClicked ) @@ -2063,41 +2072,41 @@ function AJM:CreateJambaQuestLogFrame() shareAllButton:SetText( L["Share All"] ) left = left + buttonWidth + spacing -- Track / Track All. - --local trackButtonToggle = CreateFrame( "Button", frameName.."ButtonToggleTrack", frame, "UIPanelButtonTemplate" ) - --trackButtonToggle:SetScript( "OnClick", AJM.JambaQuestTrackToggleButtonClicked ) - --trackButtonToggle:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) - --trackButtonToggle:SetHeight( buttonHeight ) - --trackButtonToggle:SetWidth( buttonWidthToggle ) - --trackButtonToggle:SetText( L["Toggle Track"] ) - --local trackAllButtonToggle = CreateFrame( "Button", frameName.."ButtonToggleTrackAll", frame, "UIPanelButtonTemplate" ) - --trackAllButtonToggle:SetScript( "OnClick", AJM.JambaQuestTrackToggleAllButtonClicked ) - --trackAllButtonToggle:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTopSecondRow ) - --trackAllButtonToggle:SetHeight( buttonHeight ) - --trackAllButtonToggle:SetWidth( buttonWidthToggle ) - --trackAllButtonToggle:SetText( L["Toggle Track All"] ) - --left = left + buttonWidthToggle + spacing - --local trackButton = CreateFrame( "Button", frameName.."ButtonTrackAll", frame, "UIPanelButtonTemplate" ) - --trackButton:SetScript( "OnClick", AJM.JambaQuestTrackAllButtonClicked ) - --trackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) - --trackButton:SetHeight( buttonHeight ) - --trackButton:SetWidth( buttonWidth ) - --trackButton:SetText( L["Track All"] ) - --local trackNoneButton = CreateFrame( "Button", frameName.."ButtonTrackNone", frame, "UIPanelButtonTemplate" ) - --trackNoneButton:SetScript( "OnClick", AJM.JambaQuestTrackNoneButtonClicked ) - --trackNoneButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTopSecondRow ) - --trackNoneButton:SetHeight( buttonHeight ) - --trackNoneButton:SetWidth( buttonWidth ) - --trackNoneButton:SetText( L["Track None"] ) - --left = left + buttonWidth + spacing - --left = left + 70 - -- Abandon / Abandon All. +-- local trackButtonToggle = CreateFrame( "Button", frameName.."ButtonToggleTrack", frame, "UIPanelButtonTemplate" ) +-- trackButtonToggle:SetScript( "OnClick", AJM.JambaQuestTrackToggleButtonClicked ) +-- trackButtonToggle:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) +-- trackButtonToggle:SetHeight( buttonHeight ) +-- trackButtonToggle:SetWidth( buttonWidthToggle ) +-- trackButtonToggle:SetText( L["Toggle Track"] ) +-- local trackAllButtonToggle = CreateFrame( "Button", frameName.."ButtonToggleTrackAll", frame, "UIPanelButtonTemplate" ) +-- trackAllButtonToggle:SetScript( "OnClick", AJM.JambaQuestTrackToggleAllButtonClicked ) +-- trackAllButtonToggle:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTopSecondRow ) +-- trackAllButtonToggle:SetHeight( buttonHeight ) +-- trackAllButtonToggle:SetWidth( buttonWidthToggle ) +-- trackAllButtonToggle:SetText( L["Toggle Track All"] ) +-- left = left + buttonWidthToggle + spacing +-- local trackButton = CreateFrame( "Button", frameName.."ButtonTrackAll", frame, "UIPanelButtonTemplate" ) +-- trackButton:SetScript( "OnClick", AJM.JambaQuestTrackAllButtonClicked ) +-- trackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) +-- trackButton:SetHeight( buttonHeight ) +-- trackButton:SetWidth( buttonWidth ) +-- trackButton:SetText( L["Track All"] ) +-- local trackNoneButton = CreateFrame( "Button", frameName.."ButtonTrackNone", frame, "UIPanelButtonTemplate" ) +-- trackNoneButton:SetScript( "OnClick", AJM.JambaQuestTrackNoneButtonClicked ) +-- trackNoneButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTopSecondRow ) +-- trackNoneButton:SetHeight( buttonHeight ) +-- trackNoneButton:SetWidth( buttonWidth ) +-- trackNoneButton:SetText( L["Track None"] ) +-- left = left + buttonWidth + spacing +-- left = left + 70 +-- -- Abandon / Abandon All. local abandonButton = CreateFrame( "Button", frameName.."ButtonAbandon", frame, "UIPanelButtonTemplate" ) abandonButton:SetScript( "OnClick", AJM.JambaQuestAbandonButtonClicked ) abandonButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) abandonButton:SetHeight( buttonHeight ) abandonButton:SetWidth( buttonWidth ) - abandonButton:SetText( L["Abandon"] ) - left = left + buttonWidth + spacing + abandonButton:SetText( L["Abandon"] ) + left = left + buttonWidth + spacing local abandonAllButton = CreateFrame( "Button", frameName.."ButtonAbandonAll", frame, "UIPanelButtonTemplate" ) abandonAllButton:SetScript( "OnClick", AJM.JambaQuestAbandonAllButtonClicked ) abandonAllButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", left, buttonTop ) @@ -2135,37 +2144,35 @@ function AJM:CreateJambaQuestLogFrame() } end ---ebony wip -function AJM:ToggleFrame ( frame ) +function AJM:ToggleFrame( frame ) --AJM:Print( "in toggle frame", frame ) if frame == WorldMapFrame then + --if frame == QuestLogFrame then + --ToggleQuestLog = function() if AJM.db.showJambaQuestLogWithWoWQuestLog == true then - --AJM:Print("check qmfiv:", WorldMapFrame:IsVisible() ) + --AJM:Print("check qmfiv:", WorldMapFrame:IsVisible() ) --if WorldMapFrame:IsVisible() then -ebs and QuestLogDetailScrollFrame:IsVisible if WorldMapFrame:IsVisible() and QuestMapFrame:IsVisible() then - AJM:ToggleShowQuestCommandWindow( true ) + AJM:ToggleShowQuestCommandWindow( true ) else AJM:ToggleShowQuestCommandWindow( false ) end end end end ---ebony - ---function AJM:ToggleQuestLog ( frame ) --- AJM:Print( "in toggle frame", frame ) --- if frame == ToggleQuestLog then --- if AJM.db.showJambaQuestLogWithWoWQuestLog == true then --- --AJM:Print("check qmfiv:", WorldMapFrame:IsVisible() ) --- --if WorldMapFrame:IsVisible() then -ebs and QuestLogDetailScrollFrame:IsVisible --- if WorldMapFrame:IsVisible() and QuestMapFrame:IsVisible() then --- AJM:ToggleShowQuestCommandWindow( true ) --- else --- AJM:ToggleShowQuestCommandWindow( false ) --- end --- end --- end ---end + +-- This sorts out hooking on L or marcioMenu button +function AJM:ToggleQuestLog() + if AJM.db.showJambaQuestLogWithWoWQuestLog == true then + --AJM:Print("check qmfiv:", WorldMapFrame:IsVisible() ) + if WorldMapFrame:IsVisible() and QuestMapFrame:IsVisible() then + AJM:ToggleShowQuestCommandWindow( true ) + else + AJM:ToggleShowQuestCommandWindow( false ) + end + end +end + function AJM:QuestLogFrameHide() if AJM.db.showJambaQuestLogWithWoWQuestLog == true then @@ -2180,19 +2187,18 @@ function AJM:ToggleShowQuestCommandWindow( show ) JambaQuestLogWindowFrame:Hide() end end ---ebony-wip + function AJM:UpdateQuestLog( questIndex ) if WorldMapFrame:IsVisible() and QuestMapFrame:IsVisible() then if questIndex then - SelectQuestLogEntry( questIndex ) -- QuestLog_SetSelection( questIndex ) -- Removed by blizzard in 6.0.2 changed to SelectQuestLogEntry + SelectQuestLogEntry( questIndex ) end - end - if QuestScrollFrameScrollBar:IsVisible() then + if QuestScrollFrameScrollBar:IsVisible() then QuestMapFrame_UpdateQuestDetailsButtons() + end end - -- is this needed ebony???? truns back nothing? Don't think was needed?? was renamed in 6.0 to ObjectiveTrackerFrame - if ObjectiveTrackerFrame:IsVisible() then + if ObjectiveTrackerFrame:IsVisible() then -- TrackerFrame_Update() QuestObjectiveTracker_UpdatePOIs() end @@ -2212,21 +2218,16 @@ end function AJM:SelectQuestLogEntry( questIndex ) AJM.currentlySelectedQuest = L["(No Quest Selected)"] - --AJM.SelectQuestLogEntry = L["(No Quest Selected)"] - --if questIndex ~= nil then if questIndex ~= nil then local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) if not isHeader then if title then AJM.currentlySelectedQuest = title - -- SelectQuestLogEntry = title if JambaQuestLogWindowFrame:IsVisible() then if GetQuestLogPushable() and GetNumSubgroupMembers() > 0 then AJM.jambaQuestLogFrameShareButton:Enable() - --AJM.jambaQuestLogFrameShareButton:Enable() else AJM.jambaQuestLogFrameShareButton:Disable() - --AJM.jambaQuestLogFrameShareButton:Disable() end end end @@ -2234,8 +2235,6 @@ function AJM:SelectQuestLogEntry( questIndex ) end end ---ebonytest SelectQuestLogEntry - function AJM:IsCurrentlySelectedQuestValid() if AJM.currentlySelectedQuest:trim() ~= "" and AJM.currentlySelectedQuest ~= L["(No Quest Selected)"] then return true @@ -2287,17 +2286,16 @@ function AJM:DoAbandonQuest( sender, questName, tag ) end function AJM:DoAbandonAllQuests( sender, tag ) - if JambaApi.DoesCharacterHaveTag( AJM.characterName, tag ) == true then + --if JambaApi.DoesCharacterHaveTag( AJM.characterName, tag ) == true then AJM.iterateQuests = 1 if AJM.iterateQuests <= GetNumQuestLogEntries() then AJM:ScheduleTimer( "AbandonNextQuest", 1 ) end - end + --end end function AJM:AutoSelectToggleCommand( info, parameters ) - --xx - local toggle, tag = strsplit ( " ", parameters ) + local toggle, tag = strsplit( " ", parameters ) if tag ~= nil and tag:trim() ~= "" then AJM:JambaSendCommandToTeam( AJM.COMMAND_TOGGLE_AUTO_SELECT, toggle, tag ) else diff --git a/Jamba-Quest/Locales/JambaQuest-Locale-enUS.lua b/Jamba-Quest/Locales/JambaQuest-Locale-enUS.lua index 0290505..7b1791a 100644 --- a/Jamba-Quest/Locales/JambaQuest-Locale-enUS.lua +++ b/Jamba-Quest/Locales/JambaQuest-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -53,21 +53,18 @@ L["Shift"] = true L["Alt"] = true L["Override: If Toon Already Has Reward Selected,"] = true L["Choose That Reward"] = true ---L["Accepted Quest: A"] = function( questName ) --- return string.format( "Accepted Quest: %s", questName ) ---end L["Accepted Quest: A"] = function( questName ) return string.format( "Accepted Quest: %s", questName ) end L["Automatically Accepted Quest: A"] = function( questName ) return string.format( "Automatically Accepted Quest: %s", questName ) end +L["Automatically Accepted Quest: A"] = function( questName ) + return string.format( "Automatically Accepted Quest: %s", questName ) +end L["Automatically Accepted AutoPickupQuest: A"] = function( questName ) return string.format( "Automatically Accepted AutoPickupQuest: %s", questName ) end ---L["Automatically Accepted Quest: A"] = function( questName ) --- return string.format( "Automatically Accepted Quest: %s", questName ) ---end L["Quest has X reward choices."] = function( choices ) return string.format( "Quest has %s reward choices.", choices ) end diff --git a/Jamba-Quest/Locales/Locales.xml b/Jamba-Quest/Locales/Locales.xml index 3518c64..2dc985f 100644 --- a/Jamba-Quest/Locales/Locales.xml +++ b/Jamba-Quest/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Quest/Overrides.lua b/Jamba-Quest/Overrides.lua deleted file mode 100644 index c22e26e..0000000 --- a/Jamba-Quest/Overrides.lua +++ /dev/null @@ -1,6 +0,0 @@ - -UIPanelWindows["QuestLogFrame"] = { area = "doublewide", pushable = 0, whileDead = 1 } - -ToggleQuestLog = function() - ToggleFrame(WorldMapFrame) -end diff --git a/Jamba-QuestWatcher/Jamba-QuestWatcher.toc b/Jamba-QuestWatcher/Jamba-QuestWatcher.toc index c3a4985..403d267 100644 --- a/Jamba-QuestWatcher/Jamba-QuestWatcher.toc +++ b/Jamba-QuestWatcher/Jamba-QuestWatcher.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-QuestWatcher -## Notes: Jamba-QuestWatcher +## Interface: 60200 +## Title: JambaQuestWatcher +## Notes: JambaQuestWatcher ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-QuestWatcher/JambaQuestWatcher.lua b/Jamba-QuestWatcher/JambaQuestWatcher.lua index 914068a..4c997cc 100644 --- a/Jamba-QuestWatcher/JambaQuestWatcher.lua +++ b/Jamba-QuestWatcher/JambaQuestWatcher.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -51,7 +51,7 @@ AJM.settings = { watchFrameBorderColourA = 0.0, watcherListLines = 20, watcherFrameWidth = 300, - unlockWatcherFrame = false, + unlockWatcherFrame = true, hideBlizzardWatchFrame = true, doNotHideCompletedObjectives = true, showCompletedObjectivesAsDone = true, @@ -153,8 +153,12 @@ function AJM:OnEnable() AJM:RegisterEvent( "PLAYER_REGEN_ENABLED" ) AJM:RegisterEvent( "PLAYER_REGEN_DISABLED" ) AJM:RegisterEvent( "QUEST_WATCH_UPDATE" ) + AJM:RegisterEvent( "QUEST_LOG_UPDATE") AJM:RegisterEvent( "QUEST_WATCH_LIST_CHANGED", "QUEST_WATCH_UPDATE" ) - -- For in the field auto quests. + -- For in the field auto quests. And Bonus Quests. + AJM:RegisterEvent("QUEST_ACCEPTED", "QUEST_WATCH_UPDATE") + AJM:RegisterEvent("QUEST_REMOVED", "RemoveQuestsNotBeingWatched") + --AJM:RegisterEvent("UNIT_QUEST_LOG_CHANGED", "JambaQuestWatchListUpdateButtonClicked") AJM:RegisterEvent( "QUEST_AUTOCOMPLETE" ) AJM:RegisterEvent( "QUEST_COMPLETE" ) AJM:RegisterEvent( "QUEST_DETAIL" ) @@ -640,6 +644,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:UpdateHideBlizzardWatchFrame() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -903,6 +909,7 @@ function AJM:AbandonQuest() AJM:ScheduleTimer( "AbandonQuestDelayed", 1 ) end + function AJM:QUEST_WATCH_UPDATE( event, ... ) if AJM.db.enableQuestWatcher == true then -- Wait a bit for the correct information to come through from the server... @@ -910,6 +917,14 @@ function AJM:QUEST_WATCH_UPDATE( event, ... ) end end + +function AJM:QUEST_LOG_UPDATE( event, ... ) + if AJM.db.enableQuestWatcher == true then + -- Wait a bit for the correct information to come through from the server... + AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, true ) + end +end + function AJM:PLAYER_REGEN_ENABLED( event, ... ) if AJM.db.enableQuestWatcher == false then return @@ -946,6 +961,7 @@ function AJM:DoQuestWatchListUpdate( characterName ) AJM:JambaQuestWatcherUpdate( false ) end + function AJM:GetQuestObjectiveCompletion( text ) if text == nil then return L["N/A"], L["N/A"] @@ -1101,23 +1117,32 @@ end ------------------------------------------------------------------------------------------------------------- -- QUEST WATCH COMMUNICATION ------------------------------------------------------------------------------------------------------------- +--Ebony test function AJM:JambaQuestWatcherUpdate( useCache ) if AJM.db.enableQuestWatcher == false then return end AJM:DebugMessage( "Sending quest watch information...") + -- old wow quests system for iterateWatchedQuests = 1, GetNumQuestWatches() do + --for iterateQuests = 1, GetNumQuestLogEntries() do local questIndex = GetQuestIndexForWatch( iterateWatchedQuests ) - AJM:DebugMessage( "GetQuestIndexForWatch: questIndex: ", questIndex ) + --local _, questIndex = GetNumQuestLogEntries() + --local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questIDD, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateWatchedQuests ) + --local questIndex = questIDD + AJM:DebugMessage( "GetQuestIndexForWatch: questIndex: ", questIndex ) if questIndex ~= nil then - local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + --local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) isComplete = AJM:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete ) local numObjectives = GetNumQuestLeaderBoards( questIndex ) - AJM:DebugMessage( "NumObjs:", numObjectives ) + --local _,_,numObjectives = GetTaskInfo( questIndex ) + AJM:DebugMessage( "NumObjs:", numObjectives ) for iterateObjectives = 1, numObjectives do local objectiveFullText, objectiveType, objectiveFinished = GetQuestLogLeaderBoard( iterateObjectives, questIndex ) - AJM:DebugMessage( "ObjInfo:", objectiveFullText, objectiveType, objectiveFinished, iterateObjectives, questIndex ) + --local objectiveFullText, objectiveType, objectiveFinished = GetQuestObjectiveInfo( iterateObjectives, questIndex ) + AJM:DebugMessage( "ObjInfo:", objectiveFullText, objectiveType, objectiveFinished, iterateObjectives, questIndex ) local amountCompleted, objectiveText = AJM:GetQuestObjectiveCompletion( objectiveFullText ) AJM:DebugMessage( "SplitObjInfo", amountCompleted, objectiveText ) if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then @@ -1130,6 +1155,55 @@ function AJM:JambaQuestWatcherUpdate( useCache ) end end end + -- New Bouns Quests! + for iterateWatchedQuests = 1, GetNumQuestLogEntries() do + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateWatchedQuests ) + --AJM:DebugMessage( "EbonyTest101:", questID) + local isInArea, isOnMap, numObjectives = GetTaskInfo(questID); + if isInArea and isOnMap then + isComplete = AJM:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete ) + --AJM:Print( "EbonyTestbounsquestID:", questID, numObjectives, isComplete ) + for iterateObjectives = 1, numObjectives do + local objectiveFullText, objectiveType, finished = GetQuestObjectiveInfo( questID, iterateObjectives, isComplete ) + --AJM:Print("BonuesQuest", objectiveFullText, objectiveType, finished ) + -- if progressbar quest that is not a quest where you kill XYZ and many things can make you do the complete the quest. + if objectiveType == "progressbar" then + --AJM:Print("hello123", ) + local objectiveText = "ProgressBar" + local progress = GetQuestProgressBarPercent( questID ) + local maxProgress = 100 + local amountCompleted = tostring(progress).."/"..(maxProgress) + --AJM:Print("BarQuesttext", amountCompleted ) + if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then + --AJM:Print("QuestPercent", title, objectiveText, amountCompleted ) + local name = tostring("Bonus:")..(title) + --send command to team + --AJM:Print("BarQuest", questID, title, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete) + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete ) + if AJM.db.sendProgressChatMessages == true then + AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false ) + end + end + + -- for other bouns quests EG one time world pop up quests that don't have a npc. + else + local amountCompleted, objectiveText = AJM:GetQuestObjectiveCompletion( objectiveFullText ) + if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then + --AJM:Print("BonusQuest", amountCompleted, objectiveText ) + --AJM:Print( "UPDATE:", "cache:", useCache, "QuestID", questID, "ObjectID", iterateObjectives ) + --AJM:Print("sendingquestdata", objectiveText, amountCompleted, finished ) + local name = gsub(title, "[^|]+:", "Bonus:") + -- send command to team + AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete ) + if AJM.db.sendProgressChatMessages == true then + AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false ) + end + end + end + end + end + end + end -- Gathers messages from team. @@ -1144,6 +1218,7 @@ function AJM:UpdateQuestWatchList( questID, questName, objectiveIndex, objective local characterPosition = AJM:GetCharacterInWatchList( questID, objectiveIndex, characterName, amountCompleted, objectiveHeaderPosition, objectiveFinished ) local totalAmountCompleted = AJM:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex ) objectiveHeaderPosition = AJM:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, totalAmountCompleted, questHeaderPosition ) + --AJM:Print("QuestPosition", objectiveHeaderPosition, questHeaderPosition ) -- isComplete piggybacks on the quest watch update, so we are always displaying a complete quest button (in case the QUEST_AUTOCOMPLETE event does not fire). if isComplete == true then AJM:DoAutoQuestFieldComplete( characterName, questID ) @@ -1215,6 +1290,7 @@ end -- QUEST WATCH DISPLAY LIST LOGIC ------------------------------------------------------------------------------------------------------------- +--Ebony working here function AJM:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex ) local amount = 0 local total = 0 @@ -1551,7 +1627,9 @@ function AJM:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, inf end if type == "QUEST_HEADER" then if questTeamCount ~= 0 then - teamCount = " ("..questTeamCount.."/"..JambaApi.GetTeamListMaximumOrder()..") " + --teamCount = " ("..questTeamCount.."/"..JambaApi.GetTeamListMaximumOrder()..") " + --Ebony Only Shows online character info + teamCount = " ("..questTeamCount.."/"..JambaApi.GetTeamListMaximumOrderOnline()..") " end end frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( padding..toggleDisplay..teamCount..information ) @@ -1559,18 +1637,39 @@ function AJM:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, inf -- Turn off the mouse for these buttons. frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( false ) frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( false ) + --AJM:Print("test2343", type, information ) if type == "QUEST_HEADER" then + local matchData = string.find( information, "Bonus:" ) + if matchData then + --AJM:Print("Match", information) + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0, 0, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0, 0, 1.0 ) + -- Turn on the mouse for these buttons. + frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) + frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true ) + else frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 ) - frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 ) -- Turn on the mouse for these buttons. frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true ) + end end if type == "OBJECTIVE_HEADER" then - frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) - frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) - -- Turn on the mouse for these buttons. - frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) + --AJM:Print("Match", information) + local matchData = string.find( information, "ProgressBar" ) + if matchData then + --AJM:Print("Match", information) + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0.50, 0.50, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.50, 0.50, 1.0 ) + -- Turn on the mouse for these buttons. + frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) + else + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) + -- Turn on the mouse for these buttons. + frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) + end end frame.questWatchList.rows[iterateDisplayRows].key = key end diff --git a/Jamba-QuestWatcher/Locales/JambaQuestWatcher-Locale-enUS.lua b/Jamba-QuestWatcher/Locales/JambaQuestWatcher-Locale-enUS.lua index 0981df3..a5f8256 100644 --- a/Jamba-QuestWatcher/Locales/JambaQuestWatcher-Locale-enUS.lua +++ b/Jamba-QuestWatcher/Locales/JambaQuestWatcher-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-QuestWatcher/Locales/Locales.xml b/Jamba-QuestWatcher/Locales/Locales.xml index c11b1a4..53c26eb 100644 --- a/Jamba-QuestWatcher/Locales/Locales.xml +++ b/Jamba-QuestWatcher/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Sell/Jamba-Sell.toc b/Jamba-Sell/Jamba-Sell.toc index 1381cbb..98de984 100644 --- a/Jamba-Sell/Jamba-Sell.toc +++ b/Jamba-Sell/Jamba-Sell.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Sell -## Notes: Jamba-Sell -## Author: Jafula -## Version: 3.12 +## Interface: 60200 +## Title: JambaSell +## Notes: JambaSell +## Author: Ebony, Former Author: Jafula +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Sell/JambaSell.lua b/Jamba-Sell/JambaSell.lua index 95dd8bb..d71133b 100644 --- a/Jamba-Sell/JambaSell.lua +++ b/Jamba-Sell/JambaSell.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -152,6 +152,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Sell/Locales/JambaSell-Locale-enUS.lua b/Jamba-Sell/Locales/JambaSell-Locale-enUS.lua index a15808b..7313003 100644 --- a/Jamba-Sell/Locales/JambaSell-Locale-enUS.lua +++ b/Jamba-Sell/Locales/JambaSell-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Sell/Locales/Locales.xml b/Jamba-Sell/Locales/Locales.xml index 6ca64c5..a74c300 100644 --- a/Jamba-Sell/Locales/Locales.xml +++ b/Jamba-Sell/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Talk/Jamba-Talk.toc b/Jamba-Talk/Jamba-Talk.toc index 7b1b10d..c0e700b 100644 --- a/Jamba-Talk/Jamba-Talk.toc +++ b/Jamba-Talk/Jamba-Talk.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Talk -## Notes: Jamba-Talk +## Interface: 60200 +## Title: JambaTalk +## Notes: JambaTalk ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Talk/JambaTalk.lua b/Jamba-Talk/JambaTalk.lua index 091c026..d576a3f 100644 --- a/Jamba-Talk/JambaTalk.lua +++ b/Jamba-Talk/JambaTalk.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -137,6 +137,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Talk/Locales/JambaTalk-Locale-enUS.lua b/Jamba-Talk/Locales/JambaTalk-Locale-enUS.lua index 104cbb3..677cf2e 100644 --- a/Jamba-Talk/Locales/JambaTalk-Locale-enUS.lua +++ b/Jamba-Talk/Locales/JambaTalk-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Talk/Locales/Locales.xml b/Jamba-Talk/Locales/Locales.xml index bafdfb0..c947bae 100644 --- a/Jamba-Talk/Locales/Locales.xml +++ b/Jamba-Talk/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Target/Bindings.xml b/Jamba-Target/Bindings.xml index e816ac8..c4b345c 100644 --- a/Jamba-Target/Bindings.xml +++ b/Jamba-Target/Bindings.xml @@ -1,33 +1,33 @@ <Bindings> - <Binding name="JAMBATARGETMARK" header="JAMBA_TARGET" category="ADDONS" runOnUp="true"> + <Binding name="JAMBATARGETMARK" header="JAMBA_TARGET" category="Jamba" runOnUp="true"> JambaTargetMarkTargetKeyPress( keystate ) </Binding> - <Binding name="JAMBACLEARTARGET" category="ADDONS"> + <Binding name="JAMBACLEARTARGET" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET1" category="ADDONS"> + <Binding name="JAMBATARGET1" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET2" category="ADDONS"> + <Binding name="JAMBATARGET2" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET3" category="ADDONS"> + <Binding name="JAMBATARGET3" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET4" category="ADDONS"> + <Binding name="JAMBATARGET4" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET5" category="ADDONS"> + <Binding name="JAMBATARGET5" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET6" category="ADDONS"> + <Binding name="JAMBATARGET6" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET7" category="ADDONS"> + <Binding name="JAMBATARGET7" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATARGET8" category="ADDONS"> + <Binding name="JAMBATARGET8" category="Jamba"> --[[dummy]] </Binding> diff --git a/Jamba-Target/Jamba-Target.toc b/Jamba-Target/Jamba-Target.toc index 0f59140..8ad2c7b 100644 --- a/Jamba-Target/Jamba-Target.toc +++ b/Jamba-Target/Jamba-Target.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Target -## Notes: Jamba-Target +## Interface: 60200 +## Title: JambaTarget +## Notes: JambaTarget ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Target/JambaTarget.lua b/Jamba-Target/JambaTarget.lua index a2c49aa..770f2ac 100644 --- a/Jamba-Target/JambaTarget.lua +++ b/Jamba-Target/JambaTarget.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -1038,6 +1038,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:RefreshTargetList() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end diff --git a/Jamba-Target/Locales/JambaTarget-Locale-enUS.lua b/Jamba-Target/Locales/JambaTarget-Locale-enUS.lua index 37a3610..d436452 100644 --- a/Jamba-Target/Locales/JambaTarget-Locale-enUS.lua +++ b/Jamba-Target/Locales/JambaTarget-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- diff --git a/Jamba-Target/Locales/Locales.xml b/Jamba-Target/Locales/Locales.xml index 2c9fcc5..d3bf55f 100644 --- a/Jamba-Target/Locales/Locales.xml +++ b/Jamba-Target/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Taxi/Jamba-Taxi.toc b/Jamba-Taxi/Jamba-Taxi.toc index c374f45..57081c9 100644 --- a/Jamba-Taxi/Jamba-Taxi.toc +++ b/Jamba-Taxi/Jamba-Taxi.toc @@ -1,8 +1,8 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba-Taxi ## Notes: Jamba-Taxi ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Taxi/JambaTaxi.lua b/Jamba-Taxi/JambaTaxi.lua index 5d78161..9f58e82 100644 --- a/Jamba-Taxi/JambaTaxi.lua +++ b/Jamba-Taxi/JambaTaxi.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -139,7 +139,7 @@ function AJM:SettingsCreateTaxi( top ) movingTop, L["Take Master's Taxi"], AJM.SettingsToggleTakeTaxi - ) + ) movingTop = movingTop - headingHeight AJM.settingsControl.checkBoxrequestStop = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, @@ -148,7 +148,7 @@ function AJM:SettingsCreateTaxi( top ) movingTop, L["Request Taxi Stop with Master"], AJM.SettingsTogglerequestStop - ) + ) movingTop = movingTop - checkBoxHeight AJM.settingsControl.dropdownMessageArea = JambaHelperSettings:CreateDropdown( AJM.settingsControl, @@ -182,7 +182,6 @@ function AJM:SettingsTogglerequestStop( event, checked ) AJM.db.requestTaxiStop = checked AJM:SettingsRefresh() end - -- Settings received. function AJM:JambaOnSettingsReceived( characterName, settings ) if characterName ~= AJM.characterName then @@ -194,6 +193,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -257,7 +258,6 @@ function AJM:TakeTaxiNode( taxiNodeIndex ) AJM.jambaTakesTaxi = false end end - -- exit taxi with team ebony local function LeaveTaxi ( sender ) if AJM.db.requestTaxiStop == true then @@ -283,8 +283,6 @@ function AJM.TaxiRequestEarlyLanding( sender ) AJM.jambaLeavsTaxi = false end end - - -- A Jamba command has been received. function AJM:JambaOnCommandReceived( characterName, commandName, ... ) if characterName ~= self.characterName then diff --git a/Jamba-Taxi/Locales/JambaTaxi-Locale-enUS.lua b/Jamba-Taxi/Locales/JambaTaxi-Locale-enUS.lua index c22056a..82dcfd4 100644 --- a/Jamba-Taxi/Locales/JambaTaxi-Locale-enUS.lua +++ b/Jamba-Taxi/Locales/JambaTaxi-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -11,10 +11,9 @@ L["Taxi"] = true L["Taxi Options"] = true L["Take Master's Taxi"] = true L["Request Taxi Stop with Master"] = true -L["Take the same flight as the master did (slaves's must have NPC Flight Master window open)."] = true +L["Take the same flight as the master did (minions's must have NPC Flight Master window open)."] = true L["Push Settings"] = true L["Push the taxi settings to all characters in the team."] = true ---L["I Have Requested a Stop"] = true L["I Have Requested a Stop From X"] = function( sender ) return string.format( "I Have Requested a Stop From %s", sender ) end diff --git a/Jamba-Taxi/Locales/Locales.xml b/Jamba-Taxi/Locales/Locales.xml index 0d8fa91..3fe226a 100644 --- a/Jamba-Taxi/Locales/Locales.xml +++ b/Jamba-Taxi/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Toon/Jamba-Toon.toc b/Jamba-Toon/Jamba-Toon.toc index ba088e7..4756965 100644 --- a/Jamba-Toon/Jamba-Toon.toc +++ b/Jamba-Toon/Jamba-Toon.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Toon -## Notes: Jamba-Toon +## Interface: 60200 +## Title: JambaToon +## Notes: JambaToon ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Toon/JambaToon.lua b/Jamba-Toon/JambaToon.lua index 92b116c..dcd99b8 100644 --- a/Jamba-Toon/JambaToon.lua +++ b/Jamba-Toon/JambaToon.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -32,14 +32,12 @@ AJM.moduleDisplayName = L["Toon: Warnings"] -- Currency Identifiers. AJM.CDalaranJewelcraftingToken = 61 -AJM.CEpicureansAward = 81 +AJM.CValor = 1191 AJM.CChampionsSeal = 241 AJM.CIllustriousJewelcraftersToken = 361 AJM.CConquestPoints = 390 AJM.CTolBaradCommendation = 391 AJM.CHonorPoints = 392 ---AJM.CJusticePoints = 395 ---AJM.CValorPoints = 396 AJM.CIronpawToken = 402 AJM.CLesserCharmOfGoodFortune = 738 AJM.CElderCharmOfGoodFortune = 697 @@ -53,6 +51,9 @@ AJM.CTemperedFate = 994 AJM.CApexisCrystal = 823 AJM.CDarkmoon = 515 AJM.C = 824 +AJM.COil = 1101 +AJM.CInevitableFate = 1129 +AJM.CTimeWalker = 1166 AJM.globalCurrencyFramePrefix = "JambaToonCurrencyListFrame" -- Settings - the values to store and their defaults for the settings database. @@ -71,7 +72,9 @@ AJM.settings = { warnWhenManaDropsAmount = "30", warnManaDropsMessage = L["Low Mana!"], warnBagsFull = true, - bagsFullMessage = L["Bags Full!"], + bagsFullMessage = L["Bags Full!"], + warnCC = true, + CcMessage = L["I Am"], warningArea = JambaApi.DefaultWarningArea(), autoAcceptResurrectRequest = true, autoDenyDuels = true, @@ -85,8 +88,6 @@ AJM.settings = { afkMessage = L["I am inactive!"], currGold = true, currGoldInGuildBank = false, --- currJusticePoints = true, --- currValorPoints = true, currHonorPoints = true, currConquestPoints = true, --as there not used much now changed to false ebony @@ -95,7 +96,7 @@ AJM.settings = { currIllustriousJewelcraftersToken = false, currDalaranJewelcraftingToken = false, currIronpawToken = false, - currEpicureansAward = false, + currValor = false, currLesserCharmOfGoodFortune = false, currElderCharmOfGoodFortune = false, currMoguRuneOfFate = false, @@ -107,6 +108,9 @@ AJM.settings = { currTemperedFate = false, currApexisCrystal = false, currDarkmoon = false, + currInevitableFate = false, + currOil = false, + currTimeWalker = false, currencyFrameAlpha = 1.0, currencyFramePoint = "CENTER", currencyFrameRelativePoint = "CENTER", @@ -184,6 +188,10 @@ AJM.COMMAND_HERE_IS_CURRENCY = "HereIsCurrency" ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- +-- Variables used by module. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- -- Settings Dialogs. ------------------------------------------------------------------------------------------------------------- @@ -243,6 +251,10 @@ function AJM:OnMessageAreasChanged( message ) AJM.settingsControlWarnings.dropdownWarningArea:SetList( JambaApi.MessageAreaList() ) end +function AJM:OnCharactersChanged() + AJM:SettingsRefresh() +end + local function SettingsCreateRequests( top ) -- Get positions. local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() @@ -352,24 +364,6 @@ local function SettingsCreateCurrency( top ) AJM.SettingsToggleCurrencyGoldInGuildBank ) movingTop = movingTop - checkBoxHeight --- AJM.settingsControlCurrency.checkBoxCurrencyJusticePoints = JambaHelperSettings:CreateCheckBox( --- AJM.settingsControlCurrency, --- headingWidth, --- left, --- movingTop, --- L["Justice Points"]..L[" ("]..L["JP"]..L[")"], --- AJM.SettingsToggleCurrencyJusticePoints --- ) --- movingTop = movingTop - checkBoxHeight --- AJM.settingsControlCurrency.checkBoxCurrencyValorPoints = JambaHelperSettings:CreateCheckBox( --- AJM.settingsControlCurrency, --- headingWidth, --- left, --- movingTop, --- L["Valor Points"]..L[" ("]..L["VP"]..L[")"], --- AJM.SettingsToggleCurrencyValorPoints --- ) --- movingTop = movingTop - checkBoxHeight AJM.settingsControlCurrency.checkBoxCurrencyHonorPoints = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCurrency, headingWidth, @@ -386,7 +380,16 @@ local function SettingsCreateCurrency( top ) movingTop, L["Conquest Points"]..L[" ("]..L["CP"]..L[")"], AJM.SettingsToggleCurrencyConquestPoints - ) + ) + movingTop = movingTop - checkBoxHeight + AJM.settingsControlCurrency.checkBoxCurrencyValor = JambaHelperSettings:CreateCheckBox( + AJM.settingsControlCurrency, + headingWidth, + left, + movingTop, + L["Valor Points"]..L[" ("]..L["VP"]..L[")"], + AJM.SettingsToggleCurrencyValor + ) movingTop = movingTop - checkBoxHeight AJM.settingsControlCurrency.checkBoxCurrencyTolBaradCommendation = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCurrency, @@ -432,15 +435,6 @@ local function SettingsCreateCurrency( top ) L["Ironpaw Token"]..L[" ("]..L["IT"]..L[")"], AJM.SettingsToggleCurrencyIronpawToken ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyEpicureansAward = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Epicurean's Award"]..L[" ("]..L["EA"]..L[")"], - AJM.SettingsToggleCurrencyEpicureansAward - ) movingTop = movingTop - checkBoxHeight AJM.settingsControlCurrency.checkBoxCurrencyLesserCharmOfGoodFortune = JambaHelperSettings:CreateCheckBox( AJM.settingsControlCurrency, @@ -511,7 +505,7 @@ local function SettingsCreateCurrency( top ) headingWidth, left, movingTop, - L["Seal of Tempered Fate"]..L[" ("]..L["SoF"]..L[")"], + L["Seal of Tempered Fate"]..L[" ("]..L["SoT"]..L[")"], AJM.SettingsToggleCurrencyTemperedFate ) movingTop = movingTop - checkBoxHeight @@ -529,9 +523,36 @@ local function SettingsCreateCurrency( top ) headingWidth, left, movingTop, - L["Darkmoon Prize Ticket "]..L[" ("]..L["DPT"]..L[")"], + L["Darkmoon Prize Ticket"]..L[" ("]..L["DPT"]..L[")"], AJM.SettingsToggleCurrencyDarkmoon ) + movingTop = movingTop - checkBoxHeight + AJM.settingsControlCurrency.checkBoxCurrencyInevitableFate = JambaHelperSettings:CreateCheckBox( + AJM.settingsControlCurrency, + headingWidth, + left, + movingTop, + L["Seal of Inevitable Fate"]..L[" ("]..L["SoI"]..L[")"], + AJM.SettingsToggleCurrencyInevitableFate + ) + movingTop = movingTop - checkBoxHeight + AJM.settingsControlCurrency.checkBoxCurrencyOil = JambaHelperSettings:CreateCheckBox( + AJM.settingsControlCurrency, + headingWidth, + left, + movingTop, + L["OIL"]..L[" ("]..L["OIL"]..L[")"], + AJM.SettingsToggleCurrencyOil + ) + movingTop = movingTop - checkBoxHeight + AJM.settingsControlCurrency.checkBoxCurrencyTimeWalker = JambaHelperSettings:CreateCheckBox( + AJM.settingsControlCurrency, + headingWidth, + left, + movingTop, + L["Timewarped Badge"]..L[" ("]..L["TwB"]..L[")"], + AJM.SettingsToggleCurrencyTimeWalker + ) movingTop = movingTop - checkBoxHeight AJM.settingsControlCurrency.currencyButtonShowList = JambaHelperSettings:CreateButton( AJM.settingsControlCurrency, @@ -686,7 +707,7 @@ local function SettingsCreateWarnings( top ) headingWidth, left, movingTop, - L["Warn If Hit First Time In Combat (Slave)"], + L["Warn If Hit First Time In Combat (Minion)"], AJM.SettingsToggleWarnHitFirstTimeCombat ) movingTop = movingTop - checkBoxHeight @@ -703,7 +724,7 @@ local function SettingsCreateWarnings( top ) headingWidth, left, movingTop, - L["Warn If Target Not Master On Combat (Slave)"], + L["Warn If Target Not Master On Combat (Minion)"], AJM.SettingsToggleWarnTargetNotMasterEnterCombat ) movingTop = movingTop - checkBoxHeight @@ -720,7 +741,7 @@ local function SettingsCreateWarnings( top ) headingWidth, left, movingTop, - L["Warn If Focus Not Master On Combat (Slave)"], + L["Warn If Focus Not Master On Combat (Minion)"], AJM.SettingsToggleWarnFocusNotMasterEnterCombat ) movingTop = movingTop - checkBoxHeight @@ -821,7 +842,25 @@ local function SettingsCreateWarnings( top ) L["Inactive Message"] ) AJM.settingsControlWarnings.editBoxAfkMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedAfkMessage ) - movingTop = movingTop - editBoxHeight + movingTop = movingTop - editBoxHeight + -- Ebony CC + AJM.settingsControlWarnings.checkBoxWarnCC = JambaHelperSettings:CreateCheckBox( + AJM.settingsControlWarnings, + headingWidth, + left, + movingTop, + L["Warn If Toon Gets Crowd Control"], + AJM.SettingsToggleWarnCC + ) + movingTop = movingTop - checkBoxHeight + AJM.settingsControlWarnings.editBoxCCMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, + headingWidth, + left, + movingTop, + L["Crowd Control Message"] + ) + AJM.settingsControlWarnings.editBoxCCMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedCCMessage ) + movingTop = movingTop - editBoxHeight AJM.settingsControlWarnings.dropdownWarningArea = JambaHelperSettings:CreateDropdown( AJM.settingsControlWarnings, headingWidth, @@ -905,10 +944,11 @@ function AJM:SettingsRefresh() AJM.settingsControlWarnings.editBoxBagsFullMessage:SetText( AJM.db.bagsFullMessage ) AJM.settingsControlWarnings.checkBoxWarnAfk:SetValue( AJM.db.warnAfk ) AJM.settingsControlWarnings.editBoxAfkMessage:SetText( AJM.db.afkMessage ) + AJM.settingsControlWarnings.checkBoxWarnCC:SetValue( AJM.db.warnCC ) + AJM.settingsControlWarnings.editBoxCCMessage:SetText( AJM.db.CcMessage ) AJM.settingsControlWarnings.dropdownWarningArea:SetValue( AJM.db.warningArea ) AJM.settingsControlRequests.checkBoxAutoAcceptResurrectRequest:SetValue( AJM.db.autoAcceptResurrectRequest ) AJM.settingsControlRequests.checkBoxAutoDenyDuels:SetValue( AJM.db.autoDenyDuels ) - --ebonysum AJM.settingsControlRequests.checkBoxAutoAcceptSummonRequest:SetValue( AJM.db.autoAcceptSummonRequest ) AJM.settingsControlRequests.checkBoxAutoDenyGuildInvites:SetValue( AJM.db.autoDenyGuildInvites ) AJM.settingsControlRequests.dropdownRequestArea:SetValue( AJM.db.requestArea ) @@ -925,19 +965,18 @@ function AJM:SettingsRefresh() AJM.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetDisabled( not AJM.db.autoRepair ) AJM.settingsControlWarnings.editBoxBagsFullMessage:SetDisabled( not AJM.db.warnBagsFull ) AJM.settingsControlWarnings.editBoxAfkMessage:SetDisabled( not AJM.db.warnAfk ) + AJM.settingsControlWarnings.editBoxCCMessage:SetDisabled( not AJM.db.warnCC ) AJM.settingsControlCurrency.checkBoxCurrencyGold:SetValue( AJM.db.currGold ) AJM.settingsControlCurrency.checkBoxCurrencyGoldInGuildBank:SetValue( AJM.db.currGoldInGuildBank ) AJM.settingsControlCurrency.checkBoxCurrencyGoldInGuildBank:SetDisabled( not AJM.db.currGold ) --- AJM.settingsControlCurrency.checkBoxCurrencyJusticePoints:SetValue( AJM.db.currJusticePoints ) --- AJM.settingsControlCurrency.checkBoxCurrencyValorPoints:SetValue( AJM.db.currValorPoints ) AJM.settingsControlCurrency.checkBoxCurrencyHonorPoints:SetValue( AJM.db.currHonorPoints ) AJM.settingsControlCurrency.checkBoxCurrencyConquestPoints:SetValue( AJM.db.currConquestPoints ) + AJM.settingsControlCurrency.checkBoxCurrencyValor:SetValue( AJM.db.currValor ) AJM.settingsControlCurrency.checkBoxCurrencyTolBaradCommendation:SetValue( AJM.db.currTolBaradCommendation ) AJM.settingsControlCurrency.checkBoxCurrencyChampionsSeal:SetValue( AJM.db.currChampionsSeal ) AJM.settingsControlCurrency.checkBoxCurrencyIllustriousJewelcraftersToken:SetValue( AJM.db.currIllustriousJewelcraftersToken ) AJM.settingsControlCurrency.checkBoxCurrencyDalaranJewelcraftingToken:SetValue( AJM.db.currDalaranJewelcraftingToken ) AJM.settingsControlCurrency.checkBoxCurrencyIronpawToken:SetValue( AJM.db.currIronpawToken ) - AJM.settingsControlCurrency.checkBoxCurrencyEpicureansAward:SetValue( AJM.db.currEpicureansAward ) AJM.settingsControlCurrency.checkBoxCurrencyLesserCharmOfGoodFortune:SetValue( AJM.db.currLesserCharmOfGoodFortune ) AJM.settingsControlCurrency.checkBoxCurrencyElderCharmOfGoodFortune:SetValue( AJM.db.currElderCharmOfGoodFortune ) AJM.settingsControlCurrency.checkBoxCurrencyMoguRuneOfFate:SetValue( AJM.db.currMoguRuneOfFate ) @@ -949,6 +988,10 @@ function AJM:SettingsRefresh() AJM.settingsControlCurrency.checkBoxCurrencyTemperedFate:SetValue( AJM.db.currTemperedFate ) AJM.settingsControlCurrency.checkBoxCurrencyApexisCrystal:SetValue( AJM.db.currApexisCrystal ) AJM.settingsControlCurrency.checkBoxCurrencyDarkmoon:SetValue( AJM.db.currDarkmoon ) + AJM.settingsControlCurrency.checkBoxCurrencyInevitableFate:SetValue( AJM.db.currInevitableFate ) + AJM.settingsControlCurrency.checkBoxCurrencyOil:SetValue( AJM.db.currOil ) + AJM.settingsControlCurrency.checkBoxCurrencyTimeWalker:SetValue( AJM.db.currTimeWalker ) + --end AJM.settingsControlCurrency.checkBoxCurrencyOpenStartUpMaster:SetValue( AJM.db.currOpenStartUpMaster ) AJM.settingsControlCurrency.currencyTransparencySlider:SetValue( AJM.db.currencyFrameAlpha ) AJM.settingsControlCurrency.currencyScaleSlider:SetValue( AJM.db.currencyScale ) @@ -988,14 +1031,10 @@ function AJM:SettingsToggleAutoDenyDuels( event, checked ) AJM.db.autoDenyDuels = checked AJM:SettingsRefresh() end - ---ebonysum function AJM:SettingsToggleAutoAcceptSummonRequest( event, checked ) AJM.db.autoAcceptSummonRequest = checked AJM:SettingsRefresh() end - - function AJM:SettingsToggleAutoDenyGuildInvites( event, checked ) AJM.db.autoDenyGuildInvites = checked AJM:SettingsRefresh() @@ -1036,6 +1075,16 @@ function AJM:EditBoxChangedAfkMessage( event, text ) AJM:SettingsRefresh() end +function AJM:SettingsToggleWarnCC( event, checked ) + AJM.db.warnCC = checked + AJM:SettingsRefresh() +end + +function AJM:EditBoxChangedCCMessage( event, text ) + AJM.db.CcMessage = text + AJM:SettingsRefresh() +end + function AJM:SettingsToggleWarnTargetNotMasterEnterCombat( event, checked ) AJM.db.warnTargetNotMasterEnterCombat = checked AJM:SettingsRefresh() @@ -1115,16 +1164,6 @@ function AJM:SettingsToggleCurrencyGoldInGuildBank( event, checked ) AJM:SettingsRefresh() end ---function AJM:SettingsToggleCurrencyJusticePoints( event, checked ) --- AJM.db.currJusticePoints = checked --- AJM:SettingsRefresh() ---end --- ---function AJM:SettingsToggleCurrencyValorPoints( event, checked ) --- AJM.db.currValorPoints = checked --- AJM:SettingsRefresh() ---end - function AJM:SettingsToggleCurrencyHonorPoints( event, checked ) AJM.db.currHonorPoints = checked AJM:SettingsRefresh() @@ -1135,6 +1174,11 @@ function AJM:SettingsToggleCurrencyConquestPoints( event, checked ) AJM:SettingsRefresh() end +function AJM:SettingsToggleCurrencyValor( event, checked ) + AJM.db.currValor = checked + AJM:SettingsRefresh() +end + function AJM:SettingsToggleCurrencyTolBaradCommendation( event, checked ) AJM.db.currTolBaradCommendation = checked AJM:SettingsRefresh() @@ -1160,10 +1204,6 @@ function AJM:SettingsToggleCurrencyIronpawToken( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsToggleCurrencyEpicureansAward( event, checked ) - AJM.db.currEpicureansAward = checked - AJM:SettingsRefresh() -end function AJM:SettingsToggleCurrencyLesserCharmOfGoodFortune( event, checked ) AJM.db.currLesserCharmOfGoodFortune = checked @@ -1211,6 +1251,21 @@ function AJM:SettingsToggleCurrencyApexisCrystal ( event, checked ) AJM:SettingsRefresh() end +function AJM:SettingsToggleCurrencyInevitableFate ( event, checked ) + AJM.db.currInevitableFate = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleCurrencyOil ( event, checked ) + AJM.db.currOil = checked + AJM:SettingsRefresh() +end + +function AJM:SettingsToggleCurrencyTimeWalker ( event, checked ) + AJM.db.currTimeWalker = checked + AJM:SettingsRefresh() +end + function AJM:SettingsToggleCurrencyDarkmoon ( event, checked ) AJM.db.currDarkmoon = checked AJM:SettingsRefresh() @@ -1325,9 +1380,16 @@ function AJM:OnEnable() AJM:RegisterEvent( "DUEL_REQUESTED" ) AJM:RegisterEvent( "GUILD_INVITE_REQUEST" ) AJM:RegisterEvent( "ITEM_PUSH" ) + --test + --AJM:RegisterEvent("LOSS_OF_CONTROL_UPDATE") + AJM:RegisterEvent("LOSS_OF_CONTROL_ADDED") + + --TODO: this might need chaning like in jamba-display as does not work very well with a lot of RED UI updates. (EG spamBAR?) AJM:RegisterEvent( "UI_ERROR_MESSAGE", "ITEM_PUSH" ) AJM:RegisterEvent( "UNIT_AURA" ) AJM:RegisterMessage( JambaApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged" ) + AJM:RegisterMessage( JambaApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged" ) if AJM.db.currOpenStartUpMaster == true then if JambaApi.IsCharacterTheMaster( self.characterName ) == true then AJM:ScheduleTimer( "JambaToonRequestCurrency", 2 ) @@ -1358,10 +1420,12 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.warnBagsFull = settings.warnBagsFull AJM.db.bagsFullMessage = settings.bagsFullMessage AJM.db.warnAfk = settings.warnAfk - AJM.db.afkMessage = settings.afkMessage + AJM.db.afkMessage = settings.afkMessage + AJM.db.warnCC = settings.warnCC + AJM.db.CcMessage = settings.CcMessage AJM.db.autoAcceptResurrectRequest = settings.autoAcceptResurrectRequest AJM.db.autoDenyDuels = settings.autoDenyDuels --- ebonnysum + --ebonnysum AJM.db.autoAcceptSummonRequest = settings.autoAcceptSummonRequest AJM.db.autoDenyGuildInvites = settings.autoDenyGuildInvites AJM.db.autoRepair = settings.autoRepair @@ -1371,16 +1435,14 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.merchantArea = settings.merchantArea AJM.db.currGold = settings.currGold AJM.db.currGoldInGuildBank = settings.currGoldInGuildBank --- AJM.db.currJusticePoints = settings.currJusticePoints --- AJM.db.currValorPoints = settings.currValorPoints AJM.db.currHonorPoints = settings.currHonorPoints AJM.db.currConquestPoints = settings.currConquestPoints + AJM.db.currValor = settings.currValor AJM.db.currTolBaradCommendation = settings.currTolBaradCommendation AJM.db.currChampionsSeal = settings.currChampionsSeal AJM.db.currIllustriousJewelcraftersToken = settings.currIllustriousJewelcraftersToken AJM.db.currDalaranJewelcraftingToken = settings.currDalaranJewelcraftingToken AJM.db.currIronpawToken = settings.currIronpawToken - AJM.db.currEpicureansAward = settings.currEpicureansAward AJM.db.currLesserCharmOfGoodFortune = settings.currLesserCharmOfGoodFortune AJM.db.currElderCharmOfGoodFortune = settings.currElderCharmOfGoodFortune AJM.db.currMoguRuneOfFate = settings.currMoguRuneOfFate @@ -1391,7 +1453,11 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM.db.currGarrisonResources = settings.currGarrisonResources AJM.db.currTemperedFate = settings.currTemperedFate AJM.db.currApexisCrystal = settings.currApexisCrystal - AJM.db.currApexisCrystal = settings.currDarkmoon + AJM.db.currDarkmoon = settings.currDarkmoon + AJM.db.currInevitableFate = settings.currInevitableFate + AJM.db.currOil = settings.currOil + AJM.db.currTimeWalker = settings.currTimeWalker +-- END AJM.db.currOpenStartUpMaster = settings.currOpenStartUpMaster AJM.db.currencyScale = settings.currencyScale AJM.db.currencyFrameAlpha = settings.currencyFrameAlpha @@ -1416,6 +1482,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -1572,14 +1640,18 @@ function AJM:PLAYER_REGEN_DISABLED( event, ... ) AJM.haveBeenHit = false if AJM.db.warnTargetNotMasterEnterCombat == true then if JambaApi.IsCharacterTheMaster( AJM.characterName ) == false then - if UnitName( "target" ) ~= JambaApi.GetMasterName() then + local name, realm = UnitName( "target" ) + local character = JambaUtilities:AddRealmToNameIfNotNil( name, realm ) + if character ~= JambaApi.GetMasterName() then AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnTargetNotMasterMessage, false ) end end end if AJM.db.warnFocusNotMasterEnterCombat == true then if JambaApi.IsCharacterTheMaster( AJM.characterName ) == false then - if UnitName( "focus" ) ~= JambaApi.GetMasterName() then + local name, realm = UnitName( "focus" ) + local character = JambaUtilities:AddRealmToNameIfNotNil( name, realm ) + if character ~= JambaApi.GetMasterName() then AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnFocusNotMasterMessage, false ) end end @@ -1594,16 +1666,17 @@ function AJM:ITEM_PUSH( event, ... ) if UnitIsDead( "player" ) then return end - local numberFreeSlots, numberTotalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) + local numberFreeSlots, numberTotalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) if numberFreeSlots == 0 then if AJM.previousFreeBagSlotsCount ~= numberFreeSlots then AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.bagsFullMessage, false ) end end - AJM.previousFreeBagSlotsCount = numberFreeSlots + AJM.previousFreeBagSlotsCount = numberFreeSlots end end + function AJM:UNIT_AURA( event, ... ) if AJM.db.warnAfk == true then if JambaUtilities:DoesThisCharacterHaveBuff( L["Inactive"] ) == true then @@ -1612,6 +1685,18 @@ function AJM:UNIT_AURA( event, ... ) end end +--Ebony CCed +function AJM:LOSS_OF_CONTROL_ADDED( event, ... ) + if AJM.db.warnCC == true then + local eventIndex = C_LossOfControl.GetNumEvents() + if eventIndex > 0 then + local locType, spellID, text, iconTexture, startTime, timeRemaining, duration, lockoutSchool, priority, displayType = C_LossOfControl.GetEventInfo(eventIndex) + --AJM:Print("LOSS OF CONTROL", eventIndex, text) -- Ebony testing + AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.CcMessage..L[" "]..text, false ) + end + end +end + function AJM:CreateJambaToonCurrencyListFrame() -- The frame. local frame = CreateFrame( "Frame", "JambaToonCurrencyListWindowFrame", UIParent ) @@ -1688,26 +1773,6 @@ function AJM:CreateJambaToonCurrencyListFrame() frameGoldText:SetJustifyH( "CENTER" ) frame.GoldText = frameGoldText left = left + spacing --- -- Set the JusticePoints font string. --- local frameJusticePoints = AJM.globalCurrencyFramePrefix.."TitleJusticePoints" --- local frameJusticePointsText = parentFrame:CreateFontString( frameJusticePoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameJusticePointsText:SetText( L["JP"] ) --- frameJusticePointsText:SetTextColor( r, g, b, a ) --- frameJusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameJusticePointsText:SetWidth( width ) --- frameJusticePointsText:SetJustifyH( "CENTER" ) --- frame.JusticePointsText = frameJusticePointsText --- left = left + spacing --- -- Set the ValorPoints font string. --- local frameValorPoints = AJM.globalCurrencyFramePrefix.."TitleValorPoints" --- local frameValorPointsText = parentFrame:CreateFontString( frameValorPoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameValorPointsText:SetText( L["VP"] ) --- frameValorPointsText:SetTextColor( r, g, b, a ) --- frameValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameValorPointsText:SetWidth( width ) --- frameValorPointsText:SetJustifyH( "CENTER" ) --- frame.ValorPointsText = frameValorPointsText --- left = left + spacing -- Set the HonorPoints font string. local frameHonorPoints = AJM.globalCurrencyFramePrefix.."TitleHonorPoints" local frameHonorPointsText = parentFrame:CreateFontString( frameHonorPoints.."Text", "OVERLAY", "GameFontNormal" ) @@ -1728,6 +1793,16 @@ function AJM:CreateJambaToonCurrencyListFrame() frameConquestPointsText:SetJustifyH( "CENTER" ) frame.ConquestPointsText = frameConquestPointsText left = left + spacing + -- Set the Valor font string. + local frameValor = AJM.globalCurrencyFramePrefix.."Valor" + local frameValorText = parentFrame:CreateFontString( frameValor.."Text", "OVERLAY", "GameFontNormal" ) + frameValorText:SetText( L["VP"] ) + frameValorText:SetTextColor( r, g, b, a ) + frameValorText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameValorText:SetWidth( width ) + frameValorText:SetJustifyH( "CENTER" ) + frame.ValorText = frameValorText + left = left + spacing -- Set the TolBaradCommendation font string. local frameTolBaradCommendation = AJM.globalCurrencyFramePrefix.."TitleTolBaradCommendation" local frameTolBaradCommendationText = parentFrame:CreateFontString( frameTolBaradCommendation.."Text", "OVERLAY", "GameFontNormal" ) @@ -1778,16 +1853,6 @@ function AJM:CreateJambaToonCurrencyListFrame() frameIronpawTokenText:SetJustifyH( "CENTER" ) frame.IronpawTokenText = frameIronpawTokenText left = left + spacing - -- Set the EpicureansAward font string. - local frameEpicureansAward = AJM.globalCurrencyFramePrefix.."TitleEpicureansAward" - local frameEpicureansAwardText = parentFrame:CreateFontString( frameEpicureansAward.."Text", "OVERLAY", "GameFontNormal" ) - frameEpicureansAwardText:SetText( L["EA"] ) - frameEpicureansAwardText:SetTextColor( r, g, b, a ) - frameEpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameEpicureansAwardText:SetWidth( width ) - frameEpicureansAwardText:SetJustifyH( "CENTER" ) - frame.EpicureansAwardText = frameEpicureansAwardText - left = left + spacing -- Set the LesserCharmOfGoodFortune font string. local frameLesserCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."TitleLesserCharmOfGoodFortune" local frameLesserCharmOfGoodFortuneText = parentFrame:CreateFontString( frameLesserCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) @@ -1862,7 +1927,7 @@ function AJM:CreateJambaToonCurrencyListFrame() -- Set the Tempered Fate font string. local frameTemperedFate = AJM.globalCurrencyFramePrefix.."TitleTemperedFate" local frameTemperedFateText = parentFrame:CreateFontString( frameTemperedFate .."Text", "OVERLAY", "GameFontNormal" ) - frameTemperedFateText:SetText( L["SoF"] ) + frameTemperedFateText:SetText( L["SoT"] ) frameTemperedFateText:SetTextColor( r, g, b, a ) frameTemperedFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) frameTemperedFateText:SetWidth( width ) @@ -1889,9 +1954,42 @@ function AJM:CreateJambaToonCurrencyListFrame() frameDarkmoonText:SetJustifyH( "CENTER" ) frame.DarkmoonText = frameDarkmoonText left = left + spacing + -- Set the Oil font string. + local frameOil = AJM.globalCurrencyFramePrefix.."TitleOil" + local frameOilText = parentFrame:CreateFontString( frameOil .."Text", "OVERLAY", "GameFontNormal" ) + frameOilText:SetText( L["OIL"] ) + frameOilText:SetTextColor( r, g, b, a ) + frameOilText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameOilText:SetWidth( width ) + frameOilText:SetJustifyH( "CENTER" ) + frame.OilText = frameOilText + left = left + spacing + -- Set the InevitableFate Prize font string. + local frameInevitableFate = AJM.globalCurrencyFramePrefix.."TitleInevitableFate" + local frameInevitableFateText = parentFrame:CreateFontString( frameInevitableFate .."Text", "OVERLAY", "GameFontNormal" ) + frameInevitableFateText:SetText( L["SoI"] ) + frameInevitableFateText:SetTextColor( r, g, b, a ) + frameInevitableFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameInevitableFateText:SetWidth( width ) + frameInevitableFateText:SetJustifyH( "CENTER" ) + frame.InevitableFateText = frameInevitableFateText + left = left + spacing + -- Set the Time Walker font string. + local frameTimeWalker = AJM.globalCurrencyFramePrefix.."TitleTimewalker" + local frameTimeWalkerText = parentFrame:CreateFontString( frameTimeWalker .."Text", "OVERLAY", "GameFontNormal" ) + frameTimeWalkerText:SetText( L["SoI"] ) + frameTimeWalkerText:SetTextColor( r, g, b, a ) + frameTimeWalkerText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameTimeWalkerText:SetWidth( width ) + frameTimeWalkerText:SetJustifyH( "CENTER" ) + frame.TimeWalkerText = frameTimeWalkerText + left = left + spacing + -- Set the Total Gold font string. left = 10 top = -50 + + local frameTotalGoldTitle = AJM.globalCurrencyFramePrefix.."TitleTotalGold" local frameTotalGoldTitleText = parentFrame:CreateFontString( frameTotalGoldTitle.."Text", "OVERLAY", "GameFontNormal" ) frameTotalGoldTitleText:SetText( L["Total"] ) @@ -1997,7 +2095,7 @@ function AJM:CurrencyListSetHeight() addHeight = 5 end end - JambaToonCurrencyListFrame:SetHeight( 56 + ((JambaApi.GetTeamListMaximumOrder() + additionalLines) * 15) + addHeight ) + JambaToonCurrencyListFrame:SetHeight( 56 + (( JambaApi.GetTeamListMaximumOrderOnline() + additionalLines) * 15) + addHeight ) end function AJM:CurrencyListSetColumnWidth() @@ -2025,24 +2123,6 @@ function AJM:CurrencyListSetColumnWidth() parentFrame.GoldText:Hide() haveGold = 0 end --- if AJM.db.currJusticePoints == true then --- parentFrame.JusticePointsText:SetWidth( pointsWidth ) --- parentFrame.JusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- numberOfPointsColumns = numberOfPointsColumns + 1 --- parentFrame.JusticePointsText:Show() --- else --- parentFrame.JusticePointsText:Hide() --- end --- if AJM.db.currValorPoints == true then --- parentFrame.ValorPointsText:SetWidth( pointsWidth ) --- parentFrame.ValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- numberOfPointsColumns = numberOfPointsColumns + 1 --- parentFrame.ValorPointsText:Show() --- else --- parentFrame.ValorPointsText:Hide() --- end if AJM.db.currHonorPoints == true then parentFrame.HonorPointsText:SetWidth( pointsWidth ) parentFrame.HonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) @@ -2061,6 +2141,15 @@ function AJM:CurrencyListSetColumnWidth() else parentFrame.ConquestPointsText:Hide() end + if AJM.db.currValor == true then + parentFrame.ValorText:SetWidth( pointsWidth ) + parentFrame.ValorText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.ValorText:Show() + else + parentFrame.ValorText:Hide() + end if AJM.db.currTolBaradCommendation == true then parentFrame.TolBaradCommendationText:SetWidth( pointsWidth ) parentFrame.TolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) @@ -2106,15 +2195,6 @@ function AJM:CurrencyListSetColumnWidth() else parentFrame.IronpawTokenText:Hide() end - if AJM.db.currEpicureansAward == true then - parentFrame.EpicureansAwardText:SetWidth( pointsWidth ) - parentFrame.EpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.EpicureansAwardText:Show() - else - parentFrame.EpicureansAwardText:Hide() - end if AJM.db.currLesserCharmOfGoodFortune == true then parentFrame.LesserCharmOfGoodFortuneText:SetWidth( pointsWidth ) parentFrame.LesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) @@ -2206,8 +2286,40 @@ function AJM:CurrencyListSetColumnWidth() else parentFrame.DarkmoonText:Hide() end + if AJM.db.currInevitableFate == true then + parentFrame.InevitableFateText:SetWidth( pointsWidth ) + parentFrame.InevitableFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.InevitableFateText:Show() + else + parentFrame.InevitableFateText:Hide() + end + if AJM.db.currOil == true then + parentFrame.OilText:SetWidth( pointsWidth ) + parentFrame.OilText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.OilText:Show() + else + parentFrame.OilText:Hide() + end + if AJM.db.currTimeWalker == true then + parentFrame.TimeWalkerText:SetWidth( pointsWidth ) + parentFrame.TimeWalkerText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.TimeWalkerText:Show() + else + parentFrame.TimeWalkerText:Hide() + end + -- Character rows. for characterName, currencyFrameCharacterInfo in pairs( AJM.currencyFrameCharacterInfo ) do + --if JambaPrivate.Team.GetCharacterOnlineStatus (characterName) == false then + --AJM.Print("offline", characterName) + -- currencyFrameCharacterInfo.characterNameText:hide() + --end local left = frameHorizontalSpacing local characterRowTopPoint = currencyFrameCharacterInfo.characterRowTopPoint currencyFrameCharacterInfo.characterNameText:SetWidth( nameWidth ) @@ -2221,22 +2333,6 @@ function AJM:CurrencyListSetColumnWidth() else currencyFrameCharacterInfo.GoldText:Hide() end --- if AJM.db.currJusticePoints == true then --- currencyFrameCharacterInfo.JusticePointsText:SetWidth( pointsWidth ) --- currencyFrameCharacterInfo.JusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- currencyFrameCharacterInfo.JusticePointsText:Show() --- else --- currencyFrameCharacterInfo.JusticePointsText:Hide() --- end --- if AJM.db.currValorPoints == true then --- currencyFrameCharacterInfo.ValorPointsText:SetWidth( pointsWidth ) --- currencyFrameCharacterInfo.ValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- currencyFrameCharacterInfo.ValorPointsText:Show() --- else --- currencyFrameCharacterInfo.ValorPointsText:Hide() --- end if AJM.db.currHonorPoints == true then currencyFrameCharacterInfo.HonorPointsText:SetWidth( pointsWidth ) currencyFrameCharacterInfo.HonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) @@ -2253,6 +2349,14 @@ function AJM:CurrencyListSetColumnWidth() else currencyFrameCharacterInfo.ConquestPointsText:Hide() end + if AJM.db.currValor == true then + currencyFrameCharacterInfo.ValorText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.ValorText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.ValorText:Show() + else + currencyFrameCharacterInfo.ValorText:Hide() + end if AJM.db.currTolBaradCommendation == true then currencyFrameCharacterInfo.TolBaradCommendationText:SetWidth( pointsWidth ) currencyFrameCharacterInfo.TolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) @@ -2293,14 +2397,6 @@ function AJM:CurrencyListSetColumnWidth() else currencyFrameCharacterInfo.IronpawTokenText:Hide() end - if AJM.db.currEpicureansAward == true then - currencyFrameCharacterInfo.EpicureansAwardText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.EpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.EpicureansAwardText:Show() - else - currencyFrameCharacterInfo.EpicureansAwardText:Hide() - end if AJM.db.currLesserCharmOfGoodFortune == true then currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetWidth( pointsWidth ) currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) @@ -2349,7 +2445,6 @@ function AJM:CurrencyListSetColumnWidth() else currencyFrameCharacterInfo.TimelessCoinText:Hide() end - --ebony New WoD Currency if AJM.db.currGarrisonResources == true then currencyFrameCharacterInfo.GarrisonResourcesText:SetWidth( pointsWidth ) @@ -2382,7 +2477,31 @@ function AJM:CurrencyListSetColumnWidth() currencyFrameCharacterInfo.DarkmoonText:Show() else currencyFrameCharacterInfo.DarkmoonText:Hide() - end + end + if AJM.db.currInevitableFate == true then + currencyFrameCharacterInfo.InevitableFateText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.InevitableFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.InevitableFateText:Show() + else + currencyFrameCharacterInfo.InevitableFateText:Hide() + end + if AJM.db.currOil == true then + currencyFrameCharacterInfo.OilText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.OilText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.OilText:Show() + else + currencyFrameCharacterInfo.OilText:Hide() + end + if AJM.db.currTimeWalker == true then + currencyFrameCharacterInfo.TimeWalkerText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.TimeWalkerText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.TimeWalkerText:Show() + else + currencyFrameCharacterInfo.TimeWalkerText:Hide() + end end -- Parent frame width and title. local finalParentWidth = frameHorizontalSpacing + nameWidth + spacingWidth + (haveGold * (goldWidth + (spacingWidth * 3))) + (numberOfPointsColumns * (pointsWidth + spacingWidth)) + frameHorizontalSpacing @@ -2416,8 +2535,10 @@ function AJM:CurrencyListSetColumnWidth() -- Total Gold. local nameLeft = frameHorizontalSpacing local goldLeft = frameHorizontalSpacing + nameWidth + spacingWidth - local guildTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 5 - local goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 7 + --local guildTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 5 + --local goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 7 + local guildTop = -35 - ((JambaApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 5 + local goldTop = -35 - ((JambaApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 7 if AJM.db.currGold == true then if AJM.db.currGoldInGuildBank == true then parentFrame.TotalGoldGuildTitleText:SetWidth( nameWidth ) @@ -2426,7 +2547,8 @@ function AJM:CurrencyListSetColumnWidth() parentFrame.TotalGoldGuildText:SetWidth( goldWidth ) parentFrame.TotalGoldGuildText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", goldLeft, guildTop ) parentFrame.TotalGoldGuildText:Show() - goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 2) * 15) - 5 + --goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 2) * 15) - 5 + goldTop = -35 - ((JambaApi.GetTeamListMaximumOrderOnline() + 2) * 15) - 5 else parentFrame.TotalGoldGuildTitleText:Hide() parentFrame.TotalGoldGuildText:Hide() @@ -2442,15 +2564,18 @@ function AJM:CurrencyListSetColumnWidth() parentFrame.TotalGoldText:Hide() parentFrame.TotalGoldGuildTitleText:Hide() parentFrame.TotalGoldGuildText:Hide() + end end function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) + --AJM.Print("makelist", characterName) local left = 10 local spacing = 50 local width = 50 - local top = -35 + (-15 * JambaApi.GetPositionForCharacterName( characterName )) - -- Create the table to hold the status bars for this character. + --local top = -35 + (-15 * JambaApi.GetPositionForCharacterName( characterName )) + local top = -35 + (-15 * JambaApi.GetPositionForCharacterNameOnline( characterName) ) + -- Create the table to hold the status bars for this character. AJM.currencyFrameCharacterInfo[characterName] = {} -- Get the character info table. local currencyFrameCharacterInfo = AJM.currencyFrameCharacterInfo[characterName] @@ -2458,7 +2583,7 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) -- Set the characters name font string. local frameCharacterName = AJM.globalCurrencyFramePrefix.."CharacterName" local frameCharacterNameText = parentFrame:CreateFontString( frameCharacterName.."Text", "OVERLAY", "GameFontNormal" ) - frameCharacterNameText:SetText( characterName ) + frameCharacterNameText:SetText( Ambiguate( characterName , "none" ) ) frameCharacterNameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) frameCharacterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) frameCharacterNameText:SetWidth( width * 2.5 ) @@ -2475,26 +2600,6 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) frameGoldText:SetJustifyH( "RIGHT" ) currencyFrameCharacterInfo.GoldText = frameGoldText left = left + spacing --- -- Set the JusticePoints font string. --- local frameJusticePoints = AJM.globalCurrencyFramePrefix.."JusticePoints" --- local frameJusticePointsText = parentFrame:CreateFontString( frameJusticePoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameJusticePointsText:SetText( "0" ) --- frameJusticePointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) --- frameJusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameJusticePointsText:SetWidth( width ) --- frameJusticePointsText:SetJustifyH( "CENTER" ) --- currencyFrameCharacterInfo.JusticePointsText = frameJusticePointsText --- left = left + spacing --- -- Set the ValorPoints font string. --- local frameValorPoints = AJM.globalCurrencyFramePrefix.."ValorPoints" --- local frameValorPointsText = parentFrame:CreateFontString( frameValorPoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameValorPointsText:SetText( "0" ) --- frameValorPointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) --- frameValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameValorPointsText:SetWidth( width ) --- frameValorPointsText:SetJustifyH( "CENTER" ) --- currencyFrameCharacterInfo.ValorPointsText = frameValorPointsText --- left = left + spacing -- Set the HonorPoints font string. local frameHonorPoints = AJM.globalCurrencyFramePrefix.."HonorPoints" local frameHonorPointsText = parentFrame:CreateFontString( frameHonorPoints.."Text", "OVERLAY", "GameFontNormal" ) @@ -2515,6 +2620,16 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) frameConquestPointsText:SetJustifyH( "CENTER" ) currencyFrameCharacterInfo.ConquestPointsText = frameConquestPointsText left = left + spacing + -- Set the Valor font string. + local frameValor = AJM.globalCurrencyFramePrefix.."Valor" + local frameValorText = parentFrame:CreateFontString( frameValor.."Text", "OVERLAY", "GameFontNormal" ) + frameValorText:SetText( "0" ) + frameValorText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameValorText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameValorText:SetWidth( width ) + frameValorText:SetJustifyH( "CENTER" ) + currencyFrameCharacterInfo.ValorText = frameValorText + left = left + spacing -- Set the TolBaradCommendation font string. local frameTolBaradCommendation = AJM.globalCurrencyFramePrefix.."TolBaradCommendation" local frameTolBaradCommendationText = parentFrame:CreateFontString( frameTolBaradCommendation.."Text", "OVERLAY", "GameFontNormal" ) @@ -2565,16 +2680,6 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) frameIronpawTokenText:SetJustifyH( "CENTER" ) currencyFrameCharacterInfo.IronpawTokenText = frameIronpawTokenText left = left + spacing - -- Set the EpicureansAward font string. - local frameEpicureansAward = AJM.globalCurrencyFramePrefix.."EpicureansAward" - local frameEpicureansAwardText = parentFrame:CreateFontString( frameEpicureansAward.."Text", "OVERLAY", "GameFontNormal" ) - frameEpicureansAwardText:SetText( "0" ) - frameEpicureansAwardText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameEpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameEpicureansAwardText:SetWidth( width ) - frameEpicureansAwardText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.EpicureansAwardText = frameEpicureansAwardText - left = left + spacing -- Set the LesserCharmOfGoodFortune font string. local frameLesserCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."LesserCharmOfGoodFortune" local frameLesserCharmOfGoodFortuneText = parentFrame:CreateFontString( frameLesserCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) @@ -2666,6 +2771,7 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) frameApexisCrystalText:SetJustifyH( "CENTER" ) currencyFrameCharacterInfo.ApexisCrystalText = frameApexisCrystalText left = left + spacing + -- Set the Darkmoon font string. local frameDarkmoon = AJM.globalCurrencyFramePrefix.."Darkmoon" local frameDarkmoonText = parentFrame:CreateFontString( frameDarkmoon .."Text", "OVERLAY", "GameFontNormal" ) frameDarkmoonText:SetText( "0" ) @@ -2675,6 +2781,36 @@ function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) frameDarkmoonText:SetJustifyH( "CENTER" ) currencyFrameCharacterInfo.DarkmoonText = frameDarkmoonText left = left + spacing + -- Set the InevitableFate font string. + local frameInevitableFate = AJM.globalCurrencyFramePrefix.."InevitableFate" + local frameInevitableFateText = parentFrame:CreateFontString( frameInevitableFate .."Text", "OVERLAY", "GameFontNormal" ) + frameInevitableFateText:SetText( "0" ) + frameInevitableFateText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameInevitableFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameInevitableFateText:SetWidth( width ) + frameInevitableFateText:SetJustifyH( "CENTER" ) + currencyFrameCharacterInfo.InevitableFateText = frameInevitableFateText + left = left + spacing + -- Set the Oil font string. + local frameOil = AJM.globalCurrencyFramePrefix.."Oil" + local frameOilText = parentFrame:CreateFontString( frameOil .."Text", "OVERLAY", "GameFontNormal" ) + frameOilText:SetText( "0" ) + frameOilText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameOilText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameOilText:SetWidth( width ) + frameOilText:SetJustifyH( "CENTER" ) + currencyFrameCharacterInfo.OilText = frameOilText + left = left + spacing + -- Set the TimeWalker font string. + local frameTimeWalker = AJM.globalCurrencyFramePrefix.."TimeWalker" + local frameTimeWalkerText = parentFrame:CreateFontString( frameTimeWalker .."Text", "OVERLAY", "GameFontNormal" ) + frameTimeWalkerText:SetText( "0" ) + frameTimeWalkerText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameTimeWalkerText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameTimeWalkerText:SetWidth( width ) + frameTimeWalkerText:SetJustifyH( "CENTER" ) + currencyFrameCharacterInfo.TimeWalkerText = frameTimeWalkerText + left = left + spacing end function AJM:JambaToonHideCurrency() @@ -2682,24 +2818,28 @@ function AJM:JambaToonHideCurrency() end function AJM:JambaToonRequestCurrency() + --AJM.Print("DoRequestCurrency", characterName) -- Colour red. local r = 1.0 local g = 0.0 local b = 0.0 local a = 0.6 for characterName, currencyFrameCharacterInfo in pairs( AJM.currencyFrameCharacterInfo ) do + if JambaApi.GetCharacterOnlineStatus ( characterName ) == true then + -- AJM.Print("offlineRemove") + -- AJM.currencyFrameCharacterInfo[characterName] = nil + -- return + --else currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.JusticePointsText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.ValorPointsText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.HonorPointsText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ConquestPointsText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.ValorText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.TolBaradCommendationText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ChampionsSealText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.IronpawTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.EpicureansAwardText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.MoguRuneOfFateText:SetTextColor( r, g, b, a ) @@ -2711,6 +2851,13 @@ function AJM:JambaToonRequestCurrency() currencyFrameCharacterInfo.TemperedFateText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ApexisCrystalText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.DarkmoonText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.InevitableFateText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.OilText:SetTextColor( r, g, b, a ) + else + --AJM.currencyFrameCharacterInfo[characterName] = nil + --table.wipe( AJM.currentCurrencyValues ) + --AJM.currencyFrameCharacterInfo = {} + end end AJM.currencyTotalGold = 0 if AJM.db.currGoldInGuildBank == true then @@ -2719,21 +2866,20 @@ function AJM:JambaToonRequestCurrency() end end AJM:JambaSendCommandToTeam( AJM.COMMAND_REQUEST_CURRENCY, "" ) + AJM.SettingsRefresh() end function AJM:DoSendCurrency( characterName, dummyValue ) table.wipe( AJM.currentCurrencyValues ) AJM.currentCurrencyValues.currGold = GetMoney() --- AJM.currentCurrencyValues.currJusticePoints = select( 2, GetCurrencyInfo( AJM.CJusticePoints ) ) --- AJM.currentCurrencyValues.currValorPoints = select( 2, GetCurrencyInfo( AJM.CValorPoints ) ) AJM.currentCurrencyValues.currHonorPoints = select( 2, GetCurrencyInfo( AJM.CHonorPoints ) ) AJM.currentCurrencyValues.currConquestPoints = select( 2, GetCurrencyInfo( AJM.CConquestPoints ) ) + AJM.currentCurrencyValues.currValor = select( 2, GetCurrencyInfo( AJM.CValor ) ) AJM.currentCurrencyValues.currTolBaradCommendation = select( 2, GetCurrencyInfo( AJM.CTolBaradCommendation ) ) AJM.currentCurrencyValues.currChampionsSeal = select( 2, GetCurrencyInfo(AJM.CChampionsSeal ) ) AJM.currentCurrencyValues.currIllustriousJewelcraftersToken = select( 2, GetCurrencyInfo( AJM.CIllustriousJewelcraftersToken ) ) AJM.currentCurrencyValues.currDalaranJewelcraftingToken = select( 2, GetCurrencyInfo( AJM.CDalaranJewelcraftingToken ) ) AJM.currentCurrencyValues.currIronpawToken = select( 2, GetCurrencyInfo( AJM.CIronpawToken ) ) - AJM.currentCurrencyValues.currEpicureansAward = select( 2, GetCurrencyInfo( AJM.CEpicureansAward ) ) AJM.currentCurrencyValues.currLesserCharmOfGoodFortune = select( 2, GetCurrencyInfo( AJM.CLesserCharmOfGoodFortune ) ) AJM.currentCurrencyValues.currElderCharmOfGoodFortune = select( 2, GetCurrencyInfo( AJM.CElderCharmOfGoodFortune ) ) AJM.currentCurrencyValues.currMoguRuneOfFate = select( 2, GetCurrencyInfo( AJM.CMoguRuneOfFate ) ) @@ -2745,10 +2891,15 @@ function AJM:DoSendCurrency( characterName, dummyValue ) AJM.currentCurrencyValues.currTemperedFate = select( 2, GetCurrencyInfo( AJM.CTemperedFate ) ) AJM.currentCurrencyValues.currApexisCrystal = select( 2, GetCurrencyInfo( AJM.CApexisCrystal ) ) AJM.currentCurrencyValues.currDarkmoon = select( 2, GetCurrencyInfo( AJM.CDarkmoon ) ) + AJM.currentCurrencyValues.currInevitableFate = select( 2, GetCurrencyInfo( AJM.CInevitableFate ) ) + AJM.currentCurrencyValues.currOil = select( 2, GetCurrencyInfo( AJM.COil ) ) + AJM.currentCurrencyValues.currTimeWalker = select( 2, GetCurrencyInfo( AJM.CTimeWalker ) ) AJM:JambaSendCommandToToon( characterName, AJM.COMMAND_HERE_IS_CURRENCY, AJM.currentCurrencyValues ) end function AJM:DoShowToonsCurrency( characterName, currencyValues ) + --AJM.Print("DoShowCurrency", characterName) + --if JambaPrivate.Team.GetCharacterOnlineStatus( characterName ) == true then local parentFrame = JambaToonCurrencyListFrame -- Get (or create and get) the character information. local currencyFrameCharacterInfo = AJM.currencyFrameCharacterInfo[characterName] @@ -2763,16 +2914,14 @@ function AJM:DoShowToonsCurrency( characterName, currencyValues ) local a = 1.0 currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.JusticePointsText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.ValorPointsText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.HonorPointsText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ConquestPointsText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.ValorText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.TolBaradCommendationText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ChampionsSealText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.IronpawTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.EpicureansAwardText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.MoguRuneOfFateText:SetTextColor( r, g, b, a ) @@ -2784,18 +2933,18 @@ function AJM:DoShowToonsCurrency( characterName, currencyValues ) currencyFrameCharacterInfo.TemperedFateText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.ApexisCrystalText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.DarkmoonText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.InevitableFateText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.OilText:SetTextColor( r, g, b, a ) -- Information. currencyFrameCharacterInfo.GoldText:SetText( JambaUtilities:FormatMoneyString( currencyValues.currGold ) ) --- currencyFrameCharacterInfo.JusticePointsText:SetText( currencyValues.currJusticePoints ) --- currencyFrameCharacterInfo.ValorPointsText:SetText( currencyValues.currValorPoints ) currencyFrameCharacterInfo.HonorPointsText:SetText( currencyValues.currHonorPoints ) currencyFrameCharacterInfo.ConquestPointsText:SetText( currencyValues.currConquestPoints ) + currencyFrameCharacterInfo.ValorText:SetText( currencyValues.currValor ) currencyFrameCharacterInfo.TolBaradCommendationText:SetText( currencyValues.currTolBaradCommendation ) currencyFrameCharacterInfo.ChampionsSealText:SetText( currencyValues.currChampionsSeal ) currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetText( currencyValues.currIllustriousJewelcraftersToken ) currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetText( currencyValues.currDalaranJewelcraftingToken ) currencyFrameCharacterInfo.IronpawTokenText:SetText( currencyValues.currIronpawToken ) - currencyFrameCharacterInfo.EpicureansAwardText:SetText( currencyValues.currEpicureansAward ) currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetText( currencyValues.currLesserCharmOfGoodFortune ) currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetText( currencyValues.currElderCharmOfGoodFortune ) currencyFrameCharacterInfo.MoguRuneOfFateText:SetText( currencyValues.currMoguRuneOfFate ) @@ -2807,6 +2956,9 @@ function AJM:DoShowToonsCurrency( characterName, currencyValues ) currencyFrameCharacterInfo.TemperedFateText:SetText( currencyValues.currTemperedFate ) currencyFrameCharacterInfo.ApexisCrystalText:SetText( currencyValues.currApexisCrystal ) currencyFrameCharacterInfo.DarkmoonText:SetText( currencyValues.currDarkmoon ) + currencyFrameCharacterInfo.InevitableFateText:SetText( currencyValues.currInevitableFate ) + currencyFrameCharacterInfo.OilText:SetText( currencyValues.currOil ) + currencyFrameCharacterInfo.TimeWalkerText:SetText( currencyValues.currTimeWalker ) -- Total gold. AJM.currencyTotalGold = AJM.currencyTotalGold + currencyValues.currGold parentFrame.TotalGoldText:SetText( JambaUtilities:FormatMoneyString( AJM.currencyTotalGold ) ) @@ -2816,6 +2968,7 @@ function AJM:DoShowToonsCurrency( characterName, currencyValues ) -- Update width of currency list. AJM:CurrencyListSetColumnWidth() JambaToonCurrencyListFrame:Show() + --end end -- A Jamba command has been received. @@ -2828,3 +2981,15 @@ function AJM:JambaOnCommandReceived( characterName, commandName, ... ) end end +local function test2() + JambaUtilities:ClearTable( AJM.currencyFrameCharacterInfo ) + --AJM:CreateJambaToonCurrencyListFrame() + AJM.Print("clearTable") +end + +local function test() + --for characterName, currencyFrameCharacterInfo in pairs( AJM.currencyFrameCharacterInfo ) do + return pairs( AJM.currencyFrameCharacterInfo) +end +JambaApi.test = test +JambaApi.test2 = test2 \ No newline at end of file diff --git a/Jamba-Toon/JambaToonx.lua b/Jamba-Toon/JambaToonx.lua deleted file mode 100644 index 80e0b23..0000000 --- a/Jamba-Toon/JambaToonx.lua +++ /dev/null @@ -1,2829 +0,0 @@ ---[[ -Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller -License: The MIT License -]]-- - --- Create the addon using AceAddon-3.0 and embed some libraries. -local AJM = LibStub( "AceAddon-3.0" ):NewAddon( - "JambaToon", - "JambaModule-1.0", - "AceConsole-3.0", - "AceEvent-3.0", - "AceTimer-3.0" -) - --- Get the Jamba Utilities Library. -local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" ) -local JambaHelperSettings = LibStub:GetLibrary( "JambaHelperSettings-1.0" ) -local LibBagUtils = LibStub:GetLibrary( "LibBagUtils-1.0" ) -AJM.SharedMedia = LibStub( "LibSharedMedia-3.0" ) - --- Constants and Locale for this module. -AJM.moduleName = "Jamba-Toon" -AJM.settingsDatabaseName = "JambaToonProfileDB" -AJM.chatCommand = "jamba-toon" -local L = LibStub( "AceLocale-3.0" ):GetLocale( AJM.moduleName ) -AJM.parentDisplayName = L["Toon"] -AJM.parentDisplayNameToon = L["Toon"] -AJM.parentDisplayNameMerchant = L["Merchant"] -AJM.parentDisplayNameCurrency = L["Toon"] -AJM.moduleDisplayName = L["Toon: Warnings"] - --- Currency Identifiers. -AJM.CDalaranJewelcraftingToken = 61 -AJM.CEpicureansAward = 81 -AJM.CChampionsSeal = 241 -AJM.CIllustriousJewelcraftersToken = 361 -AJM.CConquestPoints = 390 -AJM.CTolBaradCommendation = 391 -AJM.CHonorPoints = 392 ---AJM.CJusticePoints = 395 ---AJM.CValorPoints = 396 -AJM.CIronpawToken = 402 -AJM.CLesserCharmOfGoodFortune = 738 -AJM.CElderCharmOfGoodFortune = 697 -AJM.CMoguRuneOfFate = 752 -AJM.CWarforgedSeal = 776 -AJM.CBloodyCoin = 789 -AJM.CTimelessCoin = 777 ---ebony New WoD Currency -AJM.CGarrisonResources = 824 -AJM.CTemperedFate = 994 -AJM.CApexisCrystal = 823 -AJM.CDarkmoon = 515 -AJM.C = 824 -AJM.globalCurrencyFramePrefix = "JambaToonCurrencyListFrame" - --- Settings - the values to store and their defaults for the settings database. -AJM.settings = { - profile = { - warnHitFirstTimeCombat = false, - hitFirstTimeMessage = L["I'm Attacked!"], - warnTargetNotMasterEnterCombat = false, - warnTargetNotMasterMessage = L["Not Targeting!"], - warnFocusNotMasterEnterCombat = false, - warnFocusNotMasterMessage = L["Not Focus!"], - warnWhenHealthDropsBelowX = true, - warnWhenHealthDropsAmount = "60", - warnHealthDropsMessage = L["Low Health!"], - warnWhenManaDropsBelowX = true, - warnWhenManaDropsAmount = "30", - warnManaDropsMessage = L["Low Mana!"], - warnBagsFull = true, - bagsFullMessage = L["Bags Full!"], - warningArea = JambaApi.DefaultWarningArea(), - autoAcceptResurrectRequest = true, - autoDenyDuels = true, - autoAcceptSummonRequest = false, - autoDenyGuildInvites = false, - requestArea = JambaApi.DefaultMessageArea(), - autoRepair = true, - autoRepairUseGuildFunds = true, - merchantArea = JambaApi.DefaultMessageArea(), - warnAfk = true, - afkMessage = L["I am inactive!"], - currGold = true, - currGoldInGuildBank = false, --- currJusticePoints = true, --- currValorPoints = true, - currHonorPoints = true, - currConquestPoints = true, - --as there not used much now changed to false ebony - currTolBaradCommendation = false, - currChampionsSeal = false, - currIllustriousJewelcraftersToken = false, - currDalaranJewelcraftingToken = false, - currIronpawToken = false, - currEpicureansAward = false, - currLesserCharmOfGoodFortune = false, - currElderCharmOfGoodFortune = false, - currMoguRuneOfFate = false, - currWarforgedSeal = false, - currBloodyCoin = false, - currTimelessCoin = false, - --ebony New WoD Currency - currGarrisonResources = true, - currTemperedFate = false, - currApexisCrystal = false, - currDarkmoon = false, - currencyFrameAlpha = 1.0, - currencyFramePoint = "CENTER", - currencyFrameRelativePoint = "CENTER", - currencyFrameXOffset = 0, - currencyFrameYOffset = 0, - currencyFrameBackgroundColourR = 1.0, - currencyFrameBackgroundColourG = 1.0, - currencyFrameBackgroundColourB = 1.0, - currencyFrameBackgroundColourA = 1.0, - currencyFrameBorderColourR = 1.0, - currencyFrameBorderColourG = 1.0, - currencyFrameBorderColourB = 1.0, - currencyFrameBorderColourA = 1.0, - currencyBorderStyle = L["Blizzard Tooltip"], - currencyBackgroundStyle = L["Blizzard Dialog Background"], - currencyScale = 1, - currencyNameWidth = 50, - currencyPointsWidth = 40, - currencyGoldWidth = 90, - currencySpacingWidth = 3, - currencyLockWindow = false, - currOpenStartUpMaster = false, - }, -} - --- Configuration. -function AJM:GetConfiguration() - local configuration = { - name = AJM.moduleDisplayName, - handler = AJM, - type = 'group', - args = { - currency = { - type = "input", - name = L["Show Currency"], - desc = L["Show the current toon the currency values for all members in the team."], - usage = "/jamba-toon currency", - get = false, - set = "JambaToonRequestCurrency", - }, - currencyhide = { - type = "input", - name = L["Hide Currency"], - desc = L["Hide the currency values for all members in the team."], - usage = "/jamba-toon currencyhide", - get = false, - set = "JambaToonHideCurrency", - }, - push = { - type = "input", - name = L["Push Settings"], - desc = L["Push the toon settings to all characters in the team."], - usage = "/jamba-toon push", - get = false, - set = "JambaSendSettings", - }, - }, - } - return configuration -end - -local function DebugMessage( ... ) - --AJM:Print( ... ) -end - -------------------------------------------------------------------------------------------------------------- --- Command this module sends. -------------------------------------------------------------------------------------------------------------- - -AJM.COMMAND_REQUEST_CURRENCY = "SendCurrency" -AJM.COMMAND_HERE_IS_CURRENCY = "HereIsCurrency" - -------------------------------------------------------------------------------------------------------------- --- Messages module sends. -------------------------------------------------------------------------------------------------------------- - -------------------------------------------------------------------------------------------------------------- --- Settings Dialogs. -------------------------------------------------------------------------------------------------------------- - -local function SettingsCreateMerchant( top ) - -- Get positions. - local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() - local editBoxHeight = JambaHelperSettings:GetEditBoxHeight() - local dropdownHeight = JambaHelperSettings:GetDropdownHeight() - local labelHeight = JambaHelperSettings:GetLabelHeight() - local left = JambaHelperSettings:LeftOfSettings() - local headingHeight = JambaHelperSettings:HeadingHeight() - local headingWidth = JambaHelperSettings:HeadingWidth( false ) - local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing() - local verticalSpacing = JambaHelperSettings:GetVerticalSpacing() - local halfWidth = (headingWidth - horizontalSpacing) / 2 - local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 - local column2left = left + halfWidth - local left2 = left + thirdWidth - local left3 = left + (thirdWidth * 2) - local movingTop = top - JambaHelperSettings:CreateHeading( AJM.settingsControlMerchant, L["Merchant"], movingTop, false ) - movingTop = movingTop - headingHeight - AJM.settingsControlMerchant.checkBoxAutoRepair = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlMerchant, - headingWidth, - left, - movingTop, - L["Auto Repair"], - AJM.SettingsToggleAutoRepair - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlMerchant, - headingWidth, - left, - movingTop, - L["Auto Repair With Guild Funds"], - AJM.SettingsToggleAutoRepairUseGuildFunds - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlMerchant.dropdownMerchantArea = JambaHelperSettings:CreateDropdown( - AJM.settingsControlMerchant, - headingWidth, - left, - movingTop, - L["Send Request Message Area"] - ) - AJM.settingsControlMerchant.dropdownMerchantArea:SetList( JambaApi.MessageAreaList() ) - AJM.settingsControlMerchant.dropdownMerchantArea:SetCallback( "OnValueChanged", AJM.SettingsSetMerchantArea ) - movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop -end - -function AJM:OnMessageAreasChanged( message ) - AJM.settingsControlMerchant.dropdownMerchantArea:SetList( JambaApi.MessageAreaList() ) - AJM.settingsControlRequests.dropdownRequestArea:SetList( JambaApi.MessageAreaList() ) - AJM.settingsControlWarnings.dropdownWarningArea:SetList( JambaApi.MessageAreaList() ) -end - -local function SettingsCreateRequests( top ) - -- Get positions. - local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() - local editBoxHeight = JambaHelperSettings:GetEditBoxHeight() - local dropdownHeight = JambaHelperSettings:GetDropdownHeight() - local labelHeight = JambaHelperSettings:GetLabelHeight() - local left = JambaHelperSettings:LeftOfSettings() - local headingHeight = JambaHelperSettings:HeadingHeight() - local headingWidth = JambaHelperSettings:HeadingWidth( false ) - local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing() - local verticalSpacing = JambaHelperSettings:GetVerticalSpacing() - local halfWidth = (headingWidth - horizontalSpacing) / 2 - local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 - local column2left = left + halfWidth - local left2 = left + thirdWidth - local left3 = left + (thirdWidth * 2) - local movingTop = top - JambaHelperSettings:CreateHeading( AJM.settingsControlRequests, L["Requests"], movingTop, false ) - movingTop = movingTop - headingHeight - AJM.settingsControlRequests.checkBoxAutoDenyDuels = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlRequests, - headingWidth, - left, - movingTop, - L["Auto Deny Duels"], - AJM.SettingsToggleAutoDenyDuels - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlRequests.checkBoxAutoDenyGuildInvites = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlRequests, - headingWidth, - left, - movingTop, - L["Auto Deny Guild Invites"], - AJM.SettingsToggleAutoDenyGuildInvites - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlRequests.checkBoxAutoAcceptResurrectRequest = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlRequests, - headingWidth, - left, - movingTop, - L["Auto Accept Resurrect Request"], - AJM.SettingsToggleAutoAcceptResurrectRequests - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlRequests.checkBoxautoAcceptSummonRequest = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlRequests, - headingWidth, - left, - movingTop, - L["Auto Accept Summon Request"], - AJM.SettingsToggleAutoAcceptSummonRequest - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlRequests.dropdownRequestArea = JambaHelperSettings:CreateDropdown( - AJM.settingsControlRequests, - headingWidth, - left, - movingTop, - L["Send Request Message Area"] - ) - AJM.settingsControlRequests.dropdownRequestArea:SetList( JambaApi.MessageAreaList() ) - AJM.settingsControlRequests.dropdownRequestArea:SetCallback( "OnValueChanged", AJM.SettingsSetRequestArea ) - movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop -end - -local function SettingsCreateCurrency( top ) - -- Get positions. - local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() - local sliderHeight = JambaHelperSettings:GetSliderHeight() - local mediaHeight = JambaHelperSettings:GetMediaHeight() - local editBoxHeight = JambaHelperSettings:GetEditBoxHeight() - local buttonHeight = JambaHelperSettings:GetButtonHeight() - local dropdownHeight = JambaHelperSettings:GetDropdownHeight() - local labelHeight = JambaHelperSettings:GetLabelHeight() - local left = JambaHelperSettings:LeftOfSettings() - local headingHeight = JambaHelperSettings:HeadingHeight() - local headingWidth = JambaHelperSettings:HeadingWidth( true ) - local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing() - local verticalSpacing = JambaHelperSettings:GetVerticalSpacing() - local halfWidth = (headingWidth - horizontalSpacing) / 2 - local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 - local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 - local column2left = left + halfWidthSlider - local left2 = left + thirdWidth - local left3 = left + (thirdWidth * 2) - local movingTop = top - JambaHelperSettings:CreateHeading( AJM.settingsControlCurrency, L["Currency Selection"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlCurrency.checkBoxCurrencyGold = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Gold"], - AJM.SettingsToggleCurrencyGold - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyGoldInGuildBank = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Include Gold In Guild Bank"], - AJM.SettingsToggleCurrencyGoldInGuildBank - ) - movingTop = movingTop - checkBoxHeight --- AJM.settingsControlCurrency.checkBoxCurrencyJusticePoints = JambaHelperSettings:CreateCheckBox( --- AJM.settingsControlCurrency, --- headingWidth, --- left, --- movingTop, --- L["Justice Points"]..L[" ("]..L["JP"]..L[")"], --- AJM.SettingsToggleCurrencyJusticePoints --- ) --- movingTop = movingTop - checkBoxHeight --- AJM.settingsControlCurrency.checkBoxCurrencyValorPoints = JambaHelperSettings:CreateCheckBox( --- AJM.settingsControlCurrency, --- headingWidth, --- left, --- movingTop, --- L["Valor Points"]..L[" ("]..L["VP"]..L[")"], --- AJM.SettingsToggleCurrencyValorPoints --- ) --- movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyHonorPoints = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Honor Points"]..L[" ("]..L["HP"]..L[")"], - AJM.SettingsToggleCurrencyHonorPoints - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyConquestPoints = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Conquest Points"]..L[" ("]..L["CP"]..L[")"], - AJM.SettingsToggleCurrencyConquestPoints - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyTolBaradCommendation = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Tol Barad Commendation"]..L[" ("]..L["TBC"]..L[")"], - AJM.SettingsToggleCurrencyTolBaradCommendation - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyChampionsSeal = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Champion's Seal"]..L[" ("]..L["CS"]..L[")"], - AJM.SettingsToggleCurrencyChampionsSeal - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyIllustriousJewelcraftersToken = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Illustrious Jewelcrafter's Token"]..L[" ("]..L["IJT"]..L[")"], - AJM.SettingsToggleCurrencyIllustriousJewelcraftersToken - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyDalaranJewelcraftingToken = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Dalaran Jewelcrafting Token"]..L[" ("]..L["DJT"]..L[")"], - AJM.SettingsToggleCurrencyDalaranJewelcraftingToken - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyIronpawToken = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Ironpaw Token"]..L[" ("]..L["IT"]..L[")"], - AJM.SettingsToggleCurrencyIronpawToken - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyEpicureansAward = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Epicurean's Award"]..L[" ("]..L["EA"]..L[")"], - AJM.SettingsToggleCurrencyEpicureansAward - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyLesserCharmOfGoodFortune = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Lesser Charm of Good Fortune"]..L[" ("]..L["LCGF"]..L[")"], - AJM.SettingsToggleCurrencyLesserCharmOfGoodFortune - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyElderCharmOfGoodFortune = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Elder Charm of Good Fortune"]..L[" ("]..L["ECGF"]..L[")"], - AJM.SettingsToggleCurrencyElderCharmOfGoodFortune - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyMoguRuneOfFate = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Mogu Rune Of Fate"]..L[" ("]..L["MROF"]..L[")"], - AJM.SettingsToggleCurrencyMoguRuneOfFate - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyWarforgedSeal = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Warforged Seal"]..L[" ("]..L["WS"]..L[")"], - AJM.SettingsToggleCurrencyWarforgedSeal - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyBloodyCoin = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Bloody Coin"]..L[" ("]..L["BC"]..L[")"], - AJM.SettingsToggleCurrencyBloodyCoin - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyTimelessCoin = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Timeless Coin"]..L[" ("]..L["TC"]..L[")"], - AJM.SettingsToggleCurrencyTimelessCoin - ) - --ebony New WoD Currency - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyGarrisonResources = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Garrison Resources"]..L[" ("]..L["GR"]..L[")"], - AJM.SettingsToggleCurrencyGarrisonResources - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyTemperedFate = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Seal of Tempered Fate"]..L[" ("]..L["SoF"]..L[")"], - AJM.SettingsToggleCurrencyTemperedFate - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyApexisCrystal = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Apexis Crystal"]..L[" ("]..L["AC"]..L[")"], - AJM.SettingsToggleCurrencyApexisCrystal - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.checkBoxCurrencyDarkmoon = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Darkmoon Prize Ticket "]..L[" ("]..L["DPT"]..L[")"], - AJM.SettingsToggleCurrencyDarkmoon - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.currencyButtonShowList = JambaHelperSettings:CreateButton( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Show Currency"], - AJM.JambaToonRequestCurrency - ) - movingTop = movingTop - buttonHeight - AJM.settingsControlCurrency.checkBoxCurrencyOpenStartUpMaster = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Open Currency List On Start Up (Master Only)"], - AJM.SettingsToggleCurrencyOpenStartUpMaster - ) - movingTop = movingTop - checkBoxHeight - -- Create appearance & layout. - JambaHelperSettings:CreateHeading( AJM.settingsControlCurrency, L["Appearance & Layout"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlCurrency.checkBoxCurrencyLockWindow = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Lock Currency List (enables mouse click-through)"], - AJM.SettingsToggleCurrencyLockWindow - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlCurrency.currencyScaleSlider = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Scale"] - ) - AJM.settingsControlCurrency.currencyScaleSlider:SetSliderValues( 0.5, 2, 0.01 ) - AJM.settingsControlCurrency.currencyScaleSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeScale ) - movingTop = movingTop - sliderHeight - verticalSpacing - AJM.settingsControlCurrency.currencyTransparencySlider = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Transparency"] - ) - AJM.settingsControlCurrency.currencyTransparencySlider:SetSliderValues( 0, 1, 0.01 ) - AJM.settingsControlCurrency.currencyTransparencySlider:SetCallback( "OnValueChanged", AJM.SettingsChangeTransparency ) - movingTop = movingTop - sliderHeight - verticalSpacing - AJM.settingsControlCurrency.currencyMediaBorder = JambaHelperSettings:CreateMediaBorder( - AJM.settingsControlCurrency, - halfWidthSlider, - left, - movingTop, - L["Border Style"] - ) - AJM.settingsControlCurrency.currencyMediaBorder:SetCallback( "OnValueChanged", AJM.SettingsChangeBorderStyle ) - AJM.settingsControlCurrency.currencyBorderColourPicker = JambaHelperSettings:CreateColourPicker( - AJM.settingsControlCurrency, - halfWidthSlider, - column2left + 15, - movingTop - 15, - L["Border Colour"] - ) - AJM.settingsControlCurrency.currencyBorderColourPicker:SetHasAlpha( true ) - AJM.settingsControlCurrency.currencyBorderColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsBorderColourPickerChanged ) - movingTop = movingTop - mediaHeight - verticalSpacing - AJM.settingsControlCurrency.currencyMediaBackground = JambaHelperSettings:CreateMediaBackground( - AJM.settingsControlCurrency, - halfWidthSlider, - left, - movingTop, - L["Background"] - ) - AJM.settingsControlCurrency.currencyMediaBackground:SetCallback( "OnValueChanged", AJM.SettingsChangeBackgroundStyle ) - AJM.settingsControlCurrency.currencyBackgroundColourPicker = JambaHelperSettings:CreateColourPicker( - AJM.settingsControlCurrency, - halfWidthSlider, - column2left + 15, - movingTop - 15, - L["Background Colour"] - ) - AJM.settingsControlCurrency.currencyBackgroundColourPicker:SetHasAlpha( true ) - AJM.settingsControlCurrency.currencyBackgroundColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsBackgroundColourPickerChanged ) - movingTop = movingTop - mediaHeight - verticalSpacing - AJM.settingsControlCurrency.currencySliderSpaceForName = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Space For Name"] - ) - AJM.settingsControlCurrency.currencySliderSpaceForName:SetSliderValues( 20, 200, 1 ) - AJM.settingsControlCurrency.currencySliderSpaceForName:SetCallback( "OnValueChanged", AJM.SettingsChangeSliderSpaceForName ) - movingTop = movingTop - sliderHeight - verticalSpacing - AJM.settingsControlCurrency.currencySliderSpaceForGold = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Space For Gold"] - ) - AJM.settingsControlCurrency.currencySliderSpaceForGold:SetSliderValues( 20, 200, 1 ) - AJM.settingsControlCurrency.currencySliderSpaceForGold:SetCallback( "OnValueChanged", AJM.SettingsChangeSliderSpaceForGold ) - movingTop = movingTop - sliderHeight - verticalSpacing - AJM.settingsControlCurrency.currencySliderSpaceForPoints = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Space For Points"] - ) - AJM.settingsControlCurrency.currencySliderSpaceForPoints:SetSliderValues( 20, 200, 1 ) - AJM.settingsControlCurrency.currencySliderSpaceForPoints:SetCallback( "OnValueChanged", AJM.SettingsChangeSliderSpaceForPoints ) - movingTop = movingTop - sliderHeight - verticalSpacing - AJM.settingsControlCurrency.currencySliderSpaceBetweenValues = JambaHelperSettings:CreateSlider( - AJM.settingsControlCurrency, - headingWidth, - left, - movingTop, - L["Space Between Values"] - ) - AJM.settingsControlCurrency.currencySliderSpaceBetweenValues:SetSliderValues( 0, 20, 1 ) - AJM.settingsControlCurrency.currencySliderSpaceBetweenValues:SetCallback( "OnValueChanged", AJM.SettingsChangeSliderSpaceBetweenValues ) - movingTop = movingTop - sliderHeight - verticalSpacing - return movingTop -end - -local function SettingsCreateWarnings( top ) - -- Get positions. - local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight() - local editBoxHeight = JambaHelperSettings:GetEditBoxHeight() - local dropdownHeight = JambaHelperSettings:GetDropdownHeight() - local labelHeight = JambaHelperSettings:GetLabelHeight() - local left = JambaHelperSettings:LeftOfSettings() - local headingHeight = JambaHelperSettings:HeadingHeight() - local headingWidth = JambaHelperSettings:HeadingWidth( true ) - local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing() - local verticalSpacing = JambaHelperSettings:GetVerticalSpacing() - local halfWidth = (headingWidth - horizontalSpacing) / 2 - local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 - local column2left = left + halfWidth - local left2 = left + thirdWidth - local left3 = left + (thirdWidth * 2) - local movingTop = top - JambaHelperSettings:CreateHeading( AJM.settingsControlWarnings, L["Combat"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlWarnings.checkBoxWarnHitFirstTimeCombat = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If Hit First Time In Combat (Slave)"], - AJM.SettingsToggleWarnHitFirstTimeCombat - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxHitFirstTimeMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Hit First Time Message"] - ) - AJM.settingsControlWarnings.editBoxHitFirstTimeMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedHitFirstTimeMessage ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.checkBoxWarnTargetNotMasterEnterCombat = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If Target Not Master On Combat (Slave)"], - AJM.SettingsToggleWarnTargetNotMasterEnterCombat - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxWarnTargetNotMasterMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn Target Not Master Message"] - ) - AJM.settingsControlWarnings.editBoxWarnTargetNotMasterMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnTargetNotMasterMessage ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.checkBoxWarnFocusNotMasterEnterCombat = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If Focus Not Master On Combat (Slave)"], - AJM.SettingsToggleWarnFocusNotMasterEnterCombat - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxWarnFocusNotMasterMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn Focus Not Master Message"] - ) - AJM.settingsControlWarnings.editBoxWarnFocusNotMasterMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnFocusNotMasterMessage ) - movingTop = movingTop - editBoxHeight - JambaHelperSettings:CreateHeading( AJM.settingsControlWarnings, L["Health / Mana"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlWarnings.checkBoxWarnWhenHealthDropsBelowX = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If My Health Drops Below"], - AJM.SettingsToggleWarnWhenHealthDropsBelowX - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxWarnWhenHealthDropsAmount = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Health Amount - Percentage Allowed Before Warning"] - ) - AJM.settingsControlWarnings.editBoxWarnWhenHealthDropsAmount:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnWhenHealthDropsAmount ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.editBoxWarnHealthDropsMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn Health Drop Message"] - ) - AJM.settingsControlWarnings.editBoxWarnHealthDropsMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnHealthDropsMessage ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.checkBoxWarnWhenManaDropsBelowX = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If My Mana Drops Below"], - AJM.SettingsToggleWarnWhenManaDropsBelowX - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxWarnWhenManaDropsAmount = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Mana Amount - Percentage Allowed Before Warning"] - ) - AJM.settingsControlWarnings.editBoxWarnWhenManaDropsAmount:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnWhenManaDropsAmount ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.editBoxWarnManaDropsMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn Mana Drop Message"] - ) - AJM.settingsControlWarnings.editBoxWarnManaDropsMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedWarnManaDropsMessage ) - movingTop = movingTop - editBoxHeight - JambaHelperSettings:CreateHeading( AJM.settingsControlWarnings, L["Bag Space"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlWarnings.checkBoxWarnBagsFull = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If All Regular Bags Are Full"], - AJM.SettingsToggleWarnBagsFull - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxBagsFullMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Bags Full Message"] - ) - AJM.settingsControlWarnings.editBoxBagsFullMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedBagsFullMessage ) - movingTop = movingTop - editBoxHeight - JambaHelperSettings:CreateHeading( AJM.settingsControlWarnings, L["Inactive"], movingTop, true ) - movingTop = movingTop - headingHeight - AJM.settingsControlWarnings.checkBoxWarnAfk = JambaHelperSettings:CreateCheckBox( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Warn If Toon Goes Inactive (PVP)"], - AJM.SettingsToggleWarnAfk - ) - movingTop = movingTop - checkBoxHeight - AJM.settingsControlWarnings.editBoxAfkMessage = JambaHelperSettings:CreateEditBox( AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Inactive Message"] - ) - AJM.settingsControlWarnings.editBoxAfkMessage:SetCallback( "OnEnterPressed", AJM.EditBoxChangedAfkMessage ) - movingTop = movingTop - editBoxHeight - AJM.settingsControlWarnings.dropdownWarningArea = JambaHelperSettings:CreateDropdown( - AJM.settingsControlWarnings, - headingWidth, - left, - movingTop, - L["Send Warning Area"] - ) - AJM.settingsControlWarnings.dropdownWarningArea:SetList( JambaApi.MessageAreaList() ) - AJM.settingsControlWarnings.dropdownWarningArea:SetCallback( "OnValueChanged", AJM.SettingsSetWarningArea ) - movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop -end - -local function SettingsCreate() - AJM.settingsControlWarnings = {} - AJM.settingsControlRequests = {} - AJM.settingsControlMerchant = {} - AJM.settingsControlCurrency = {} - JambaHelperSettings:CreateSettings( - AJM.settingsControlWarnings, - AJM.moduleDisplayName, - AJM.parentDisplayNameToon, - AJM.SettingsPushSettingsClick - ) - JambaHelperSettings:CreateSettings( - AJM.settingsControlRequests, - L["Toon"]..L[": "]..L["Requests"], - AJM.parentDisplayNameToon, - AJM.SettingsPushSettingsClick - ) - JambaHelperSettings:CreateSettings( - AJM.settingsControlMerchant, - L["Toon"]..L[": "]..L["Merchant"], - AJM.parentDisplayNameMerchant, - AJM.SettingsPushSettingsClick - ) - JambaHelperSettings:CreateSettings( - AJM.settingsControlCurrency, - L["Toon"]..L[": "]..L["Currency"], - AJM.parentDisplayNameCurrency, - AJM.SettingsPushSettingsClick - ) - local bottomOfWarnings = SettingsCreateWarnings( JambaHelperSettings:TopOfSettings() ) - AJM.settingsControlWarnings.widgetSettings.content:SetHeight( -bottomOfWarnings ) - local bottomOfRequests = SettingsCreateRequests( JambaHelperSettings:TopOfSettings() ) - AJM.settingsControlRequests.widgetSettings.content:SetHeight( -bottomOfRequests ) - local bottomOfMerchant = SettingsCreateMerchant( JambaHelperSettings:TopOfSettings() ) - AJM.settingsControlMerchant.widgetSettings.content:SetHeight( -bottomOfMerchant ) - local bottomOfCurrency = SettingsCreateCurrency( JambaHelperSettings:TopOfSettings() ) - AJM.settingsControlCurrency.widgetSettings.content:SetHeight( -bottomOfCurrency ) - -- Help - local helpTable = {} - JambaHelperSettings:CreateHelp( AJM.settingsControlWarnings, helpTable, AJM:GetConfiguration() ) -end - -------------------------------------------------------------------------------------------------------------- --- Settings Populate. -------------------------------------------------------------------------------------------------------------- - -function AJM:BeforeJambaProfileChanged() -end - -function AJM:OnJambaProfileChanged() - AJM:SettingsRefresh() -end - -function AJM:SettingsRefresh() - AJM.settingsControlWarnings.checkBoxWarnHitFirstTimeCombat:SetValue( AJM.db.warnHitFirstTimeCombat ) - AJM.settingsControlWarnings.editBoxHitFirstTimeMessage:SetText( AJM.db.hitFirstTimeMessage ) - AJM.settingsControlWarnings.checkBoxWarnTargetNotMasterEnterCombat:SetValue( AJM.db.warnTargetNotMasterEnterCombat ) - AJM.settingsControlWarnings.editBoxWarnTargetNotMasterMessage:SetText( AJM.db.warnTargetNotMasterMessage ) - AJM.settingsControlWarnings.checkBoxWarnFocusNotMasterEnterCombat:SetValue( AJM.db.warnFocusNotMasterEnterCombat ) - AJM.settingsControlWarnings.editBoxWarnFocusNotMasterMessage:SetText( AJM.db.warnFocusNotMasterMessage ) - AJM.settingsControlWarnings.checkBoxWarnWhenHealthDropsBelowX:SetValue( AJM.db.warnWhenHealthDropsBelowX ) - AJM.settingsControlWarnings.editBoxWarnWhenHealthDropsAmount:SetText( AJM.db.warnWhenHealthDropsAmount ) - AJM.settingsControlWarnings.editBoxWarnHealthDropsMessage:SetText( AJM.db.warnHealthDropsMessage ) - AJM.settingsControlWarnings.checkBoxWarnWhenManaDropsBelowX:SetValue( AJM.db.warnWhenManaDropsBelowX ) - AJM.settingsControlWarnings.editBoxWarnWhenManaDropsAmount:SetText( AJM.db.warnWhenManaDropsAmount ) - AJM.settingsControlWarnings.editBoxWarnManaDropsMessage:SetText( AJM.db.warnManaDropsMessage ) - AJM.settingsControlWarnings.checkBoxWarnBagsFull:SetValue( AJM.db.warnBagsFull ) - AJM.settingsControlWarnings.editBoxBagsFullMessage:SetText( AJM.db.bagsFullMessage ) - AJM.settingsControlWarnings.checkBoxWarnAfk:SetValue( AJM.db.warnAfk ) - AJM.settingsControlWarnings.editBoxAfkMessage:SetText( AJM.db.afkMessage ) - AJM.settingsControlWarnings.dropdownWarningArea:SetValue( AJM.db.warningArea ) - AJM.settingsControlRequests.checkBoxAutoAcceptResurrectRequest:SetValue( AJM.db.autoAcceptResurrectRequest ) - AJM.settingsControlRequests.checkBoxAutoDenyDuels:SetValue( AJM.db.autoDenyDuels ) - --ebonysum - AJM.settingsControlRequests.checkBoxautoAcceptSummonRequest:SetValue( AJM.db.autoAcceptSummonRequest ) - AJM.settingsControlRequests.checkBoxAutoDenyGuildInvites:SetValue( AJM.db.autoDenyGuildInvites ) - AJM.settingsControlRequests.dropdownRequestArea:SetValue( AJM.db.requestArea ) - AJM.settingsControlMerchant.checkBoxAutoRepair:SetValue( AJM.db.autoRepair ) - AJM.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetValue( AJM.db.autoRepairUseGuildFunds ) - AJM.settingsControlMerchant.dropdownMerchantArea:SetValue( AJM.db.merchantArea ) - AJM.settingsControlWarnings.editBoxHitFirstTimeMessage:SetDisabled( not AJM.db.warnHitFirstTimeCombat ) - AJM.settingsControlWarnings.editBoxWarnTargetNotMasterMessage:SetDisabled( not AJM.db.warnTargetNotMasterEnterCombat ) - AJM.settingsControlWarnings.editBoxWarnFocusNotMasterMessage:SetDisabled( not AJM.db.warnFocusNotMasterEnterCombat ) - AJM.settingsControlWarnings.editBoxWarnWhenHealthDropsAmount:SetDisabled( not AJM.db.warnWhenHealthDropsBelowX ) - AJM.settingsControlWarnings.editBoxWarnHealthDropsMessage:SetDisabled( not AJM.db.warnWhenHealthDropsBelowX ) - AJM.settingsControlWarnings.editBoxWarnWhenManaDropsAmount:SetDisabled( not AJM.db.warnWhenManaDropsBelowX ) - AJM.settingsControlWarnings.editBoxWarnManaDropsMessage:SetDisabled( not AJM.db.warnWhenManaDropsBelowX ) - AJM.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetDisabled( not AJM.db.autoRepair ) - AJM.settingsControlWarnings.editBoxBagsFullMessage:SetDisabled( not AJM.db.warnBagsFull ) - AJM.settingsControlWarnings.editBoxAfkMessage:SetDisabled( not AJM.db.warnAfk ) - AJM.settingsControlCurrency.checkBoxCurrencyGold:SetValue( AJM.db.currGold ) - AJM.settingsControlCurrency.checkBoxCurrencyGoldInGuildBank:SetValue( AJM.db.currGoldInGuildBank ) - AJM.settingsControlCurrency.checkBoxCurrencyGoldInGuildBank:SetDisabled( not AJM.db.currGold ) --- AJM.settingsControlCurrency.checkBoxCurrencyJusticePoints:SetValue( AJM.db.currJusticePoints ) --- AJM.settingsControlCurrency.checkBoxCurrencyValorPoints:SetValue( AJM.db.currValorPoints ) - AJM.settingsControlCurrency.checkBoxCurrencyHonorPoints:SetValue( AJM.db.currHonorPoints ) - AJM.settingsControlCurrency.checkBoxCurrencyConquestPoints:SetValue( AJM.db.currConquestPoints ) - AJM.settingsControlCurrency.checkBoxCurrencyTolBaradCommendation:SetValue( AJM.db.currTolBaradCommendation ) - AJM.settingsControlCurrency.checkBoxCurrencyChampionsSeal:SetValue( AJM.db.currChampionsSeal ) - AJM.settingsControlCurrency.checkBoxCurrencyIllustriousJewelcraftersToken:SetValue( AJM.db.currIllustriousJewelcraftersToken ) - AJM.settingsControlCurrency.checkBoxCurrencyDalaranJewelcraftingToken:SetValue( AJM.db.currDalaranJewelcraftingToken ) - AJM.settingsControlCurrency.checkBoxCurrencyIronpawToken:SetValue( AJM.db.currIronpawToken ) - AJM.settingsControlCurrency.checkBoxCurrencyEpicureansAward:SetValue( AJM.db.currEpicureansAward ) - AJM.settingsControlCurrency.checkBoxCurrencyLesserCharmOfGoodFortune:SetValue( AJM.db.currLesserCharmOfGoodFortune ) - AJM.settingsControlCurrency.checkBoxCurrencyElderCharmOfGoodFortune:SetValue( AJM.db.currElderCharmOfGoodFortune ) - AJM.settingsControlCurrency.checkBoxCurrencyMoguRuneOfFate:SetValue( AJM.db.currMoguRuneOfFate ) - AJM.settingsControlCurrency.checkBoxCurrencyWarforgedSeal:SetValue( AJM.db.currWarforgedSeal ) - AJM.settingsControlCurrency.checkBoxCurrencyBloodyCoin:SetValue( AJM.db.currBloodyCoin ) - AJM.settingsControlCurrency.checkBoxCurrencyTimelessCoin:SetValue( AJM.db.currTimelessCoin ) - --ebony New WoD Currency - AJM.settingsControlCurrency.checkBoxCurrencyGarrisonResources:SetValue( AJM.db.currGarrisonResources ) - AJM.settingsControlCurrency.checkBoxCurrencyTemperedFate:SetValue( AJM.db.currTemperedFate ) - AJM.settingsControlCurrency.checkBoxCurrencyApexisCrystal:SetValue( AJM.db.currApexisCrystal ) - AJM.settingsControlCurrency.checkBoxCurrencyDarkmoon:SetValue( AJM.db.currDarkmoon ) - AJM.settingsControlCurrency.checkBoxCurrencyOpenStartUpMaster:SetValue( AJM.db.currOpenStartUpMaster ) - AJM.settingsControlCurrency.currencyTransparencySlider:SetValue( AJM.db.currencyFrameAlpha ) - AJM.settingsControlCurrency.currencyScaleSlider:SetValue( AJM.db.currencyScale ) - AJM.settingsControlCurrency.currencyMediaBorder:SetValue( AJM.db.currencyBorderStyle ) - AJM.settingsControlCurrency.currencyMediaBackground:SetValue( AJM.db.currencyBackgroundStyle ) - AJM.settingsControlCurrency.currencyBackgroundColourPicker:SetColor( AJM.db.currencyFrameBackgroundColourR, AJM.db.currencyFrameBackgroundColourG, AJM.db.currencyFrameBackgroundColourB, AJM.db.currencyFrameBackgroundColourA ) - AJM.settingsControlCurrency.currencyBorderColourPicker:SetColor( AJM.db.currencyFrameBorderColourR, AJM.db.currencyFrameBorderColourG, AJM.db.currencyFrameBorderColourB, AJM.db.currencyFrameBorderColourA ) - AJM.settingsControlCurrency.currencySliderSpaceForName:SetValue( AJM.db.currencyNameWidth ) - AJM.settingsControlCurrency.currencySliderSpaceForGold:SetValue( AJM.db.currencyGoldWidth ) - AJM.settingsControlCurrency.currencySliderSpaceForPoints:SetValue( AJM.db.currencyPointsWidth ) - AJM.settingsControlCurrency.currencySliderSpaceBetweenValues:SetValue( AJM.db.currencySpacingWidth ) - AJM.settingsControlCurrency.checkBoxCurrencyLockWindow:SetValue( AJM.db.currencyLockWindow ) - if AJM.currencyListFrameCreated == true then - AJM:CurrencyListSetColumnWidth() - AJM:CurrencyListSetHeight() - AJM:SettingsUpdateBorderStyle() - AJM:CurrencyUpdateWindowLock() - JambaToonCurrencyListFrame:SetScale( AJM.db.currencyScale ) - end -end - -function AJM:SettingsPushSettingsClick( event ) - AJM:JambaSendSettings() -end - -function AJM:SettingsToggleAutoRepair( event, checked ) - AJM.db.autoRepair = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleAutoRepairUseGuildFunds( event, checked ) - AJM.db.autoRepairUseGuildFunds = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleAutoDenyDuels( event, checked ) - AJM.db.autoDenyDuels = checked - AJM:SettingsRefresh() -end - ---ebonysum -function AJM:SettingsautoAcceptSummonRequest( event, checked ) - AJM.db.autoAcceptSummonRequest = checked - AJM:SettingsRefresh() -end - - -function AJM:SettingsToggleAutoDenyGuildInvites( event, checked ) - AJM.db.autoDenyGuildInvites = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleAutoAcceptResurrectRequests( event, checked ) - AJM.db.autoAcceptResurrectRequest = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnHitFirstTimeCombat( event, checked ) - AJM.db.warnHitFirstTimeCombat = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedHitFirstTimeMessage( event, text ) - AJM.db.hitFirstTimeMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnBagsFull( event, checked ) - AJM.db.warnBagsFull = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedBagsFullMessage( event, text ) - AJM.db.bagsFullMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnAfk( event, checked ) - AJM.db.warnAfk = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedAfkMessage( event, text ) - AJM.db.afkMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnTargetNotMasterEnterCombat( event, checked ) - AJM.db.warnTargetNotMasterEnterCombat = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnTargetNotMasterMessage( event, text ) - AJM.db.warnTargetNotMasterMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnFocusNotMasterEnterCombat( event, checked ) - AJM.db.warnFocusNotMasterEnterCombat = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnFocusNotMasterMessage( event, text ) - AJM.db.warnFocusNotMasterMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnWhenHealthDropsBelowX( event, checked ) - AJM.db.warnWhenHealthDropsBelowX = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnWhenHealthDropsAmount( event, text ) - local amount = tonumber( text ) - amount = JambaUtilities:FixValueToRange( amount, 0, 100 ) - AJM.db.warnWhenHealthDropsAmount = tostring( amount ) - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnHealthDropsMessage( event, text ) - AJM.db.warnHealthDropsMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleWarnWhenManaDropsBelowX( event, checked ) - AJM.db.warnWhenManaDropsBelowX = checked - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnWhenManaDropsAmount( event, text ) - local amount = tonumber( text ) - amount = JambaUtilities:FixValueToRange( amount, 0, 100 ) - AJM.db.warnWhenManaDropsAmount = tostring( amount ) - AJM:SettingsRefresh() -end - -function AJM:EditBoxChangedWarnManaDropsMessage( event, text ) - AJM.db.warnManaDropsMessage = text - AJM:SettingsRefresh() -end - -function AJM:SettingsSetWarningArea( event, value ) - AJM.db.warningArea = value - AJM:SettingsRefresh() -end - -function AJM:SettingsSetRequestArea( event, value ) - AJM.db.requestArea = value - AJM:SettingsRefresh() -end - -function AJM:SettingsSetMerchantArea( event, value ) - AJM.db.merchantArea = value - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyGold( event, checked ) - AJM.db.currGold = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyGoldInGuildBank( event, checked ) - AJM.db.currGoldInGuildBank = checked - AJM:SettingsRefresh() -end - ---function AJM:SettingsToggleCurrencyJusticePoints( event, checked ) --- AJM.db.currJusticePoints = checked --- AJM:SettingsRefresh() ---end --- ---function AJM:SettingsToggleCurrencyValorPoints( event, checked ) --- AJM.db.currValorPoints = checked --- AJM:SettingsRefresh() ---end - -function AJM:SettingsToggleCurrencyHonorPoints( event, checked ) - AJM.db.currHonorPoints = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyConquestPoints( event, checked ) - AJM.db.currConquestPoints = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyTolBaradCommendation( event, checked ) - AJM.db.currTolBaradCommendation = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyChampionsSeal( event, checked ) - AJM.db.currChampionsSeal = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyIllustriousJewelcraftersToken( event, checked ) - AJM.db.currIllustriousJewelcraftersToken = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyDalaranJewelcraftingToken( event, checked ) - AJM.db.currDalaranJewelcraftingToken = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyIronpawToken( event, checked ) - AJM.db.currIronpawToken = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyEpicureansAward( event, checked ) - AJM.db.currEpicureansAward = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyLesserCharmOfGoodFortune( event, checked ) - AJM.db.currLesserCharmOfGoodFortune = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyElderCharmOfGoodFortune( event, checked ) - AJM.db.currElderCharmOfGoodFortune = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyMoguRuneOfFate( event, checked ) - AJM.db.currMoguRuneOfFate = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyWarforgedSeal( event, checked ) - AJM.db.currWarforgedSeal = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyBloodyCoin( event, checked ) - AJM.db.currBloodyCoin = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyTimelessCoin( event, checked ) - AJM.db.currTimelessCoin = checked - AJM:SettingsRefresh() -end - ---ebony New WoD Currency -function AJM:SettingsToggleCurrencyGarrisonResources ( event, checked ) - AJM.db.currGarrisonResources = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyTemperedFate ( event, checked ) - AJM.db.currTemperedFate = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyApexisCrystal ( event, checked ) - AJM.db.currApexisCrystal = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyDarkmoon ( event, checked ) - AJM.db.currDarkmoon = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyOpenStartUpMaster( event, checked ) - AJM.db.currOpenStartUpMaster = checked - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeScale( event, value ) - AJM.db.currencyScale = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeTransparency( event, value ) - AJM.db.currencyFrameAlpha = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeBorderStyle( event, value ) - AJM.db.currencyBorderStyle = value - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeBackgroundStyle( event, value ) - AJM.db.currencyBackgroundStyle = value - AJM:SettingsRefresh() -end - -function AJM:SettingsBackgroundColourPickerChanged( event, r, g, b, a ) - AJM.db.currencyFrameBackgroundColourR = r - AJM.db.currencyFrameBackgroundColourG = g - AJM.db.currencyFrameBackgroundColourB = b - AJM.db.currencyFrameBackgroundColourA = a - AJM:SettingsRefresh() -end - -function AJM:SettingsBorderColourPickerChanged( event, r, g, b, a ) - AJM.db.currencyFrameBorderColourR = r - AJM.db.currencyFrameBorderColourG = g - AJM.db.currencyFrameBorderColourB = b - AJM.db.currencyFrameBorderColourA = a - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeSliderSpaceForName( event, value ) - AJM.db.currencyNameWidth = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeSliderSpaceForGold( event, value ) - AJM.db.currencyGoldWidth = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeSliderSpaceForPoints( event, value ) - AJM.db.currencyPointsWidth = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsChangeSliderSpaceBetweenValues( event, value ) - AJM.db.currencySpacingWidth = tonumber( value ) - AJM:SettingsRefresh() -end - -function AJM:SettingsToggleCurrencyLockWindow( event, checked ) - AJM.db.currencyLockWindow = checked - AJM:CurrencyUpdateWindowLock() - AJM:SettingsRefresh() -end - -------------------------------------------------------------------------------------------------------------- --- Addon initialization, enabling and disabling. -------------------------------------------------------------------------------------------------------------- - --- Initialise the module. -function AJM:OnInitialize() - AJM.currencyTotalGold = 0 - AJM.currencyListFrameCreated = false - AJM.currencyFrameCharacterInfo = {} - AJM.currentCurrencyValues = {} - -- Create the settings control. - SettingsCreate() - -- Initialise the JambaModule part of this module. - AJM:JambaModuleInitialize( AJM.settingsControlWarnings.widgetSettings.frame ) - -- Populate the settings. - AJM:SettingsRefresh() - -- Create the currency list frame. - AJM:CreateJambaToonCurrencyListFrame() - -- Flag set when told the master about health falling below a certain percentage. - AJM.toldMasterAboutHealth = false - -- Flag set when told the master about mana falling below a certain percentage. - AJM.toldMasterAboutMana = false - -- Have been hit flag. - AJM.haveBeenHit = false - -- Bags full changed count. - AJM.previousFreeBagSlotsCount = -1 -end - --- Called when the addon is enabled. -function AJM:OnEnable() - -- WoW events. - AJM:RegisterEvent( "UNIT_COMBAT" ) - AJM:RegisterEvent( "PLAYER_REGEN_DISABLED" ) - AJM:RegisterEvent( "PLAYER_REGEN_ENABLED" ) - AJM:RegisterEvent( "UNIT_HEALTH" ) - AJM:RegisterEvent( "MERCHANT_SHOW" ) - AJM:RegisterEvent( "UNIT_MANA" ) - AJM:RegisterEvent( "RESURRECT_REQUEST" ) - AJM:RegisterEvent( "CONFIRM_SUMMON") - AJM:RegisterEvent( "DUEL_REQUESTED" ) - AJM:RegisterEvent( "GUILD_INVITE_REQUEST" ) - AJM:RegisterEvent( "ITEM_PUSH" ) - AJM:RegisterEvent( "UI_ERROR_MESSAGE", "ITEM_PUSH" ) - AJM:RegisterEvent( "UNIT_AURA" ) - AJM:RegisterMessage( JambaApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) - if AJM.db.currOpenStartUpMaster == true then - if JambaApi.IsCharacterTheMaster( self.characterName ) == true then - AJM:ScheduleTimer( "JambaToonRequestCurrency", 2 ) - end - end -end - --- Called when the addon is disabled. -function AJM:OnDisable() -end - --- Settings received. -function AJM:JambaOnSettingsReceived( characterName, settings ) - if characterName ~= AJM.characterName then - -- Update the settings. - AJM.db.warnHitFirstTimeCombat = settings.warnHitFirstTimeCombat - AJM.db.hitFirstTimeMessage = settings.hitFirstTimeMessage - AJM.db.warnTargetNotMasterEnterCombat = settings.warnTargetNotMasterEnterCombat - AJM.db.warnTargetNotMasterMessage = settings.warnTargetNotMasterMessage - AJM.db.warnFocusNotMasterEnterCombat = settings.warnFocusNotMasterEnterCombat - AJM.db.warnFocusNotMasterMessage = settings.warnFocusNotMasterMessage - AJM.db.warnWhenHealthDropsBelowX = settings.warnWhenHealthDropsBelowX - AJM.db.warnWhenHealthDropsAmount = settings.warnWhenHealthDropsAmount - AJM.db.warnHealthDropsMessage = settings.warnHealthDropsMessage - AJM.db.warnWhenManaDropsBelowX = settings.warnWhenManaDropsBelowX - AJM.db.warnWhenManaDropsAmount = settings.warnWhenManaDropsAmount - AJM.db.warnManaDropsMessage = settings.warnManaDropsMessage - AJM.db.warnBagsFull = settings.warnBagsFull - AJM.db.bagsFullMessage = settings.bagsFullMessage - AJM.db.warnAfk = settings.warnAfk - AJM.db.afkMessage = settings.afkMessage - AJM.db.autoAcceptResurrectRequest = settings.autoAcceptResurrectRequest - AJM.db.autoDenyDuels = settings.autoDenyDuels --- ebonnysum - AJM.db.autoAcceptSummonRequest = settings.AcceptSummonRequest - AJM.db.autoDenyGuildInvites = settings.autoDenyGuildInvites - AJM.db.autoRepair = settings.autoRepair - AJM.db.autoRepairUseGuildFunds = settings.autoRepairUseGuildFunds - AJM.db.warningArea = settings.warningArea - AJM.db.requestArea = settings.requestArea - AJM.db.merchantArea = settings.merchantArea - AJM.db.currGold = settings.currGold - AJM.db.currGoldInGuildBank = settings.currGoldInGuildBank --- AJM.db.currJusticePoints = settings.currJusticePoints --- AJM.db.currValorPoints = settings.currValorPoints - AJM.db.currHonorPoints = settings.currHonorPoints - AJM.db.currConquestPoints = settings.currConquestPoints - AJM.db.currTolBaradCommendation = settings.currTolBaradCommendation - AJM.db.currChampionsSeal = settings.currChampionsSeal - AJM.db.currIllustriousJewelcraftersToken = settings.currIllustriousJewelcraftersToken - AJM.db.currDalaranJewelcraftingToken = settings.currDalaranJewelcraftingToken - AJM.db.currIronpawToken = settings.currIronpawToken - AJM.db.currEpicureansAward = settings.currEpicureansAward - AJM.db.currLesserCharmOfGoodFortune = settings.currLesserCharmOfGoodFortune - AJM.db.currElderCharmOfGoodFortune = settings.currElderCharmOfGoodFortune - AJM.db.currMoguRuneOfFate = settings.currMoguRuneOfFate - AJM.db.currWarforgedSeal = settings.currWarforgedSeal - AJM.db.currBloodyCoin = settings.currBloodyCoin - AJM.db.currTimelessCoin = settings.currTimelessCoin - --ebony New WoD Currency - AJM.db.currGarrisonResources = settings.currGarrisonResources - AJM.db.currTemperedFate = settings.currTemperedFate - AJM.db.currApexisCrystal = settings.currApexisCrystal - AJM.db.currApexisCrystal = settings.currDarkmoon - AJM.db.currOpenStartUpMaster = settings.currOpenStartUpMaster - AJM.db.currencyScale = settings.currencyScale - AJM.db.currencyFrameAlpha = settings.currencyFrameAlpha - AJM.db.currencyFramePoint = settings.currencyFramePoint - AJM.db.currencyFrameRelativePoint = settings.currencyFrameRelativePoint - AJM.db.currencyFrameXOffset = settings.currencyFrameXOffset - AJM.db.currencyFrameYOffset = settings.currencyFrameYOffset - AJM.db.currencyFrameBackgroundColourR = settings.currencyFrameBackgroundColourR - AJM.db.currencyFrameBackgroundColourG = settings.currencyFrameBackgroundColourG - AJM.db.currencyFrameBackgroundColourB = settings.currencyFrameBackgroundColourB - AJM.db.currencyFrameBackgroundColourA = settings.currencyFrameBackgroundColourA - AJM.db.currencyFrameBorderColourR = settings.currencyFrameBorderColourR - AJM.db.currencyFrameBorderColourG = settings.currencyFrameBorderColourG - AJM.db.currencyFrameBorderColourB = settings.currencyFrameBorderColourB - AJM.db.currencyFrameBorderColourA = settings.currencyFrameBorderColourA - AJM.db.currencyNameWidth = settings.currencyNameWidth - AJM.db.currencyPointsWidth = settings.currencyPointsWidth - AJM.db.currencyGoldWidth = settings.currencyGoldWidth - AJM.db.currencySpacingWidth = settings.currencySpacingWidth - AJM.db.currencyLockWindow = settings.currencyLockWindow - -- Refresh the settings. - AJM:SettingsRefresh() - -- Tell the player. - AJM:Print( L["Settings received from A."]( characterName ) ) - end -end - -function AJM:UNIT_COMBAT( event, unitAffected, action ) - if AJM.db.warnHitFirstTimeCombat == false then - return - end - if JambaApi.IsCharacterTheMaster( self.characterName ) == true then - return - end - if InCombatLockdown() then - if unitAffected == "player" and action ~= "HEAL" and not AJM.haveBeenHit then - AJM.haveBeenHit = true - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.hitFirstTimeMessage, false ) - end - end -end - -function AJM:GUILD_INVITE_REQUEST( event, inviter, guild, ... ) - if AJM.db.autoDenyGuildInvites == true then - DeclineGuild() - GuildInviteFrame:Hide() - AJM:JambaSendMessageToTeam( AJM.db.requestArea, L["I refused a guild invite to: X from: Y"]( guild, inviter ), false ) - end -end - -function AJM:DUEL_REQUESTED( event, challenger, ... ) - if AJM.db.autoDenyDuels == true then - CancelDuel() - StaticPopup_Hide( "DUEL_REQUESTED" ) - AJM:JambaSendMessageToTeam( AJM.db.requestArea, L["I refused a duel from: X"]( challenger ), false ) - end -end - -function AJM:RESURRECT_REQUEST( event, ... ) - if AJM.db.autoAcceptResurrectRequest == true then - AcceptResurrect() - StaticPopup_Hide( "RESURRECT") - StaticPopup_Hide( "RESURRECT_NO_SICKNESS" ) - StaticPopup_Hide( "RESURRECT_NO_TIMER" ) - StaticPopup_Hide( "SKINNED" ) - StaticPopup_Hide( "SKINNED_REPOP" ) - StaticPopup_Hide( "DEATH" ) - end -end - --- EbonySum Accepts summons - -function AJM:CONFIRM_SUMMON( event, Summoner, ... ) - if AJM.db.autoAcceptSummonRequest == true then - if GetSummonConfirmTimeLeft() > 0 then - ConfirmSummon() - StaticPopup_Hide("CONFIRM_SUMMON") - AJM:JambaSendMessageToTeam( AJM.db.requestArea, L["I Accepted Summon From: X"]( Summoner ), false ) - end - end -end - -function AJM:MERCHANT_SHOW( event, ... ) - -- Does the user want to auto repair? - if AJM.db.autoRepair == false then - return - end - -- Can this merchant repair? - if not CanMerchantRepair() then - return - end - -- How much to repair? - local repairCost, canRepair = GetRepairAllCost() - if canRepair == nil then - return - end - -- At least some cost... - if repairCost > 0 then - -- If allowed to use guild funds, then attempt to repair using guild funds. - if AJM.db.autoRepairUseGuildFunds == true then - if IsInGuild() and CanGuildBankRepair() then - RepairAllItems( 1 ) - end - end - -- After guild funds used, still need to repair? - repairCost = GetRepairAllCost() - -- At least some cost... - if repairCost > 0 then - -- How much money available? - local moneyAvailable = GetMoney() - -- More or equal money than cost? - if moneyAvailable >= repairCost then - -- Yes, repair. - RepairAllItems() - else - -- Nope, tell the boss. - AJM:JambaSendMessageToTeam( AJM.db.merchantArea, L["I do not have enough money to repair all my items."], false ) - end - end - end - if repairCost > 0 then - -- Tell the boss how much that cost. - local costString = JambaUtilities:FormatMoneyString( repairCost ) - AJM:JambaSendMessageToTeam( AJM.db.merchantArea, L["Repairing cost me: X"]( costString ), false ) - end -end - -function AJM:UNIT_MANA( event, unitAffected, ... ) - if AJM.db.warnWhenManaDropsBelowX == false then - return - end - if unitAffected ~= "player" then - return - end - local powerType, powerTypeString = UnitPowerType( "player" ) - if powerTypeString ~= "MANA" then - return - end - local currentMana = (UnitMana( "player" ) / UnitManaMax( "player" ) * 100) - if AJM.toldMasterAboutMana == true then - if currentMana >= tonumber( AJM.db.warnWhenManaDropsAmount ) then - AJM.toldMasterAboutMana = false - end - else - if currentMana < tonumber( AJM.db.warnWhenManaDropsAmount ) then - AJM.toldMasterAboutMana = true - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnManaDropsMessage, false ) - end - end -end - -function AJM:UNIT_HEALTH( event, unitAffected, ... ) - if AJM.db.warnWhenHealthDropsBelowX == false then - return - end - if unitAffected ~= "player" then - return - end - local currentHealth = (UnitHealth( "player" ) / UnitHealthMax( "player" ) * 100) - if AJM.toldMasterAboutHealth == true then - if currentHealth >= tonumber( AJM.db.warnWhenHealthDropsAmount ) then - AJM.toldMasterAboutHealth = false - end - else - if currentHealth < tonumber( AJM.db.warnWhenHealthDropsAmount ) then - AJM.toldMasterAboutHealth = true - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnHealthDropsMessage, false ) - end - end -end - -function AJM:PLAYER_REGEN_ENABLED( event, ... ) - AJM.haveBeenHit = false -end - -function AJM:PLAYER_REGEN_DISABLED( event, ... ) - AJM.haveBeenHit = false - if AJM.db.warnTargetNotMasterEnterCombat == true then - if JambaApi.IsCharacterTheMaster( AJM.characterName ) == false then - if UnitName( "target" ) ~= JambaApi.GetMasterName() then - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnTargetNotMasterMessage, false ) - end - end - end - if AJM.db.warnFocusNotMasterEnterCombat == true then - if JambaApi.IsCharacterTheMaster( AJM.characterName ) == false then - if UnitName( "focus" ) ~= JambaApi.GetMasterName() then - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.warnFocusNotMasterMessage, false ) - end - end - end -end - -function AJM:ITEM_PUSH( event, ... ) - if AJM.db.warnBagsFull == true then - if UnitIsGhost( "player" ) then - return - end - if UnitIsDead( "player" ) then - return - end - local numberFreeSlots, numberTotalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) - if numberFreeSlots == 0 then - if AJM.previousFreeBagSlotsCount ~= numberFreeSlots then - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.bagsFullMessage, false ) - end - end - AJM.previousFreeBagSlotsCount = numberFreeSlots - end -end - -function AJM:UNIT_AURA( event, ... ) - if AJM.db.warnAfk == true then - if JambaUtilities:DoesThisCharacterHaveBuff( L["Inactive"] ) == true then - AJM:JambaSendMessageToTeam( AJM.db.warningArea, AJM.db.afkMessage, false ) - end - end -end - -function AJM:CreateJambaToonCurrencyListFrame() - -- The frame. - local frame = CreateFrame( "Frame", "JambaToonCurrencyListWindowFrame", UIParent ) - frame.obj = AJM - frame:SetFrameStrata( "BACKGROUND" ) - frame:SetToplevel( false ) - frame:SetClampedToScreen( true ) - frame:EnableMouse( true ) - frame:SetMovable( true ) - frame:RegisterForDrag( "LeftButton" ) - frame:SetScript( "OnDragStart", - function( this ) - if IsAltKeyDown() then - this:StartMoving() - end - end ) - frame:SetScript( "OnDragStop", - function( this ) - this:StopMovingOrSizing() - local point, relativeTo, relativePoint, xOffset, yOffset = this:GetPoint() - AJM.db.currencyFramePoint = point - AJM.db.currencyFrameRelativePoint = relativePoint - AJM.db.currencyFrameXOffset = xOffset - AJM.db.currencyFrameYOffset = yOffset - end ) - frame:SetWidth( 500 ) - frame:SetHeight( 200 ) - frame:ClearAllPoints() - frame:SetPoint( AJM.db.currencyFramePoint, UIParent, AJM.db.currencyFrameRelativePoint, AJM.db.currencyFrameXOffset, AJM.db.currencyFrameYOffset ) - frame:SetBackdrop( { - bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", - edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", - tile = true, tileSize = 10, edgeSize = 10, - insets = { left = 3, right = 3, top = 3, bottom = 3 } - } ) - - -- Create the title for the frame. - local titleName = frame:CreateFontString( "JambaToonCurrencyListWindowFrameTitleText", "OVERLAY", "GameFontNormal" ) - titleName:SetPoint( "TOPLEFT", frame, "TOPLEFT", 3, -8 ) - titleName:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) - titleName:SetText( L["Currency"] ) - titleName:SetWidth( 200 ) - titleName:SetJustifyH( "LEFT" ) - titleName:SetWordWrap( false ) - frame.titleName = titleName - - -- Create the headings. - local left = 10 - local spacing = 50 - local width = 50 - local top = -30 - local parentFrame = frame - local r = 1.0 - local g = 0.96 - local b = 0.41 - local a = 1.0 - -- Set the characters name font string. - local frameCharacterName = AJM.globalCurrencyFramePrefix.."TitleCharacterName" - local frameCharacterNameText = parentFrame:CreateFontString( frameCharacterName.."Text", "OVERLAY", "GameFontNormal" ) - frameCharacterNameText:SetText( L["Toon"] ) - frameCharacterNameText:SetTextColor( r, g, b, a ) - frameCharacterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameCharacterNameText:SetWidth( width * 2.5 ) - frameCharacterNameText:SetJustifyH( "LEFT" ) - frame.characterNameText = frameCharacterNameText - left = left + (spacing * 2) - -- Set the Gold font string. - local frameGold = AJM.globalCurrencyFramePrefix.."TitleGold" - local frameGoldText = parentFrame:CreateFontString( frameGold.."Text", "OVERLAY", "GameFontNormal" ) - frameGoldText:SetText( L["Gold"] ) - frameGoldText:SetTextColor( r, g, b, a ) - frameGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameGoldText:SetWidth( width ) - frameGoldText:SetJustifyH( "CENTER" ) - frame.GoldText = frameGoldText - left = left + spacing --- -- Set the JusticePoints font string. --- local frameJusticePoints = AJM.globalCurrencyFramePrefix.."TitleJusticePoints" --- local frameJusticePointsText = parentFrame:CreateFontString( frameJusticePoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameJusticePointsText:SetText( L["JP"] ) --- frameJusticePointsText:SetTextColor( r, g, b, a ) --- frameJusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameJusticePointsText:SetWidth( width ) --- frameJusticePointsText:SetJustifyH( "CENTER" ) --- frame.JusticePointsText = frameJusticePointsText --- left = left + spacing --- -- Set the ValorPoints font string. --- local frameValorPoints = AJM.globalCurrencyFramePrefix.."TitleValorPoints" --- local frameValorPointsText = parentFrame:CreateFontString( frameValorPoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameValorPointsText:SetText( L["VP"] ) --- frameValorPointsText:SetTextColor( r, g, b, a ) --- frameValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameValorPointsText:SetWidth( width ) --- frameValorPointsText:SetJustifyH( "CENTER" ) --- frame.ValorPointsText = frameValorPointsText --- left = left + spacing - -- Set the HonorPoints font string. - local frameHonorPoints = AJM.globalCurrencyFramePrefix.."TitleHonorPoints" - local frameHonorPointsText = parentFrame:CreateFontString( frameHonorPoints.."Text", "OVERLAY", "GameFontNormal" ) - frameHonorPointsText:SetText( L["HP"] ) - frameHonorPointsText:SetTextColor( r, g, b, a ) - frameHonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameHonorPointsText:SetWidth( width ) - frameHonorPointsText:SetJustifyH( "CENTER" ) - frame.HonorPointsText = frameHonorPointsText - left = left + spacing - -- Set the ConquestPoints font string. - local frameConquestPoints = AJM.globalCurrencyFramePrefix.."TitleConquestPoints" - local frameConquestPointsText = parentFrame:CreateFontString( frameConquestPoints.."Text", "OVERLAY", "GameFontNormal" ) - frameConquestPointsText:SetText( L["CP"] ) - frameConquestPointsText:SetTextColor( r, g, b, a ) - frameConquestPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameConquestPointsText:SetWidth( width ) - frameConquestPointsText:SetJustifyH( "CENTER" ) - frame.ConquestPointsText = frameConquestPointsText - left = left + spacing - -- Set the TolBaradCommendation font string. - local frameTolBaradCommendation = AJM.globalCurrencyFramePrefix.."TitleTolBaradCommendation" - local frameTolBaradCommendationText = parentFrame:CreateFontString( frameTolBaradCommendation.."Text", "OVERLAY", "GameFontNormal" ) - frameTolBaradCommendationText:SetText( L["TBC"] ) - frameTolBaradCommendationText:SetTextColor( r, g, b, a ) - frameTolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTolBaradCommendationText:SetWidth( width ) - frameTolBaradCommendationText:SetJustifyH( "CENTER" ) - frame.TolBaradCommendationText = frameTolBaradCommendationText - left = left + spacing - -- Set the ChampionsSeal font string. - local frameChampionsSeal = AJM.globalCurrencyFramePrefix.."TitleChampionsSeal" - local frameChampionsSealText = parentFrame:CreateFontString( frameChampionsSeal.."Text", "OVERLAY", "GameFontNormal" ) - frameChampionsSealText:SetText( L["CS"] ) - frameChampionsSealText:SetTextColor( r, g, b, a ) - frameChampionsSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameChampionsSealText:SetWidth( width ) - frameChampionsSealText:SetJustifyH( "CENTER" ) - frame.ChampionsSealText = frameChampionsSealText - left = left + spacing - -- Set the IllustriousJewelcraftersToken font string. - local frameIllustriousJewelcraftersToken = AJM.globalCurrencyFramePrefix.."TitleIllustriousJewelcraftersToken" - local frameIllustriousJewelcraftersTokenText = parentFrame:CreateFontString( frameIllustriousJewelcraftersToken.."Text", "OVERLAY", "GameFontNormal" ) - frameIllustriousJewelcraftersTokenText:SetText( L["IJT"] ) - frameIllustriousJewelcraftersTokenText:SetTextColor( r, g, b, a ) - frameIllustriousJewelcraftersTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameIllustriousJewelcraftersTokenText:SetWidth( width ) - frameIllustriousJewelcraftersTokenText:SetJustifyH( "CENTER" ) - frame.IllustriousJewelcraftersTokenText = frameIllustriousJewelcraftersTokenText - left = left + spacing - -- Set the DalaranJewelcraftingToken font string. - local frameDalaranJewelcraftingToken = AJM.globalCurrencyFramePrefix.."TitleDalaranJewelcraftingToken" - local frameDalaranJewelcraftingTokenText = parentFrame:CreateFontString( frameDalaranJewelcraftingToken.."Text", "OVERLAY", "GameFontNormal" ) - frameDalaranJewelcraftingTokenText:SetText( L["DJT"] ) - frameDalaranJewelcraftingTokenText:SetTextColor( r, g, b, a ) - frameDalaranJewelcraftingTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameDalaranJewelcraftingTokenText:SetWidth( width ) - frameDalaranJewelcraftingTokenText:SetJustifyH( "CENTER" ) - frame.DalaranJewelcraftingTokenText = frameDalaranJewelcraftingTokenText - left = left + spacing - -- Set the IronpawToken font string. - local frameIronpawToken = AJM.globalCurrencyFramePrefix.."TitleIronpawToken" - local frameIronpawTokenText = parentFrame:CreateFontString( frameIronpawToken.."Text", "OVERLAY", "GameFontNormal" ) - frameIronpawTokenText:SetText( L["IT"] ) - frameIronpawTokenText:SetTextColor( r, g, b, a ) - frameIronpawTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameIronpawTokenText:SetWidth( width ) - frameIronpawTokenText:SetJustifyH( "CENTER" ) - frame.IronpawTokenText = frameIronpawTokenText - left = left + spacing - -- Set the EpicureansAward font string. - local frameEpicureansAward = AJM.globalCurrencyFramePrefix.."TitleEpicureansAward" - local frameEpicureansAwardText = parentFrame:CreateFontString( frameEpicureansAward.."Text", "OVERLAY", "GameFontNormal" ) - frameEpicureansAwardText:SetText( L["EA"] ) - frameEpicureansAwardText:SetTextColor( r, g, b, a ) - frameEpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameEpicureansAwardText:SetWidth( width ) - frameEpicureansAwardText:SetJustifyH( "CENTER" ) - frame.EpicureansAwardText = frameEpicureansAwardText - left = left + spacing - -- Set the LesserCharmOfGoodFortune font string. - local frameLesserCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."TitleLesserCharmOfGoodFortune" - local frameLesserCharmOfGoodFortuneText = parentFrame:CreateFontString( frameLesserCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) - frameLesserCharmOfGoodFortuneText:SetText( L["LCGF"] ) - frameLesserCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - frameLesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameLesserCharmOfGoodFortuneText:SetWidth( width ) - frameLesserCharmOfGoodFortuneText:SetJustifyH( "CENTER" ) - frame.LesserCharmOfGoodFortuneText = frameLesserCharmOfGoodFortuneText - left = left + spacing - -- Set the ElderCharmOfGoodFortune font string. - local frameElderCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."TitleElderCharmOfGoodFortune" - local frameElderCharmOfGoodFortuneText = parentFrame:CreateFontString( frameElderCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) - frameElderCharmOfGoodFortuneText:SetText( L["ECGF"] ) - frameElderCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - frameElderCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameElderCharmOfGoodFortuneText:SetWidth( width ) - frameElderCharmOfGoodFortuneText:SetJustifyH( "CENTER" ) - frame.ElderCharmOfGoodFortuneText = frameElderCharmOfGoodFortuneText - left = left + spacing - -- Set the MoguRuneOfFate font string. - local frameMoguRuneOfFate = AJM.globalCurrencyFramePrefix.."TitleMoguRuneOfFate" - local frameMoguRuneOfFateText = parentFrame:CreateFontString( frameMoguRuneOfFate.."Text", "OVERLAY", "GameFontNormal" ) - frameMoguRuneOfFateText:SetText( L["MROF"] ) - frameMoguRuneOfFateText:SetTextColor( r, g, b, a ) - frameMoguRuneOfFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameMoguRuneOfFateText:SetWidth( width ) - frameMoguRuneOfFateText:SetJustifyH( "CENTER" ) - frame.MoguRuneOfFateText = frameMoguRuneOfFateText - left = left + spacing - -- Set the WarforgedSeal font string. - local frameWarforgedSeal = AJM.globalCurrencyFramePrefix.."TitleWarforgedSeal" - local frameWarforgedSealText = parentFrame:CreateFontString( frameWarforgedSeal.."Text", "OVERLAY", "GameFontNormal" ) - frameWarforgedSealText:SetText( L["WS"] ) - frameWarforgedSealText:SetTextColor( r, g, b, a ) - frameWarforgedSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameWarforgedSealText:SetWidth( width ) - frameWarforgedSealText:SetJustifyH( "CENTER" ) - frame.WarforgedSealText = frameWarforgedSealText - left = left + spacing - -- Set the BloodyCoin font string. - local frameBloodyCoin = AJM.globalCurrencyFramePrefix.."TitleBloodyCoin" - local frameBloodyCoinText = parentFrame:CreateFontString( frameBloodyCoin.."Text", "OVERLAY", "GameFontNormal" ) - frameBloodyCoinText:SetText( L["BC"] ) - frameBloodyCoinText:SetTextColor( r, g, b, a ) - frameBloodyCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameBloodyCoinText:SetWidth( width ) - frameBloodyCoinText:SetJustifyH( "CENTER" ) - frame.BloodyCoinText = frameBloodyCoinText - left = left + spacing - -- Set the TimelessCoin font string. - local frameTimelessCoin = AJM.globalCurrencyFramePrefix.."TitleTimelessCoin" - local frameTimelessCoinText = parentFrame:CreateFontString( frameTimelessCoin.."Text", "OVERLAY", "GameFontNormal" ) - frameTimelessCoinText:SetText( L["TC"] ) - frameTimelessCoinText:SetTextColor( r, g, b, a ) - frameTimelessCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTimelessCoinText:SetWidth( width ) - frameTimelessCoinText:SetJustifyH( "CENTER" ) - frame.TimelessCoinText = frameTimelessCoinText - left = left + spacing - --ebony New WoD Currency - -- Set the GarrisonResources font string. - local frameGarrisonResources = AJM.globalCurrencyFramePrefix.."TitleGarrisonResources" - local frameGarrisonResourcesText = parentFrame:CreateFontString( frameGarrisonResources .."Text", "OVERLAY", "GameFontNormal" ) - frameGarrisonResourcesText:SetText( L["GR"] ) - frameGarrisonResourcesText:SetTextColor( r, g, b, a ) - frameGarrisonResourcesText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameGarrisonResourcesText:SetWidth( width ) - frameGarrisonResourcesText:SetJustifyH( "CENTER" ) - frame.GarrisonResourcesText = frameGarrisonResourcesText - left = left + spacing - -- Set the Tempered Fate font string. - local frameTemperedFate = AJM.globalCurrencyFramePrefix.."TitleTemperedFate" - local frameTemperedFateText = parentFrame:CreateFontString( frameTemperedFate .."Text", "OVERLAY", "GameFontNormal" ) - frameTemperedFateText:SetText( L["SoF"] ) - frameTemperedFateText:SetTextColor( r, g, b, a ) - frameTemperedFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTemperedFateText:SetWidth( width ) - frameTemperedFateText:SetJustifyH( "CENTER" ) - frame.TemperedFateText = frameTemperedFateText - left = left + spacing - -- Set the Apexis Crystal font string. - local frameApexisCrystal = AJM.globalCurrencyFramePrefix.."TitleApexisCrystal" - local frameApexisCrystalText = parentFrame:CreateFontString( frameApexisCrystal .."Text", "OVERLAY", "GameFontNormal" ) - frameApexisCrystalText:SetText( L["AC"] ) - frameApexisCrystalText:SetTextColor( r, g, b, a ) - frameApexisCrystalText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameApexisCrystalText:SetWidth( width ) - frameApexisCrystalText:SetJustifyH( "CENTER" ) - frame.ApexisCrystalText = frameApexisCrystalText - left = left + spacing - -- Set the Darkmoon Prize font string. - local frameDarkmoon = AJM.globalCurrencyFramePrefix.."TitleDarkmoon" - local frameDarkmoonText = parentFrame:CreateFontString( frameDarkmoon .."Text", "OVERLAY", "GameFontNormal" ) - frameDarkmoonText:SetText( L["DPT"] ) - frameDarkmoonText:SetTextColor( r, g, b, a ) - frameDarkmoonText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameDarkmoonText:SetWidth( width ) - frameDarkmoonText:SetJustifyH( "CENTER" ) - frame.DarkmoonText = frameDarkmoonText - left = left + spacing - -- Set the Total Gold font string. - left = 10 - top = -50 - local frameTotalGoldTitle = AJM.globalCurrencyFramePrefix.."TitleTotalGold" - local frameTotalGoldTitleText = parentFrame:CreateFontString( frameTotalGoldTitle.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldTitleText:SetText( L["Total"] ) - frameTotalGoldTitleText:SetTextColor( r, g, b, a ) - frameTotalGoldTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldTitleText:SetWidth( width ) - frameTotalGoldTitleText:SetJustifyH( "LEFT" ) - frame.TotalGoldTitleText = frameTotalGoldTitleText - - local frameTotalGoldGuildTitle = AJM.globalCurrencyFramePrefix.."TitleTotalGoldGuild" - local frameTotalGoldGuildTitleText = parentFrame:CreateFontString( frameTotalGoldGuildTitle.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldGuildTitleText:SetText( L["Guild"] ) - frameTotalGoldGuildTitleText:SetTextColor( r, g, b, a ) - frameTotalGoldGuildTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldGuildTitleText:SetWidth( width ) - frameTotalGoldGuildTitleText:SetJustifyH( "LEFT" ) - frame.TotalGoldGuildTitleText = frameTotalGoldGuildTitleText - - local frameTotalGold = AJM.globalCurrencyFramePrefix.."TotalGold" - local frameTotalGoldText = parentFrame:CreateFontString( frameTotalGold.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldText:SetText( "0" ) - frameTotalGoldText:SetTextColor( r, g, b, a ) - frameTotalGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldText:SetWidth( width ) - frameTotalGoldText:SetJustifyH( "RIGHT" ) - frame.TotalGoldText = frameTotalGoldText - - local frameTotalGoldGuild = AJM.globalCurrencyFramePrefix.."TotalGoldGuild" - local frameTotalGoldGuildText = parentFrame:CreateFontString( frameTotalGoldGuild.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldGuildText:SetText( "0" ) - frameTotalGoldGuildText:SetTextColor( r, g, b, a ) - frameTotalGoldGuildText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldGuildText:SetWidth( width ) - frameTotalGoldGuildText:SetJustifyH( "RIGHT" ) - frame.TotalGoldGuildText = frameTotalGoldGuildText - - -- Set frame width. - frame:SetWidth( left + 10 ) - - -- Set transparency of the the frame (and all its children). - frame:SetAlpha( AJM.db.currencyFrameAlpha ) - - -- Set scale. - frame:SetScale( AJM.db.currencyScale ) - - -- Set the global frame reference for this frame. - JambaToonCurrencyListFrame = frame - - -- Close. - local closeButton = CreateFrame( "Button", AJM.globalCurrencyFramePrefix.."ButtonClose", frame, "UIPanelCloseButton" ) - closeButton:SetScript( "OnClick", function() JambaToonCurrencyListFrame:Hide() end ) - closeButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", 0, 0 ) - frame.closeButton = closeButton - - -- Update. - local updateButton = CreateFrame( "Button", AJM.globalCurrencyFramePrefix.."ButtonUpdate", frame, "UIPanelButtonTemplate" ) - updateButton:SetScript( "OnClick", function() AJM:JambaToonRequestCurrency() end ) - updateButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", -30, -4 ) - updateButton:SetHeight( 22 ) - updateButton:SetWidth( 55 ) - updateButton:SetText( L["Update"] ) - frame.updateButton = updateButton - - AJM:CurrencyListSetHeight() - AJM:SettingsUpdateBorderStyle() - AJM:CurrencyUpdateWindowLock() - JambaToonCurrencyListFrame:Hide() - AJM.currencyListFrameCreated = true -end - -function AJM:CurrencyUpdateWindowLock() - if AJM.db.currencyLockWindow == false then - JambaToonCurrencyListFrame:EnableMouse( true ) - else - JambaToonCurrencyListFrame:EnableMouse( false ) - end -end - -function AJM:SettingsUpdateBorderStyle() - local borderStyle = AJM.SharedMedia:Fetch( "border", AJM.db.currencyBorderStyle ) - local backgroundStyle = AJM.SharedMedia:Fetch( "background", AJM.db.currencyBackgroundStyle ) - local frame = JambaToonCurrencyListFrame - frame:SetBackdrop( { - bgFile = backgroundStyle, - edgeFile = borderStyle, - tile = true, tileSize = frame:GetWidth(), edgeSize = 10, - insets = { left = 3, right = 3, top = 3, bottom = 3 } - } ) - frame:SetBackdropColor( AJM.db.currencyFrameBackgroundColourR, AJM.db.currencyFrameBackgroundColourG, AJM.db.currencyFrameBackgroundColourB, AJM.db.currencyFrameBackgroundColourA ) - frame:SetBackdropBorderColor( AJM.db.currencyFrameBorderColourR, AJM.db.currencyFrameBorderColourG, AJM.db.currencyFrameBorderColourB, AJM.db.currencyFrameBorderColourA ) - frame:SetAlpha( AJM.db.currencyFrameAlpha ) -end - -function AJM:CurrencyListSetHeight() - local additionalLines = 0 - local addHeight = 0 - if AJM.db.currGold == true then - if AJM.db.currGoldInGuildBank == true then - additionalLines = 2 - addHeight = 7 - else - additionalLines = 1 - addHeight = 5 - end - end - JambaToonCurrencyListFrame:SetHeight( 56 + ((JambaApi.GetTeamListMaximumOrder() + additionalLines) * 15) + addHeight ) -end - -function AJM:CurrencyListSetColumnWidth() - local nameWidth = AJM.db.currencyNameWidth - local pointsWidth = AJM.db.currencyPointsWidth - local goldWidth = AJM.db.currencyGoldWidth - local spacingWidth = AJM.db.currencySpacingWidth - local frameHorizontalSpacing = 10 - local numberOfPointsColumns = 0 - local parentFrame = JambaToonCurrencyListFrame - local headingRowTopPoint = -30 - local left = frameHorizontalSpacing - local haveGold = 0 - -- Heading rows. - parentFrame.characterNameText:SetWidth( nameWidth ) - parentFrame.characterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + nameWidth + spacingWidth - if AJM.db.currGold == true then - parentFrame.GoldText:SetWidth( goldWidth ) - parentFrame.GoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + goldWidth + (spacingWidth * 3) - parentFrame.GoldText:Show() - haveGold = 1 - else - parentFrame.GoldText:Hide() - haveGold = 0 - end --- if AJM.db.currJusticePoints == true then --- parentFrame.JusticePointsText:SetWidth( pointsWidth ) --- parentFrame.JusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- numberOfPointsColumns = numberOfPointsColumns + 1 --- parentFrame.JusticePointsText:Show() --- else --- parentFrame.JusticePointsText:Hide() --- end --- if AJM.db.currValorPoints == true then --- parentFrame.ValorPointsText:SetWidth( pointsWidth ) --- parentFrame.ValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- numberOfPointsColumns = numberOfPointsColumns + 1 --- parentFrame.ValorPointsText:Show() --- else --- parentFrame.ValorPointsText:Hide() --- end - if AJM.db.currHonorPoints == true then - parentFrame.HonorPointsText:SetWidth( pointsWidth ) - parentFrame.HonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.HonorPointsText:Show() - else - parentFrame.HonorPointsText:Hide() - end - if AJM.db.currConquestPoints == true then - parentFrame.ConquestPointsText:SetWidth( pointsWidth ) - parentFrame.ConquestPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.ConquestPointsText:Show() - else - parentFrame.ConquestPointsText:Hide() - end - if AJM.db.currTolBaradCommendation == true then - parentFrame.TolBaradCommendationText:SetWidth( pointsWidth ) - parentFrame.TolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TolBaradCommendationText:Show() - else - parentFrame.TolBaradCommendationText:Hide() - end - if AJM.db.currChampionsSeal == true then - parentFrame.ChampionsSealText:SetWidth( pointsWidth ) - parentFrame.ChampionsSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.ChampionsSealText:Show() - else - parentFrame.ChampionsSealText:Hide() - end - if AJM.db.currIllustriousJewelcraftersToken == true then - parentFrame.IllustriousJewelcraftersTokenText:SetWidth( pointsWidth ) - parentFrame.IllustriousJewelcraftersTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.IllustriousJewelcraftersTokenText:Show() - else - parentFrame.IllustriousJewelcraftersTokenText:Hide() - end - if AJM.db.currDalaranJewelcraftingToken == true then - parentFrame.DalaranJewelcraftingTokenText:SetWidth( pointsWidth ) - parentFrame.DalaranJewelcraftingTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.DalaranJewelcraftingTokenText:Show() - else - parentFrame.DalaranJewelcraftingTokenText:Hide() - end - if AJM.db.currIronpawToken == true then - parentFrame.IronpawTokenText:SetWidth( pointsWidth ) - parentFrame.IronpawTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.IronpawTokenText:Show() - else - parentFrame.IronpawTokenText:Hide() - end - if AJM.db.currEpicureansAward == true then - parentFrame.EpicureansAwardText:SetWidth( pointsWidth ) - parentFrame.EpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.EpicureansAwardText:Show() - else - parentFrame.EpicureansAwardText:Hide() - end - if AJM.db.currLesserCharmOfGoodFortune == true then - parentFrame.LesserCharmOfGoodFortuneText:SetWidth( pointsWidth ) - parentFrame.LesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.LesserCharmOfGoodFortuneText:Show() - else - parentFrame.LesserCharmOfGoodFortuneText:Hide() - end - if AJM.db.currElderCharmOfGoodFortune == true then - parentFrame.ElderCharmOfGoodFortuneText:SetWidth( pointsWidth ) - parentFrame.ElderCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.ElderCharmOfGoodFortuneText:Show() - else - parentFrame.ElderCharmOfGoodFortuneText:Hide() - end - if AJM.db.currMoguRuneOfFate == true then - parentFrame.MoguRuneOfFateText:SetWidth( pointsWidth ) - parentFrame.MoguRuneOfFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.MoguRuneOfFateText:Show() - else - parentFrame.MoguRuneOfFateText:Hide() - end - if AJM.db.currWarforgedSeal == true then - parentFrame.WarforgedSealText:SetWidth( pointsWidth ) - parentFrame.WarforgedSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.WarforgedSealText:Show() - else - parentFrame.WarforgedSealText:Hide() - end - if AJM.db.currBloodyCoin == true then - parentFrame.BloodyCoinText:SetWidth( pointsWidth ) - parentFrame.BloodyCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.BloodyCoinText:Show() - else - parentFrame.BloodyCoinText:Hide() - end - if AJM.db.currTimelessCoin == true then - parentFrame.TimelessCoinText:SetWidth( pointsWidth ) - parentFrame.TimelessCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TimelessCoinText:Show() - else - parentFrame.TimelessCoinText:Hide() - end - --ebony New WoD Currency - if AJM.db.currGarrisonResources == true then - parentFrame.GarrisonResourcesText:SetWidth( pointsWidth ) - parentFrame.GarrisonResourcesText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.GarrisonResourcesText:Show() - else - parentFrame.GarrisonResourcesText:Hide() - end - if AJM.db.currTemperedFate == true then - parentFrame.TemperedFateText:SetWidth( pointsWidth ) - parentFrame.TemperedFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TemperedFateText:Show() - else - parentFrame.TemperedFateText:Hide() - end - if AJM.db.currApexisCrystal == true then - parentFrame.ApexisCrystalText:SetWidth( pointsWidth ) - parentFrame.ApexisCrystalText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.ApexisCrystalText:Show() - else - parentFrame.ApexisCrystalText:Hide() - end - if AJM.db.currDarkmoon == true then - parentFrame.DarkmoonText:SetWidth( pointsWidth ) - parentFrame.DarkmoonText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.DarkmoonText:Show() - else - parentFrame.DarkmoonText:Hide() - end - -- Character rows. - for characterName, currencyFrameCharacterInfo in pairs( AJM.currencyFrameCharacterInfo ) do - local left = frameHorizontalSpacing - local characterRowTopPoint = currencyFrameCharacterInfo.characterRowTopPoint - currencyFrameCharacterInfo.characterNameText:SetWidth( nameWidth ) - currencyFrameCharacterInfo.characterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + nameWidth + spacingWidth - if AJM.db.currGold == true then - currencyFrameCharacterInfo.GoldText:SetWidth( goldWidth ) - currencyFrameCharacterInfo.GoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + goldWidth + (spacingWidth * 3) - currencyFrameCharacterInfo.GoldText:Show() - else - currencyFrameCharacterInfo.GoldText:Hide() - end --- if AJM.db.currJusticePoints == true then --- currencyFrameCharacterInfo.JusticePointsText:SetWidth( pointsWidth ) --- currencyFrameCharacterInfo.JusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- currencyFrameCharacterInfo.JusticePointsText:Show() --- else --- currencyFrameCharacterInfo.JusticePointsText:Hide() --- end --- if AJM.db.currValorPoints == true then --- currencyFrameCharacterInfo.ValorPointsText:SetWidth( pointsWidth ) --- currencyFrameCharacterInfo.ValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) --- left = left + pointsWidth + spacingWidth --- currencyFrameCharacterInfo.ValorPointsText:Show() --- else --- currencyFrameCharacterInfo.ValorPointsText:Hide() --- end - if AJM.db.currHonorPoints == true then - currencyFrameCharacterInfo.HonorPointsText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.HonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.HonorPointsText:Show() - else - currencyFrameCharacterInfo.HonorPointsText:Hide() - end - if AJM.db.currConquestPoints == true then - currencyFrameCharacterInfo.ConquestPointsText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.ConquestPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.ConquestPointsText:Show() - else - currencyFrameCharacterInfo.ConquestPointsText:Hide() - end - if AJM.db.currTolBaradCommendation == true then - currencyFrameCharacterInfo.TolBaradCommendationText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TolBaradCommendationText:Show() - else - currencyFrameCharacterInfo.TolBaradCommendationText:Hide() - end - if AJM.db.currChampionsSeal == true then - currencyFrameCharacterInfo.ChampionsSealText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.ChampionsSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.ChampionsSealText:Show() - else - currencyFrameCharacterInfo.ChampionsSealText:Hide() - end - if AJM.db.currIllustriousJewelcraftersToken == true then - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:Show() - else - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:Hide() - end - if AJM.db.currDalaranJewelcraftingToken == true then - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:Show() - else - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:Hide() - end - if AJM.db.currIronpawToken == true then - currencyFrameCharacterInfo.IronpawTokenText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.IronpawTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.IronpawTokenText:Show() - else - currencyFrameCharacterInfo.IronpawTokenText:Hide() - end - if AJM.db.currEpicureansAward == true then - currencyFrameCharacterInfo.EpicureansAwardText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.EpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.EpicureansAwardText:Show() - else - currencyFrameCharacterInfo.EpicureansAwardText:Hide() - end - if AJM.db.currLesserCharmOfGoodFortune == true then - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:Show() - else - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:Hide() - end - if AJM.db.currElderCharmOfGoodFortune == true then - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:Show() - else - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:Hide() - end - if AJM.db.currMoguRuneOfFate == true then - currencyFrameCharacterInfo.MoguRuneOfFateText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.MoguRuneOfFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.MoguRuneOfFateText:Show() - else - currencyFrameCharacterInfo.MoguRuneOfFateText:Hide() - end - if AJM.db.currWarforgedSeal == true then - currencyFrameCharacterInfo.WarforgedSealText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.WarforgedSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.WarforgedSealText:Show() - else - currencyFrameCharacterInfo.WarforgedSealText:Hide() - end - if AJM.db.currBloodyCoin == true then - currencyFrameCharacterInfo.BloodyCoinText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.BloodyCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.BloodyCoinText:Show() - else - currencyFrameCharacterInfo.BloodyCoinText:Hide() - end - if AJM.db.currTimelessCoin == true then - currencyFrameCharacterInfo.TimelessCoinText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TimelessCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TimelessCoinText:Show() - else - currencyFrameCharacterInfo.TimelessCoinText:Hide() - end - ---ebony New WoD Currency - if AJM.db.currGarrisonResources == true then - currencyFrameCharacterInfo.GarrisonResourcesText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.GarrisonResourcesText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.GarrisonResourcesText:Show() - else - currencyFrameCharacterInfo.GarrisonResourcesText:Hide() - end - if AJM.db.currTemperedFate == true then - currencyFrameCharacterInfo.TemperedFateText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TemperedFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TemperedFateText:Show() - else - currencyFrameCharacterInfo.TemperedFateText:Hide() - end - if AJM.db.currApexisCrystal == true then - currencyFrameCharacterInfo.ApexisCrystalText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.ApexisCrystalText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.ApexisCrystalText:Show() - else - currencyFrameCharacterInfo.ApexisCrystalText:Hide() - end - if AJM.db.currDarkmoon == true then - currencyFrameCharacterInfo.DarkmoonText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.DarkmoonText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.DarkmoonText:Show() - else - currencyFrameCharacterInfo.DarkmoonText:Hide() - end - end - -- Parent frame width and title. - local finalParentWidth = frameHorizontalSpacing + nameWidth + spacingWidth + (haveGold * (goldWidth + (spacingWidth * 3))) + (numberOfPointsColumns * (pointsWidth + spacingWidth)) + frameHorizontalSpacing - if finalParentWidth < 95 then - finalParentWidth = 95 - end - local widthOfCloseAndUpdateButtons = 70 - parentFrame.titleName:SetWidth( finalParentWidth - widthOfCloseAndUpdateButtons - frameHorizontalSpacing - frameHorizontalSpacing ) - parentFrame.titleName:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", frameHorizontalSpacing, -9 ) - if AJM.db.currGold == true then - if numberOfPointsColumns > 1 then - parentFrame.titleName:SetText( L["Jamba Currency"] ) - else - parentFrame.titleName:SetText( L["Currency"] ) - end - else - if numberOfPointsColumns < 2 then - parentFrame.titleName:SetText( "" ) - end - if numberOfPointsColumns == 2 then - parentFrame.titleName:SetText( L["Curr"] ) - end - if (numberOfPointsColumns >= 3) and (numberOfPointsColumns <= 4) then - parentFrame.titleName:SetText( L["Currency"] ) - end - if numberOfPointsColumns > 4 then - parentFrame.titleName:SetText( L["Jamba Currency"] ) - end - end - parentFrame:SetWidth( finalParentWidth ) - -- Total Gold. - local nameLeft = frameHorizontalSpacing - local goldLeft = frameHorizontalSpacing + nameWidth + spacingWidth - local guildTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 5 - local goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 1) * 15) - 7 - if AJM.db.currGold == true then - if AJM.db.currGoldInGuildBank == true then - parentFrame.TotalGoldGuildTitleText:SetWidth( nameWidth ) - parentFrame.TotalGoldGuildTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", nameLeft, guildTop ) - parentFrame.TotalGoldGuildTitleText:Show() - parentFrame.TotalGoldGuildText:SetWidth( goldWidth ) - parentFrame.TotalGoldGuildText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", goldLeft, guildTop ) - parentFrame.TotalGoldGuildText:Show() - goldTop = -35 - ((JambaApi.GetTeamListMaximumOrder() + 2) * 15) - 5 - else - parentFrame.TotalGoldGuildTitleText:Hide() - parentFrame.TotalGoldGuildText:Hide() - end - parentFrame.TotalGoldTitleText:SetWidth( nameWidth ) - parentFrame.TotalGoldTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", nameLeft, goldTop ) - parentFrame.TotalGoldTitleText:Show() - parentFrame.TotalGoldText:SetWidth( goldWidth ) - parentFrame.TotalGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", goldLeft, goldTop ) - parentFrame.TotalGoldText:Show() - else - parentFrame.TotalGoldTitleText:Hide() - parentFrame.TotalGoldText:Hide() - parentFrame.TotalGoldGuildTitleText:Hide() - parentFrame.TotalGoldGuildText:Hide() - end -end - -function AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) - local left = 10 - local spacing = 50 - local width = 50 - local top = -35 + (-15 * JambaApi.GetPositionForCharacterName( characterName )) - -- Create the table to hold the status bars for this character. - AJM.currencyFrameCharacterInfo[characterName] = {} - -- Get the character info table. - local currencyFrameCharacterInfo = AJM.currencyFrameCharacterInfo[characterName] - currencyFrameCharacterInfo.characterRowTopPoint = top - -- Set the characters name font string. - local frameCharacterName = AJM.globalCurrencyFramePrefix.."CharacterName" - local frameCharacterNameText = parentFrame:CreateFontString( frameCharacterName.."Text", "OVERLAY", "GameFontNormal" ) - frameCharacterNameText:SetText( characterName ) - frameCharacterNameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameCharacterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameCharacterNameText:SetWidth( width * 2.5 ) - frameCharacterNameText:SetJustifyH( "LEFT" ) - currencyFrameCharacterInfo.characterNameText = frameCharacterNameText - left = left + (spacing * 2) - -- Set the Gold font string. - local frameGold = AJM.globalCurrencyFramePrefix.."Gold" - local frameGoldText = parentFrame:CreateFontString( frameGold.."Text", "OVERLAY", "GameFontNormal" ) - frameGoldText:SetText( "0" ) - frameGoldText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameGoldText:SetWidth( width ) - frameGoldText:SetJustifyH( "RIGHT" ) - currencyFrameCharacterInfo.GoldText = frameGoldText - left = left + spacing --- -- Set the JusticePoints font string. --- local frameJusticePoints = AJM.globalCurrencyFramePrefix.."JusticePoints" --- local frameJusticePointsText = parentFrame:CreateFontString( frameJusticePoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameJusticePointsText:SetText( "0" ) --- frameJusticePointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) --- frameJusticePointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameJusticePointsText:SetWidth( width ) --- frameJusticePointsText:SetJustifyH( "CENTER" ) --- currencyFrameCharacterInfo.JusticePointsText = frameJusticePointsText --- left = left + spacing --- -- Set the ValorPoints font string. --- local frameValorPoints = AJM.globalCurrencyFramePrefix.."ValorPoints" --- local frameValorPointsText = parentFrame:CreateFontString( frameValorPoints.."Text", "OVERLAY", "GameFontNormal" ) --- frameValorPointsText:SetText( "0" ) --- frameValorPointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) --- frameValorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) --- frameValorPointsText:SetWidth( width ) --- frameValorPointsText:SetJustifyH( "CENTER" ) --- currencyFrameCharacterInfo.ValorPointsText = frameValorPointsText --- left = left + spacing - -- Set the HonorPoints font string. - local frameHonorPoints = AJM.globalCurrencyFramePrefix.."HonorPoints" - local frameHonorPointsText = parentFrame:CreateFontString( frameHonorPoints.."Text", "OVERLAY", "GameFontNormal" ) - frameHonorPointsText:SetText( "0" ) - frameHonorPointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameHonorPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameHonorPointsText:SetWidth( width ) - frameHonorPointsText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.HonorPointsText = frameHonorPointsText - left = left + spacing - -- Set the ConquestPoints font string. - local frameConquestPoints = AJM.globalCurrencyFramePrefix.."ConquestPoints" - local frameConquestPointsText = parentFrame:CreateFontString( frameConquestPoints.."Text", "OVERLAY", "GameFontNormal" ) - frameConquestPointsText:SetText( "0" ) - frameConquestPointsText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameConquestPointsText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameConquestPointsText:SetWidth( width ) - frameConquestPointsText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.ConquestPointsText = frameConquestPointsText - left = left + spacing - -- Set the TolBaradCommendation font string. - local frameTolBaradCommendation = AJM.globalCurrencyFramePrefix.."TolBaradCommendation" - local frameTolBaradCommendationText = parentFrame:CreateFontString( frameTolBaradCommendation.."Text", "OVERLAY", "GameFontNormal" ) - frameTolBaradCommendationText:SetText( "0" ) - frameTolBaradCommendationText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTolBaradCommendationText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTolBaradCommendationText:SetWidth( width ) - frameTolBaradCommendationText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TolBaradCommendationText = frameTolBaradCommendationText - left = left + spacing - -- Set the ChampionsSeal font string. - local frameChampionsSeal = AJM.globalCurrencyFramePrefix.."ChampionsSeal" - local frameChampionsSealText = parentFrame:CreateFontString( frameChampionsSeal.."Text", "OVERLAY", "GameFontNormal" ) - frameChampionsSealText:SetText( "0" ) - frameChampionsSealText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameChampionsSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameChampionsSealText:SetWidth( width ) - frameChampionsSealText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.ChampionsSealText = frameChampionsSealText - left = left + spacing - -- Set the IllustriousJewelcraftersToken font string. - local frameIllustriousJewelcraftersToken = AJM.globalCurrencyFramePrefix.."IllustriousJewelcraftersToken" - local frameIllustriousJewelcraftersTokenText = parentFrame:CreateFontString( frameIllustriousJewelcraftersToken.."Text", "OVERLAY", "GameFontNormal" ) - frameIllustriousJewelcraftersTokenText:SetText( "0" ) - frameIllustriousJewelcraftersTokenText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameIllustriousJewelcraftersTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameIllustriousJewelcraftersTokenText:SetWidth( width ) - frameIllustriousJewelcraftersTokenText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText = frameIllustriousJewelcraftersTokenText - left = left + spacing - -- Set the DalaranJewelcraftingToken font string. - local frameDalaranJewelcraftingToken = AJM.globalCurrencyFramePrefix.."DalaranJewelcraftingToken" - local frameDalaranJewelcraftingTokenText = parentFrame:CreateFontString( frameDalaranJewelcraftingToken.."Text", "OVERLAY", "GameFontNormal" ) - frameDalaranJewelcraftingTokenText:SetText( "0" ) - frameDalaranJewelcraftingTokenText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameDalaranJewelcraftingTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameDalaranJewelcraftingTokenText:SetWidth( width ) - frameDalaranJewelcraftingTokenText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText = frameDalaranJewelcraftingTokenText - left = left + spacing - -- Set the IronpawToken font string. - local frameIronpawToken = AJM.globalCurrencyFramePrefix.."IronpawToken" - local frameIronpawTokenText = parentFrame:CreateFontString( frameIronpawToken.."Text", "OVERLAY", "GameFontNormal" ) - frameIronpawTokenText:SetText( "0" ) - frameIronpawTokenText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameIronpawTokenText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameIronpawTokenText:SetWidth( width ) - frameIronpawTokenText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.IronpawTokenText = frameIronpawTokenText - left = left + spacing - -- Set the EpicureansAward font string. - local frameEpicureansAward = AJM.globalCurrencyFramePrefix.."EpicureansAward" - local frameEpicureansAwardText = parentFrame:CreateFontString( frameEpicureansAward.."Text", "OVERLAY", "GameFontNormal" ) - frameEpicureansAwardText:SetText( "0" ) - frameEpicureansAwardText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameEpicureansAwardText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameEpicureansAwardText:SetWidth( width ) - frameEpicureansAwardText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.EpicureansAwardText = frameEpicureansAwardText - left = left + spacing - -- Set the LesserCharmOfGoodFortune font string. - local frameLesserCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."LesserCharmOfGoodFortune" - local frameLesserCharmOfGoodFortuneText = parentFrame:CreateFontString( frameLesserCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) - frameLesserCharmOfGoodFortuneText:SetText( "0" ) - frameLesserCharmOfGoodFortuneText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameLesserCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameLesserCharmOfGoodFortuneText:SetWidth( width ) - frameLesserCharmOfGoodFortuneText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText = frameLesserCharmOfGoodFortuneText - left = left + spacing - -- Set the ElderCharmOfGoodFortune font string. - local frameElderCharmOfGoodFortune = AJM.globalCurrencyFramePrefix.."ElderCharmOfGoodFortune" - local frameElderCharmOfGoodFortuneText = parentFrame:CreateFontString( frameElderCharmOfGoodFortune.."Text", "OVERLAY", "GameFontNormal" ) - frameElderCharmOfGoodFortuneText:SetText( "0" ) - frameElderCharmOfGoodFortuneText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameElderCharmOfGoodFortuneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameElderCharmOfGoodFortuneText:SetWidth( width ) - frameElderCharmOfGoodFortuneText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText = frameElderCharmOfGoodFortuneText - left = left + spacing - -- Set the MoguRuneOfFate font string. - local frameMoguRuneOfFate = AJM.globalCurrencyFramePrefix.."MoguRuneOfFate" - local frameMoguRuneOfFateText = parentFrame:CreateFontString( frameMoguRuneOfFate.."Text", "OVERLAY", "GameFontNormal" ) - frameMoguRuneOfFateText:SetText( "0" ) - frameMoguRuneOfFateText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameMoguRuneOfFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameMoguRuneOfFateText:SetWidth( width ) - frameMoguRuneOfFateText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.MoguRuneOfFateText = frameMoguRuneOfFateText - left = left + spacing - -- Set the WarforgedSeal font string. - local frameWarforgedSeal = AJM.globalCurrencyFramePrefix.."WarforgedSeal" - local frameWarforgedSealText = parentFrame:CreateFontString( frameWarforgedSeal.."Text", "OVERLAY", "GameFontNormal" ) - frameWarforgedSealText:SetText( "0" ) - frameWarforgedSealText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameWarforgedSealText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameWarforgedSealText:SetWidth( width ) - frameWarforgedSealText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.WarforgedSealText = frameWarforgedSealText - left = left + spacing - -- Set the BloodyCoin font string. - local frameBloodyCoin = AJM.globalCurrencyFramePrefix.."BloodyCoin" - local frameBloodyCoinText = parentFrame:CreateFontString( frameBloodyCoin.."Text", "OVERLAY", "GameFontNormal" ) - frameBloodyCoinText:SetText( "0" ) - frameBloodyCoinText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameBloodyCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameBloodyCoinText:SetWidth( width ) - frameBloodyCoinText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.BloodyCoinText = frameBloodyCoinText - left = left + spacing - -- Set the TimelessCoin font string. - local frameTimelessCoin = AJM.globalCurrencyFramePrefix.."TimelessCoin" - local frameTimelessCoinText = parentFrame:CreateFontString( frameTimelessCoin.."Text", "OVERLAY", "GameFontNormal" ) - frameTimelessCoinText:SetText( "0" ) - frameTimelessCoinText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTimelessCoinText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTimelessCoinText:SetWidth( width ) - frameTimelessCoinText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TimelessCoinText = frameTimelessCoinText - left = left + spacing - --ebony New WoD Currency - -- Set the GarrisonResources font string. - local frameGarrisonResources = AJM.globalCurrencyFramePrefix.."GarrisonResources" - local frameGarrisonResourcesText = parentFrame:CreateFontString( frameGarrisonResources .."Text", "OVERLAY", "GameFontNormal" ) - frameGarrisonResourcesText:SetText( "0" ) - frameGarrisonResourcesText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameGarrisonResourcesText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameGarrisonResourcesText:SetWidth( width ) - frameGarrisonResourcesText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.GarrisonResourcesText = frameGarrisonResourcesText - left = left + spacing - -- Set the TemperedFate font string. - local frameTemperedFate = AJM.globalCurrencyFramePrefix.."TemperedFate" - local frameTemperedFateText = parentFrame:CreateFontString( frameTemperedFate .."Text", "OVERLAY", "GameFontNormal" ) - frameTemperedFateText:SetText( "0" ) - frameTemperedFateText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTemperedFateText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTemperedFateText:SetWidth( width ) - frameTemperedFateText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TemperedFateText = frameTemperedFateText - left = left + spacing - -- Set the ApexisCrystal font string. - local frameApexisCrystal = AJM.globalCurrencyFramePrefix.."ApexisCrystal" - local frameApexisCrystalText = parentFrame:CreateFontString( frameApexisCrystal .."Text", "OVERLAY", "GameFontNormal" ) - frameApexisCrystalText:SetText( "0" ) - frameApexisCrystalText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameApexisCrystalText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameApexisCrystalText:SetWidth( width ) - frameApexisCrystalText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.ApexisCrystalText = frameApexisCrystalText - left = left + spacing - local frameDarkmoon = AJM.globalCurrencyFramePrefix.."Darkmoon" - local frameDarkmoonText = parentFrame:CreateFontString( frameDarkmoon .."Text", "OVERLAY", "GameFontNormal" ) - frameDarkmoonText:SetText( "0" ) - frameDarkmoonText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameDarkmoonText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameDarkmoonText:SetWidth( width ) - frameDarkmoonText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.DarkmoonText = frameDarkmoonText - left = left + spacing -end - -function AJM:JambaToonHideCurrency() - JambaToonCurrencyListFrame:Hide() -end - -function AJM:JambaToonRequestCurrency() - -- Colour red. - local r = 1.0 - local g = 0.0 - local b = 0.0 - local a = 0.6 - for characterName, currencyFrameCharacterInfo in pairs( AJM.currencyFrameCharacterInfo ) do - currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.JusticePointsText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.ValorPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.HonorPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ConquestPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TolBaradCommendationText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ChampionsSealText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.IronpawTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.EpicureansAwardText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.MoguRuneOfFateText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.WarforgedSealText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.BloodyCoinText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TimelessCoinText:SetTextColor( r, g, b, a ) - --ebony New WoD Currency - currencyFrameCharacterInfo.GarrisonResourcesText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TemperedFateText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ApexisCrystalText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.DarkmoonText:SetTextColor( r, g, b, a ) - end - AJM.currencyTotalGold = 0 - if AJM.db.currGoldInGuildBank == true then - if IsInGuild() then - AJM.currencyTotalGold = GetGuildBankMoney() - end - end - AJM:JambaSendCommandToTeam( AJM.COMMAND_REQUEST_CURRENCY, "" ) -end - -function AJM:DoSendCurrency( characterName, dummyValue ) - table.wipe( AJM.currentCurrencyValues ) - AJM.currentCurrencyValues.currGold = GetMoney() --- AJM.currentCurrencyValues.currJusticePoints = select( 2, GetCurrencyInfo( AJM.CJusticePoints ) ) --- AJM.currentCurrencyValues.currValorPoints = select( 2, GetCurrencyInfo( AJM.CValorPoints ) ) - AJM.currentCurrencyValues.currHonorPoints = select( 2, GetCurrencyInfo( AJM.CHonorPoints ) ) - AJM.currentCurrencyValues.currConquestPoints = select( 2, GetCurrencyInfo( AJM.CConquestPoints ) ) - AJM.currentCurrencyValues.currTolBaradCommendation = select( 2, GetCurrencyInfo( AJM.CTolBaradCommendation ) ) - AJM.currentCurrencyValues.currChampionsSeal = select( 2, GetCurrencyInfo(AJM.CChampionsSeal ) ) - AJM.currentCurrencyValues.currIllustriousJewelcraftersToken = select( 2, GetCurrencyInfo( AJM.CIllustriousJewelcraftersToken ) ) - AJM.currentCurrencyValues.currDalaranJewelcraftingToken = select( 2, GetCurrencyInfo( AJM.CDalaranJewelcraftingToken ) ) - AJM.currentCurrencyValues.currIronpawToken = select( 2, GetCurrencyInfo( AJM.CIronpawToken ) ) - AJM.currentCurrencyValues.currEpicureansAward = select( 2, GetCurrencyInfo( AJM.CEpicureansAward ) ) - AJM.currentCurrencyValues.currLesserCharmOfGoodFortune = select( 2, GetCurrencyInfo( AJM.CLesserCharmOfGoodFortune ) ) - AJM.currentCurrencyValues.currElderCharmOfGoodFortune = select( 2, GetCurrencyInfo( AJM.CElderCharmOfGoodFortune ) ) - AJM.currentCurrencyValues.currMoguRuneOfFate = select( 2, GetCurrencyInfo( AJM.CMoguRuneOfFate ) ) - AJM.currentCurrencyValues.currWarforgedSeal = select( 2, GetCurrencyInfo( AJM.CWarforgedSeal ) ) - AJM.currentCurrencyValues.currBloodyCoin = select( 2, GetCurrencyInfo( AJM.CBloodyCoin ) ) - AJM.currentCurrencyValues.currTimelessCoin = select( 2, GetCurrencyInfo( AJM.CTimelessCoin ) ) - --ebony New WoD Currency - AJM.currentCurrencyValues.currGarrisonResources = select( 2, GetCurrencyInfo( AJM.CGarrisonResources ) ) - AJM.currentCurrencyValues.currTemperedFate = select( 2, GetCurrencyInfo( AJM.CTemperedFate ) ) - AJM.currentCurrencyValues.currApexisCrystal = select( 2, GetCurrencyInfo( AJM.CApexisCrystal ) ) - AJM.currentCurrencyValues.currDarkmoon = select( 2, GetCurrencyInfo( AJM.CDarkmoon ) ) - AJM:JambaSendCommandToToon( characterName, AJM.COMMAND_HERE_IS_CURRENCY, AJM.currentCurrencyValues ) -end - -function AJM:DoShowToonsCurrency( characterName, currencyValues ) - local parentFrame = JambaToonCurrencyListFrame - -- Get (or create and get) the character information. - local currencyFrameCharacterInfo = AJM.currencyFrameCharacterInfo[characterName] - if currencyFrameCharacterInfo == nil then - AJM:CreateJambaCurrencyFrameInfo( characterName, parentFrame ) - currencyFrameCharacterInfo = AJM.currencyFrameCharacterInfo[characterName] - end - -- Colour white. - local r = 1.0 - local g = 1.0 - local b = 1.0 - local a = 1.0 - currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.JusticePointsText:SetTextColor( r, g, b, a ) --- currencyFrameCharacterInfo.ValorPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.HonorPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ConquestPointsText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TolBaradCommendationText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ChampionsSealText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.IronpawTokenText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.EpicureansAwardText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.MoguRuneOfFateText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.WarforgedSealText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.BloodyCoinText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TimelessCoinText:SetTextColor( r, g, b, a ) - --ebony New WoD Currency - currencyFrameCharacterInfo.GarrisonResourcesText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TemperedFateText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.ApexisCrystalText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.DarkmoonText:SetTextColor( r, g, b, a ) - -- Information. - currencyFrameCharacterInfo.GoldText:SetText( JambaUtilities:FormatMoneyString( currencyValues.currGold ) ) --- currencyFrameCharacterInfo.JusticePointsText:SetText( currencyValues.currJusticePoints ) --- currencyFrameCharacterInfo.ValorPointsText:SetText( currencyValues.currValorPoints ) - currencyFrameCharacterInfo.HonorPointsText:SetText( currencyValues.currHonorPoints ) - currencyFrameCharacterInfo.ConquestPointsText:SetText( currencyValues.currConquestPoints ) - currencyFrameCharacterInfo.TolBaradCommendationText:SetText( currencyValues.currTolBaradCommendation ) - currencyFrameCharacterInfo.ChampionsSealText:SetText( currencyValues.currChampionsSeal ) - currencyFrameCharacterInfo.IllustriousJewelcraftersTokenText:SetText( currencyValues.currIllustriousJewelcraftersToken ) - currencyFrameCharacterInfo.DalaranJewelcraftingTokenText:SetText( currencyValues.currDalaranJewelcraftingToken ) - currencyFrameCharacterInfo.IronpawTokenText:SetText( currencyValues.currIronpawToken ) - currencyFrameCharacterInfo.EpicureansAwardText:SetText( currencyValues.currEpicureansAward ) - currencyFrameCharacterInfo.LesserCharmOfGoodFortuneText:SetText( currencyValues.currLesserCharmOfGoodFortune ) - currencyFrameCharacterInfo.ElderCharmOfGoodFortuneText:SetText( currencyValues.currElderCharmOfGoodFortune ) - currencyFrameCharacterInfo.MoguRuneOfFateText:SetText( currencyValues.currMoguRuneOfFate ) - currencyFrameCharacterInfo.WarforgedSealText:SetText( currencyValues.currWarforgedSeal ) - currencyFrameCharacterInfo.BloodyCoinText:SetText( currencyValues.currBloodyCoin ) - currencyFrameCharacterInfo.TimelessCoinText:SetText( currencyValues.currTimelessCoin ) - --ebony New WoD Currency - currencyFrameCharacterInfo.GarrisonResourcesText:SetText( currencyValues.currGarrisonResources ) - currencyFrameCharacterInfo.TemperedFateText:SetText( currencyValues.currTemperedFate ) - currencyFrameCharacterInfo.ApexisCrystalText:SetText( currencyValues.currApexisCrystal ) - currencyFrameCharacterInfo.DarkmoonText:SetText( currencyValues.currDarkmoon ) - -- Total gold. - AJM.currencyTotalGold = AJM.currencyTotalGold + currencyValues.currGold - parentFrame.TotalGoldText:SetText( JambaUtilities:FormatMoneyString( AJM.currencyTotalGold ) ) - if IsInGuild() then - parentFrame.TotalGoldGuildText:SetText( JambaUtilities:FormatMoneyString( GetGuildBankMoney() ) ) - end - -- Update width of currency list. - AJM:CurrencyListSetColumnWidth() - JambaToonCurrencyListFrame:Show() -end - --- A Jamba command has been received. -function AJM:JambaOnCommandReceived( characterName, commandName, ... ) - if commandName == AJM.COMMAND_REQUEST_CURRENCY then - AJM:DoSendCurrency( characterName, ... ) - end - if commandName == AJM.COMMAND_HERE_IS_CURRENCY then - AJM:DoShowToonsCurrency( characterName, ... ) - end -end - diff --git a/Jamba-Toon/Locales/JambaToon-Locale-enUS.lua b/Jamba-Toon/Locales/JambaToon-Locale-enUS.lua index ee643e6..2127845 100644 --- a/Jamba-Toon/Locales/JambaToon-Locale-enUS.lua +++ b/Jamba-Toon/Locales/JambaToon-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -35,11 +35,11 @@ L["Bag Space"] = true L["Bags Full!"] = true L["Warn If All Regular Bags Are Full"] = true L["Bags Full Message"] = true -L["Warn If Hit First Time In Combat (Slave)"] = true +L["Warn If Hit First Time In Combat (Minion)"] = true L["Hit First Time Message"] = true -L["Warn If Target Not Master On Combat (Slave)"] = true +L["Warn If Target Not Master On Combat (Minion)"] = true L["Warn Target Not Master Message"] = true -L["Warn If Focus Not Master On Combat (Slave)"] = true +L["Warn If Focus Not Master On Combat (Minion)"] = true L["Warn Focus Not Master Message"] = true L["Warn If My Health Drops Below"] = true L["Health Amount - Percentage Allowed Before Warning"] = true @@ -54,10 +54,10 @@ end L["I refused a duel from: X"] = function( challenger ) return string.format( "I refused a duel from: %s", challenger ) end ---ebony L["I Accepted Summon From: X To: Y"] = function( sender, location ) return string.format( "I Accepted Summon From: %s To: %s", sender, location ) end + L["I do not have enough money to repair all my items."] = true L["Repairing cost me: X"] = function( costString ) return string.format( "Repairing cost me: %s", costString ) @@ -70,15 +70,18 @@ L["Inactive Message"] = true -- http://www.wowhead.com/spell=43681 L["Inactive"] = true -- End special. +L["Crowd Control Message"] = true +L["Warn If Toon Gets Crowd Control"] = true +L["I Am"] = true +L[" "] = true L["Currency"] = true -L["Justice Points"] = true -L["JP"] = true -L["Valor Points"] = true -L["VP"] = true L["Honor Points"] = true L["HP"] = true L["Conquest Points"] = true L["CP"] = true +L["Valor Points"] = true +L["VP"] = true +L["TBC"] = true L["Tol Barad Commendation"] = true L["TBC"] = true L["Champion's Seal"] = true @@ -102,15 +105,20 @@ L["TC"] = true L["Garrison Resources"] = true L["GR"] = true L["Seal of Tempered Fate"] = true -L["SoF"] = true +L["SoT"] = true L["Apexis Crystal"] = true L["AC"] = true -L["Darkmoon Prize Ticket "] = true +L["Darkmoon Prize Ticket"] = true L["DPT"] = true L["Bloody Coin"] = true L["BC"] = true L["Warforged Seal"] = true L["WS"] = true +L["Seal of Inevitable Fate"] = true +L["SoI"] = true +L["OIL"] = true +L["Timewarped Badge"] = true +L["TwB"] = true L["Show Currency"] = true L["Show the current toon the currency values for all members in the team."] = true L["Blizzard Tooltip"] = true diff --git a/Jamba-Toon/Locales/Locales.xml b/Jamba-Toon/Locales/Locales.xml index 6825165..090b381 100644 --- a/Jamba-Toon/Locales/Locales.xml +++ b/Jamba-Toon/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba-Trade/Jamba-Trade.toc b/Jamba-Trade/Jamba-Trade.toc index 58db31b..1d683a8 100644 --- a/Jamba-Trade/Jamba-Trade.toc +++ b/Jamba-Trade/Jamba-Trade.toc @@ -1,8 +1,8 @@ -## Interface: 60100 -## Title: Jamba-Trade -## Notes: Jamba-Trade +## Interface: 60200 +## Title: JambaTrade +## Notes: JambaTrade ## Author: Ebony, Former Author: Jafula -## Version: 3.12 +## Version: 4.2.1 ## X-Category: Interface Enhancements ## X-Child-Of: Jamba ## Dependencies: Jamba diff --git a/Jamba-Trade/JambaTrade.lua b/Jamba-Trade/JambaTrade.lua index 9e56c02..f0208fb 100644 --- a/Jamba-Trade/JambaTrade.lua +++ b/Jamba-Trade/JambaTrade.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -204,7 +204,7 @@ function AJM:SettingsCreateTrade( top ) headingWidth, left, movingTop, - L["Trade Excess Gold To Master From Slave"], + L["Trade Excess Gold To Master From Minion"], AJM.SettingsToggleAdjustMoneyWithMasterOnTrade ) movingTop = movingTop - checkBoxHeight @@ -288,6 +288,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -565,7 +567,8 @@ function AJM.JambaTradeLoadMineButtonClicked() end function AJM.JambaTradeLoadTheirsButtonClicked() - AJM:JambaSendCommandToToon( UnitName( "npc" ), AJM.COMMAND_LOAD_ITEM_CLASS_INTO_TRADE, AJM.itemClassCurrentSelection, AJM.itemSubClassCurrentSelection, AJM.db.ignoreSoulBound ) + local name = AJM:GetNPCUnitName() + AJM:JambaSendCommandToToon( name, AJM.COMMAND_LOAD_ITEM_CLASS_INTO_TRADE, AJM.itemClassCurrentSelection, AJM.itemSubClassCurrentSelection, AJM.db.ignoreSoulBound ) end function AJM:OtherToonInventoryButtonEnter( self ) @@ -586,7 +589,8 @@ function AJM:OtherToonInventoryButtonLeave( self ) end function AJM:OtherToonInventoryButtonClick( self ) - AJM:JambaSendCommandToToon( UnitName( "npc" ), AJM.COMMAND_LOAD_ITEM_INTO_TRADE, self.bag, self.slot, false ) + local name = AJM:GetNPCUnitName() + AJM:JambaSendCommandToToon( name, AJM.COMMAND_LOAD_ITEM_INTO_TRADE, self.bag, self.slot, false ) SetItemButtonDesaturated( self, 1, 0.5, 0.5, 0.5 ) end @@ -626,7 +630,7 @@ function AJM:TRADE_SHOW( event, ... ) AJM:TradeShowDisplayJambaTrade() end if AJM.db.adjustMoneyWithMasterOnTrade == true then - AJM:ScheduleTimer( "TradeShowAdjustMoneyWithMaster", 1 ) + AJM:ScheduleTimer( "TradeShowAdjustMoneyWithMaster", 1 ) end end @@ -646,6 +650,16 @@ function AJM:TradeShowAdjustMoneyWithMaster() end end +function AJM:GetNPCUnitName() + local name, realm = UnitName( "npc" ) + if realm then + name = name.."-"..realm + else + name = name.."-"..AJM.characterRealm + end + return name +end + function AJM:TradeShowDisplayJambaTrade() local slotsFree, totalSlots = LibBagUtils:CountSlots( "BAGS", 0 ) JambaTradeInventoryFrame.labelMineBags:SetText( self.characterName..": "..(totalSlots - slotsFree).."/"..totalSlots ) @@ -654,9 +668,10 @@ function AJM:TradeShowDisplayJambaTrade() end JambaTradeInventoryFrame.checkBoxIgnoreSoulBound:SetChecked( AJM.db.ignoreSoulBound ) AJM:JambaTradeIgnoreSoulBoundCheckboxChanged() - AJM:JambaSendCommandToToon( UnitName( "npc" ), AJM.COMMAND_GET_SLOT_COUNT ) + local name = AJM:GetNPCUnitName() + AJM:JambaSendCommandToToon( name, AJM.COMMAND_GET_SLOT_COUNT ) AJM:LoadThisToonsClasses() - AJM:JambaSendCommandToToon( UnitName( "npc" ), AJM.COMMAND_SHOW_INVENTORY ) + AJM:JambaSendCommandToToon (name, AJM.COMMAND_SHOW_INVENTORY ) end function AJM:TRADE_CLOSED() diff --git a/Jamba-Trade/Locales/JambaTrade-Locale-enUS.lua b/Jamba-Trade/Locales/JambaTrade-Locale-enUS.lua index 649aacd..baf1318 100644 --- a/Jamba-Trade/Locales/JambaTrade-Locale-enUS.lua +++ b/Jamba-Trade/Locales/JambaTrade-Locale-enUS.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -38,5 +38,5 @@ L["6. Artifact (golden yellow)"] = true L["7. Heirloom (light yellow)"] = true L["Unknown"] = true L["Ignore Soulbound"] = true -L["Trade Excess Gold To Master From Slave"] = true +L["Trade Excess Gold To Master From Minion"] = true L["Amount Of Gold To Keep"] = true \ No newline at end of file diff --git a/Jamba-Trade/Locales/Locales.xml b/Jamba-Trade/Locales/Locales.xml index 8c440e3..829dc16 100644 --- a/Jamba-Trade/Locales/Locales.xml +++ b/Jamba-Trade/Locales/Locales.xml @@ -1,8 +1,7 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba/AceGUIContainer-JambaWindow.lua b/Jamba/AceGUIContainer-JambaWindow.lua index c3759f2..a321f57 100644 --- a/Jamba/AceGUIContainer-JambaWindow.lua +++ b/Jamba/AceGUIContainer-JambaWindow.lua @@ -1,7 +1,9 @@ --[[ -Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Jamba4 - Jafula's Awesome Multi-Boxer Assistant +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License + + ]]-- --[[ diff --git a/Jamba/AceGUIWidget-JambaContinueLabel.lua b/Jamba/AceGUIWidget-JambaContinueLabel.lua index 8416287..f058da5 100644 --- a/Jamba/AceGUIWidget-JambaContinueLabel.lua +++ b/Jamba/AceGUIWidget-JambaContinueLabel.lua @@ -1,7 +1,9 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License + + ]]-- --[[ diff --git a/Jamba/AceGUIWidget-JambaNormalLabel.lua b/Jamba/AceGUIWidget-JambaNormalLabel.lua index 42074e7..91d1fb1 100644 --- a/Jamba/AceGUIWidget-JambaNormalLabel.lua +++ b/Jamba/AceGUIWidget-JambaNormalLabel.lua @@ -1,6 +1,7 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller + License: The MIT License ]]-- diff --git a/Jamba/Bindings.xml b/Jamba/Bindings.xml index 40a2ed8..ff51a3e 100644 --- a/Jamba/Bindings.xml +++ b/Jamba/Bindings.xml @@ -1,15 +1,14 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Bindings> - <Binding name="JAMBATEAMINVITE" header="JAMBATEAM" category="ADDONS"> + <Binding name="JAMBATEAMINVITE" header="JAMBATEAM" category="Jamba"> --[[dummy]] </Binding> - <Binding name="JAMBATEAMDISBAND" category="ADDONS"> + <Binding name="JAMBATEAMDISBAND" category="Jamba"> --[[dummy]] </Binding> </Bindings> diff --git a/Jamba/CHANGELOG.txt b/Jamba/CHANGELOG.txt index f7fb019..243549b 100644 --- a/Jamba/CHANGELOG.txt +++ b/Jamba/CHANGELOG.txt @@ -1,3 +1,254 @@ +Jamba Version: 4.2.1 +WoW Game Version: 6.2.3 +Release Date: 21/1/2016 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +- Updated all dates to the new year 2016 + +*jamba-communication + - Fixed "push all settings" again agian. + +*Jamba-Toon + - Added Message To Master when a Minion Gets crowd controled + +*Jamba-team-display + - Removed Durability from Display-Team (Will have its own Place soon™) + +*Jamba-Proc + - NoLonger is set to Default + +Jamba-Sell + - does not spam master with settings received. + +*Jamba-message + - Now only shows realm Name if not from the current Masters Realm + - You can now turn of the Raid warring Sound under Avd:message > raid warring and change the sound to None! + - Added Raid warring sound to play under SharedMediaLib. + +----------------------- +Jamba Version: 4.2 +WoW Game Version: 6.2.3 +Release Date: 29/12/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*Jamba-Toon + - new Currency's + - Added Valor points back. + - Fixed timewalker Currency to show the right Text. + +*Jamba-team-display + - Now Displays the word "DEAD" when the character is DEAD! and not 0% + - Added range that will change the Alpha on the display team list of the character that is not in range. Set to 40 yards. olny works in a party. + - Added characters durability (WIP) Its with bag space for now. no options. + +*Jamba-Quest-Watcher + -Now shows quests on the Jamba-Quest-Watcher that are percent based (EG: Tanaan Jungle dayly quests) + -Bonus Quests now Highlight as Red so there easyer to see. + +*Jamba-Core + -Nolonger shows JambaStartupMessage + +-------------- +Jamba Version: 4.1.3-Beta1 +WoW Game Version: 6.2.2 +Release Date: 30/10/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*Jamba-Toon + - Fixed a bug that was not saving the config to the database (not saving config on exit.) + + +-------------- +Jamba Version: 4.1.2 +WoW Game Version: 6.2.2 +Release Date: 30/10/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*Jamba-quest-watcher + - TeamQuests ((EG: :(1/6) )) will nolonger show for offline characters. + +*Jamba-Display-Team + - Added Combo points to the Display bar. will show all combo points on all characters + +*Jamba-Toon + - new Currency's + - Added Timewalker Coins + + +------------- +Jamba Version: 4.1.1 +WoW Game Version: 6.2 +Release Date: 08/7/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*Jamba-Display-Team + - Player/Minions Level should once again update When the player levels. + - Added a Option to stack the text on Jamba-Display Follow Text (Level & ilvl). + +Jamba-Toon + - Added 6.2.0 Currency's + - Oil + - Seal of InevitableFate + +------------- +Jamba Version: 4.1.0 +WoW Game Version: 6.2 +Release Date: 23/6/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +* Updated ToC for patch Patch 6.2 + +*Jamba-Display-Team + - Added a new option to display Characters Item Level + - Jamba-Display-Team-Bag Should Now Work Again and update correctly + +Jamba-Team + - Added Jamba to support Personal loot + +Jamba-Quest-Watcher + - Fixed a LUA error when entering a Bonus Objectives area, due to blizzard API changes for WoW-6.2.0 + + ------------ +Jamba Version: 4.0.5 +WoW Game Version: 6.1.0 +Release Date: 11/5/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*JambaCommunications +- Updated code to try and check every type of combo of chat channels addons can use. + +------------- + +Jamba Version: 4.0.4 +WoW Game Version: 6.1.0 +Release Date: 5/5/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*JambaCommunications +- had to change a lot of code to a big bug when In a Instance party/raid (there still might be a small prob if you was in LFR and you was still in the Instance in the outside world.). + + +*Jamba-Team +- fixed a bug if you have more then five characters in your party list it would change to raid even if there was less then five on-line. + +------------- +Jamba Version: 4.0.3 +WoW Game Version: 6.1.0 +Release Date: 5/5/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +*JambaCommunications + -Members on the same realm should beadle to use party/raid as there Communication again. + -Every time a command is Received it should not keep try and change the team members on line status if the character is already on line. + +Jamba-Item-Bar + - Added a new option Keep Item Bars on minions synchronized set on by default. + Suggestion http://wow.curseforge.com/addons/jamba/tickets/165-option-to-decouple-item-bar/ + + +------------- +Jamba Version: 4.0.2 +WoW Game Version: 6.1.0 +Release Date: 1/5/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +Core: +*added some new API +-JambaApi.GetTeamListMaximumOrderOnline +-JambaApi.TeamListOrderedOnline +-JambaApi.GetPositionForCharacterNameOnline + +Jamba-Follow +*jamba-follow train should not try to follow offline characters + +Jamba-Toon +*Currency Should no longer look try and display offline characters with blank bars. +*Currency Background will not only make the room for characters online. + +Jamba-Team +*loot should now set. + +------------- +Jamba Version: 4.0.1 +WoW Game Version: 6.1.0 +Release Date: 30/4/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +Jamba-team: +* Will now set new members to the team on-line. + +------------- +Jamba Version: 4.0.0 +WoW Game Version: 6.1.2 +Release Date: 29/4/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +Core +* Initial cross realm support. +* Slaves renamed to minions. +* No Longer beta + +Miscellaneous: +*Updated LibActionButtonJamba-1.0 to rev 60 (in hope it would work with mounts/pets But with no luck) +*Updated Libs to the newest there was. +*Added LibButtonGlow-1.0 +*Jamba Key Bindings are now on there own Tab on the new 6.x KeyBindingUI +*Added support to support for IsBoxer adding Realms, by removing any spaces it might feel like adding. + +Jamba-Communications +*Did a Rewrite on Jamba-Communications +*No Longer Jamba will have the Channel it used to have (that not many use from as far as i can tell) to keep Checking to see if team Members was online. +*Team members that are not in game will now show Offline. can be changed in Avd. communications +*Team members that that come online will now update there's and other members list to and set to online. +*Removed "there is no player %Name% Playing" chat Only for team members. +*Now sends Communication to PARTY If all fails then goes back to WHISPER. + +Jamba-Team +*Added Support For CR and CRZ** (Read notes about CRZ) +*Team Members are now added in Name-Realm Again +*Added Support realms with spaces in there names. +*Updated tons of the Code to support -Realm, Changed many parts and using the newer API that is a lot easier. + +Jamba-TeamDisplay +*Supports Cross-realm and Hp/Mana/XP/Rep/Follow +*Fixed Bars to be crackable with Clique (you need to pick this option under Jamba-Display and reload the UI. +*If not using Clique or its turn off then bars should target players now works on other realms. +*Should no longer be able to move the TeamBar when the player is in combat. +*Fixed a bug with Jamba Follow Looping. (follow Dance!) + +Jamba-QuestWatcher +* Now supports WoD Bonus Quests In outside world. (Bonus Objectives) + +Jamba-ItemUse +*Should now remove all QuestsUseItems No Longer in the players bags after handing in the quests or abandoning quests. +*removedCode for LibGratuity and LibBagUtils (Not updated anymore and wow has its WoW's own API) + + +Jamba-Quest +*Longer over Overrides Quest Log (L key) with World Map. Both will work now on there own. +*Abandon all quest button now works. + +Jamba-FTL +*Should now be supported for 4.0. (Thanks for the help bettysue) + +Notes: + +CR = connected realms EG You can trade/join guild ETC. All of jamba will work like normal Like your playing the same realm! + +CR = Join a Realm Over CRZ tech Note some of jamba will not work this is not down to me this is how blizzard Lets you talk over realms with addons YOU NEED TO BE IN PARTY WITH THE MEMBER FOR ANYTHING TO WORK! And some stuff might not work as you wish + + +------------- +Jamba Version: 3.13 +WoW Game Version: 6.1.0 +Release Date: 28/2/2015 +Modules: AdvancedLoot, Core, Display-Team, Follow, FTL, ItemUse, Macro, Proc, Purchase, Quest, Sell, Talk, Target, Taxi, Toon, Trade + +Jamba-Communications: +* Communications should now default to whispers in LFR dungeons, should no longer get "Not in raid" + +------------- + Jamba Version: 3.12 WoW Game Version: 6.1.0 Release Date: 24/2/2015 diff --git a/Jamba/Jamba.toc b/Jamba/Jamba.toc index bd5999f..f972f3b 100644 --- a/Jamba/Jamba.toc +++ b/Jamba/Jamba.toc @@ -1,9 +1,8 @@ -## Interface: 60100 +## Interface: 60200 ## Title: Jamba ## Notes: Jamba ## Author: Ebony, Former Author: Jafula -## Version: 3.12 -## X-Category: Interface Enhancements +## Version: 4.2.1 ## SavedVariables: JambaCoreProfileDB, JambaCommunicationsProfileDB, JambaTeamProfileDB, JambaTagProfileDB, JambaMessageProfileDB JambaEmbeds.xml JambaUtilities.lua @@ -15,3 +14,5 @@ JambaModule.lua JambaTeam.lua JambaTag.lua JambaMessage.lua +JambaStartupMessage.xml +startupmessage.html diff --git a/Jamba/JambaCommunications.lua b/Jamba/JambaCommunications.lua index 7abf19f..8ccf3dc 100644 --- a/Jamba/JambaCommunications.lua +++ b/Jamba/JambaCommunications.lua @@ -1,6 +1,8 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller + + License: The MIT License ]]-- @@ -17,7 +19,9 @@ local AJM = LibStub( "AceAddon-3.0" ):NewAddon( local L = LibStub( "AceLocale-3.0" ):GetLocale( "Jamba-Core" ) -- Get libraries. +local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" ) local AceSerializer = LibStub:GetLibrary( "AceSerializer-3.0" ) + local JambaHelperSettings = LibStub:GetLibrary( "JambaHelperSettings-1.0" ) -- JambaCommunications is not a module, but the same naming convention for these values is convenient. @@ -38,10 +42,12 @@ AJM.COMMUNICATION_GROUP = "RAID" -- Communication message prefix. AJM.MESSAGE_PREFIX = "JmbCmMsg" +--[[ -- Communication over channel for online status. AJM.COMMUNICATION_TEAM_ONLINE_PREFIX = "JmbCmTmOn" AJM.COMMUNICATION_MESSAGE_ONLINE = "JmbCmTmOnTe" AJM.COMMUNICATION_MESSAGE_OFFLINE = "JmbCmTmOnFe" +--]] -- Communication priorities. AJM.COMMUNICATION_PRIORITY_BULK = "BULK" @@ -60,8 +66,8 @@ AJM.COMMAND_INTERNAL_SEND_SETTINGS = "JmbCmSdSet" -- Messages module sends. ------------------------------------------------------------------------------------------------------------- -AJM.MESSAGE_CHARACTER_ONLINE = "JmbTmChrOn" -AJM.MESSAGE_CHARACTER_OFFLINE = "JmbTmChrOf" +--AJM.MESSAGE_CHARACTER_ONLINE = "JmbTmChrOn" +--AJM.MESSAGE_CHARACTER_OFFLINE = "JmbTmChrOf" -- Get a settings value. function AJM:ConfigurationGetSetting( key ) @@ -76,10 +82,12 @@ end -- Settings - the values to store and their defaults for the settings database. AJM.settings = { profile = { - teamOnlineChannelName = "JambaTeamIsOnline", - teamOnlineChannelPassword = "JambaTeamPassword", - showOnlineChannel = false, - assumeTeamAlwaysOnline = true, +-- DO NOT Change lines here! +-- teamOnlineChannelName = "JambaTeamIsOnline", +-- teamOnlineChannelPassword = "JambaTeamPassword", +-- showOnlineChannel = false, + assumeTeamAlwaysOnline = false, -- This is a place holder And is used as backup DO NOT CHANGE assumeTeamAlwaysOnline unless you know what your doing that you probs don't ;) + autoSetTeamOnlineorOffline = true, boostCommunication = true, }, } @@ -100,15 +108,7 @@ local function GetConfiguration() usage = "/jamba-comm push", get = false, set = "JambaSendSettings", - }, - channel = { - type = "input", - name = L["Change Channel"], - desc = L["Change the communications channel."], - usage = "/jamba-comm channel <channel name> <channel password>", - get = false, - set = "ChangeChannelCommand", - }, + }, }, } return configuration @@ -123,33 +123,7 @@ end ------------------------------------------------------------------------------------------------------------- -- Character online management. ------------------------------------------------------------------------------------------------------------- - -local function AssumeTeamAlwaysOnline() - return AJM.db.assumeTeamAlwaysOnline -end - --- Join the team online status channel. -local function JoinTeamOnlineStatusChannel() - local channelType, channelName = JoinTemporaryChannel( AJM.db.teamOnlineChannelName, AJM.db.teamOnlineChannelPassword ) - AJM.lastChannel = AJM.db.teamOnlineChannelName -end - --- Leave the team online status channel. -local function LeaveTeamOnlineStatusChannel() - LeaveChannelByName( AJM.channelJustMovedFrom ) - AJM.channelJustMovedFrom = AJM.lastChannel -end - -function AJM:SettingsChangeChannelClick( event ) - AJM:StopChannelPollTimer() - AJM:Print( "Changing Channel from [", AJM.lastChannel, "] to [", AJM.db.teamOnlineChannelName, "]." ) - AJM.channelJustMovedFrom = AJM.lastChannel - JoinTeamOnlineStatusChannel() - LeaveTeamOnlineStatusChannel() - AJM:StartChannelPollTimer() -end - --- Is a character online? +-- TODO: Is a character online? This needs Working on Ebony Or needs to go for now it always return true local function IsCharacterOnline( characterName ) if AJM.db.assumeTeamAlwaysOnline == true then return true @@ -157,98 +131,10 @@ local function IsCharacterOnline( characterName ) return JambaPrivate.Team.GetCharacterOnlineStatus( characterName ) end --- Test to see if the channel name provided is the name of the team online channel. -local function IsChannelTeamOnlineChannel( channelName ) - local isTeamOnlineChannel = false - if channelName ~= nil then - if AJM.db.showOnlineChannel == true then - AJM:Print( "Team Channel: match? this:", string.utf8lower( channelName ), "team:", string.utf8lower( AJM.lastChannel ), "or:", string.utf8lower( AJM.channelJustMovedFrom ) ) - end - if string.utf8lower( channelName ) == string.utf8lower( AJM.lastChannel ) then - isTeamOnlineChannel = true - end - if string.utf8lower( channelName) == string.utf8lower( AJM.channelJustMovedFrom ) then - isTeamOnlineChannel = true - end - end - return isTeamOnlineChannel -end - -function AJM:CHAT_MSG_CHANNEL_LIST( event, ... ) - if AJM.db.showOnlineChannel == true then - AJM:Print( "CHAT_MSG_CHANNEL_LIST" ) - end - local message, arg2, arg3, arg4, arg5, arg6, arg7, arg8, channelName, arg10, arg11, arg12 = ... - -- Is this the team online channel? - if IsChannelTeamOnlineChannel( channelName ) == true then - -- Yes, set all characters to be offline. - JambaPrivate.Team.SetTeamStatusToOffline() - -- Parse the message for characters. - local characters = {} - for character in message:gmatch( "[^,]+" ) do - table.insert( characters, character ) - end - for index, character in pairs( characters ) do - local characterName = character:gsub( "%s*%@*%**([^%s]+)", "%1" ) - -- Is this character in our team? - if JambaPrivate.Team.IsCharacterInTeam( characterName ) == true then - -- Set the character status to online. - JambaPrivate.Team.SetCharacterOnlineStatus( characterName, true ) - end - end - end -end - -function AJM:CHAT_MSG_CHANNEL_JOIN( event, ... ) - if AJM.db.showOnlineChannel == true then - AJM:Print( "CHAT_MSG_CHANNEL_JOIN" ) - end - local arg1, sender, arg3, arg4, arg5, arg6, arg7, arg8, channelName, arg10, arg11, arg12 = ... - -- Is this the team online channel? - if IsChannelTeamOnlineChannel( channelName ) == true then - -- Is this character in our team? - if JambaPrivate.Team.IsCharacterInTeam( sender ) == true then - -- Set the character status to online. - JambaPrivate.Team.SetCharacterOnlineStatus( sender, true ) - AJM:SendMessage( AJM.MESSAGE_CHARACTER_ONLINE ) - end - end -end - -function AJM:CHAT_MSG_CHANNEL_LEAVE( event, ... ) - if AJM.db.showOnlineChannel == true then - AJM:Print( "CHAT_MSG_CHANNEL_LEAVE" ) - end - local arg1, sender, arg3, arg4, arg5, arg6, arg7, arg8, channelName, arg10, arg11, arg12 = ... - -- Is this the team online channel? - if IsChannelTeamOnlineChannel( channelName ) == true then - -- Is this character in our team? - if JambaPrivate.Team.IsCharacterInTeam( sender ) == true then - -- Set the character status to offline. - JambaPrivate.Team.SetCharacterOnlineStatus( sender, false ) - AJM:SendMessage( AJM.MESSAGE_CHARACTER_OFFLINE ) - end - end +local function AssumeTeamAlwaysOnline() + return AJM.db.assumeTeamAlwaysOnline end --- TODO: Investigate ChatFrame_AddMessageEventFilter (hooks may be the wrong thing to do here) --- TODO: See http://www.wowwiki.com/API_ChatFrame_AddMessageEventFilter --- The ChatFrame_MessageEventHandler hook. -function AJM:ChatFrame_MessageEventHandler( self, event, ... ) - if AJM.db.showOnlineChannel == true then - AJM:Print( "ChatFrame_MessageEventHandler" ) - end - local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, channelName, arg10, arg11, arg12 = ... - -- Is this the team online channel? - if IsChannelTeamOnlineChannel( channelName ) == true then - -- Yes, the chat frames don't need to know about this channel. - if AJM.db.showOnlineChannel == false then - return true - end - end - -- Call the orginal function. - return AJM.hooks["ChatFrame_MessageEventHandler"]( self, event, ... ) -end ------------------------------------------------------------------------------------------------------------- -- Command management. @@ -256,12 +142,14 @@ end -- Creates a command to send. local function CreateCommandToSend( moduleName, commandName, ... ) + --AJM:Print("Create", moduleName, commandName) -- Start the message with the module name and a seperator. local message = moduleName..AJM.COMMAND_SEPERATOR -- Add the command name and a seperator. message = message..commandName..AJM.COMMAND_SEPERATOR -- Add any arguments to the message (serialized and seperated). local numberArguments = select( "#", ... ) + for iterateArguments = 1, numberArguments do local argument = select( iterateArguments, ... ) message = message..AceSerializer:Serialize( argument ) @@ -270,156 +158,265 @@ local function CreateCommandToSend( moduleName, commandName, ... ) end end -- Return the command to send. + --AJM:Print("Create", moduleName, commandName, iterateArguments) return message end --- Send a command to all members of the current team. +--[[ +-- Rewrite of communications start ebony. Using Guild, Party, then whisper +-- Send a command to all members of the current team. Trying to use a goble channel to send all communications on. local function CommandAll( moduleName, commandName, ... ) AJM:DebugMessage( "Command All: ", moduleName, commandName, ... ) -- Get the message to send. local message = CreateCommandToSend( moduleName, commandName, ... ) - -- Send command to all in group/raid. - --if not UnitInBattleground( "player" ) then - if UnitInParty( "player" ) == true then --or UnitInRaid( "player" ) then - if not UnitInBattleground( "player" ) then - AJM:DebugMessage( "Sending command to group." ) - AJM:SendCommMessage( + for characterName, characterOrder in JambaPrivate.Team.TeamList() do + -- Send command to all in party. + --if UnitInParty( characterName ) == true then and not isInInstance + --local Instance, instanceType = IsInInstance() + --AJM.Print("Raid test", Instance) + --if Instance == false then + if UnitInParty( Ambiguate( characterName, "none" ) ) == true then + if not UnitInBattleground( "player" ) then + --if not IsInInstance("raid") then + --AJM.Print("UnitisinParty", characterName ) + AJM:DebugMessage("Sending command to group.", message, "Group", nil) + AJM:SendCommMessage( + AJM.COMMAND_PREFIX, + message, + AJM.COMMUNICATION_GROUP, + nil, + AJM.COMMUNICATION_PRIORITY_ALERT + ) + --end + end + else + if IsCharacterOnline( characterName ) == true then + AJM:DebugMessage("Sending command to others not in party/raid.", message, "WHISPER", characterName, "online", IsCharacterOnline) + AJM:SendCommMessage( + AJM.COMMAND_PREFIX, + message, + AJM.COMMUNICATION_WHISPER, + characterName, + AJM.COMMUNICATION_PRIORITY_ALERT + ) + end + end + end +end +--]] + +local function CommandAll( moduleName, commandName, ... ) + -- AJM:DebugMessage( "Command All: ", moduleName, commandName, ... ) + --AJM:Print( "Command All: ", moduleName, commandName, ... ) + -- Get the message to send. + local message = CreateCommandToSend( moduleName, commandName, ... ) + local channel + -- toon has to be in a group + if UnitInBattleground( "player" ) then + AJM:DebugMessage( "PvP_INSTANCE") + channel = "INSTANCE_CHAT" + elseif IsInGroup() then + AJM:DebugMessage( "Group") + local isInstance, instanceType = IsInInstance() + local name, Type, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance = GetInstanceInfo() + if isInstance or instanceType == "raid" or IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then + if IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then + channel = "INSTANCE_CHAT" + else + if IsInRaid() then + channel = "RAID" + else + channel = "PARTY" + end + end + else + if IsInRaid() then + channel = "RAID" + else + channel = "PARTY" + end + end + end + --AJM:Print( "CHANNEL", channel) + if channel then + AJM:DebugMessage("Sending command to group.", message, "channel", channel, nil) + --AJM:Print("Sending command to group.", message, "channel", channel, nil) + --AJM.COMMUNICATION_GROUP, + AJM:SendCommMessage( AJM.COMMAND_PREFIX, message, - AJM.COMMUNICATION_GROUP, + channel, nil, AJM.COMMUNICATION_PRIORITY_ALERT ) - end + --AJM:Print("testChennel", AJM.COMMAND_PREFIX, channel, AJM.COMMUNICATION_PRIORITY_ALERT) + --return end - -- If player not in a party or raid, then send to player. Pointless as does it under anyway, x2 everything! --- if GetNumSubgroupMembers() == 0 and GetNumGroupMembers() == 0 then --- AJM:DebugMessage( "Sending command just to single player." ) --- AJM:SendCommMessage( --- AJM.COMMAND_PREFIX, --- message, --- AJM.COMMUNICATION_WHISPER, --- UnitName( "player" ), --- AJM.COMMUNICATION_PRIORITY_ALERT --- ) --- end - -- Send the message to all members of the current team that are not in a party / raid. - for characterName, characterOrder in JambaPrivate.Team.TeamList() do - if IsCharacterOnline( characterName ) == true then - local canSend = false - -- Team member not in party then send command. - if not UnitInParty( characterName ) then - canSend = true - end - --If in a battleground then send a whisper as the party/raid would have not been sent. - if UnitInBattleground( characterName ) then - canSend = true - end - if canSend == true then - AJM:DebugMessage( "Sending command to others not in party/raid." ) - AJM:SendCommMessage( + --if the unit is not in the party then it unlikely did not get the party message, + for characterName, characterOrder in JambaPrivate.Team.TeamList() do + --AJM:Print( "Toon not in party:", characterName) + if UnitInParty( Ambiguate( characterName, "none" ) ) == false then + AJM:DebugMessage( "Toon not in party:", characterName) + if IsCharacterOnline( characterName ) == true then + AJM:DebugMessage("Sending command to others not in party/raid.", message, "WHISPER", characterName) + AJM:SendCommMessage( AJM.COMMAND_PREFIX, message, AJM.COMMUNICATION_WHISPER, characterName, AJM.COMMUNICATION_PRIORITY_ALERT - ) - end + ) + --AJM:Print("testWis", AJM.COMMAND_PREFIX, AJM.COMMUNICATION_WHISPER, characterName , AJM.COMMUNICATION_PRIORITY_ALERT) + end end - end + end end + + +-- Should this get removed at some point and use all comms on one channel??? +-- WHISPER's don't work cross-realm but do work connected-realm so sending msg to masters would not send. +-- TODO: Maybe remove masters???, and fall back to everyone being the master? +-- Not really sure what to do so for now will keep with the master, and whisper them, +-- if was to use party/raid then everyone will get the command and masters would not work. + -- Send a command to the master. local function CommandMaster( moduleName, commandName, ... ) --- AJM:DebugMessage( "Command Master: ", moduleName, commandName, ... ) + AJM:DebugMessage( "Command Master: ", moduleName, commandName, ... ) -- Get the message to send. local message = CreateCommandToSend( moduleName, commandName, ... ) -- Send the message to the master. local characterName = JambaPrivate.Team.GetMasterName() - if IsCharacterOnline( characterName ) == true then - AJM:SendCommMessage( - AJM.COMMAND_PREFIX, - message, - AJM.COMMUNICATION_WHISPER, - characterName, - AJM.COMMUNICATION_PRIORITY_ALERT - ) - end + if IsCharacterOnline( characterName ) == true then + AJM:DebugMessage("Sending command to others not in party/raid.", message, "WHISPER", characterName) + AJM:SendCommMessage( + AJM.COMMAND_PREFIX, + message, + AJM.COMMUNICATION_WHISPER, + characterName, + AJM.COMMUNICATION_PRIORITY_ALERT + ) + end end -- Send a command to the master. local function CommandToon( moduleName, characterName, commandName, ... ) -- Get the message to send. local message = CreateCommandToSend( moduleName, commandName, ... ) - if IsCharacterOnline( characterName ) == true then - AJM:SendCommMessage( - AJM.COMMAND_PREFIX, - message, - AJM.COMMUNICATION_WHISPER, - characterName, - AJM.COMMUNICATION_PRIORITY_ALERT - ) - end -end - --- Send a command to all slave characters of the current team. -local function CommandSlaves( moduleName, commandName, ... ) - -- Get the message to send. - local message = CreateCommandToSend( moduleName, commandName, ... ) - -- Send the message to all members of the current team. - for characterName, characterOrder in JambaPrivate.Team.TeamList() do if IsCharacterOnline( characterName ) == true then - if JambaPrivate.Team.IsCharacterTheMaster( characterName ) == false then + AJM:DebugMessage("Sending command to others not in party/raid.", message, "WHISPER", characterName) AJM:SendCommMessage( - AJM.COMMAND_PREFIX, - message, - AJM.COMMUNICATION_WHISPER, - characterName, - AJM.COMMUNICATION_PRIORITY_ALERT + AJM.COMMAND_PREFIX, + message, + AJM.COMMUNICATION_WHISPER, + characterName, + AJM.COMMUNICATION_PRIORITY_ALERT ) + end +end + +-- EbonyTest +-- hide offline player spam Not really the best way but it works, Maybe adding tick box's to set members offline? This should now work with elvUI? + +local function SystemSpamFilter(frame, event, message) + if( event == "CHAT_MSG_SYSTEM") then + if message:match(string.format(ERR_CHAT_PLAYER_NOT_FOUND_S, "(.+)")) then + local SearchPlayerNotFound = gsub(ERR_CHAT_PLAYER_NOT_FOUND_S, "%%s", "(.+)") -- Get from "No player named '%s' is currently playing." + local _, _, characterName = strfind(message, SearchPlayerNotFound) + if JambaApi.IsCharacterInTeam(characterName) == true then + --AJM:Print("player offline in team", characterName ) + if AJM.db.autoSetTeamOnlineorOffline == true then + if IsCharacterOnline( characterName ) == true then + JambaApi.setOffline( characterName, false ) + --AJM:Print("player offline in team", characterName ) + end + end + return true + else + --AJM:Print("player offline Not in team") + return end + end + if message:match(string.format(ERR_NOT_IN_RAID, "(.+)")) then + return true end - end + end + return false +end +ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", SystemSpamFilter) + + +--Ebony old way. was this is a better way? it did not work with EvlUI. +--[[ +function AJM:ChatFrame_MessageEventHandler(frame, event, msg, ...) + --if event == "CHAT_MSG_SYSTEM" then + if( event == "CHAT_MSG_SYSTEM") then + --local match = strmatch(msg, format(ERR_CHAT_PLAYER_NOT_FOUND_S, "(.+)")) + --if match then + if msg:match(string.format(ERR_CHAT_PLAYER_NOT_FOUND_S, "(.+)")) then + return true + --if (not match) then + --IF not match then Go about whatever you wonted to do, If match hide Msg from player. + --self:DebugMessage( "Not matched!" ) + --self.hooks.ChatFrame_MessageEventHandler(frame, event, ...) + --AJM.hooks["ChatFrame_MessageEventHandler"]( self, event, ... ) + end + else + self.hooks.ChatFrame_MessageEventHandler(frame, event, ...); + end + end +--]] +--ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", SystemSpamFilter) +--AJM.ChatFrame_AddMessageEventVanasKoS("CHAT_MSG_SYSTEM", AJM:ChatFrame_MessageEventHandler) + -- Receive a command from another character. function AJM:CommandReceived( prefix, message, distribution, sender ) - AJM:DebugMessage( "Command received: ", prefix, message, distribution, sender ) + local characterName = JambaUtilities:AddRealmToNameIfMissing( sender ) + AJM:DebugMessage( "Command received: ", prefix, message, distribution, sender ) + --AJM:Print( "Command received: ", prefix, message, distribution, sender ) -- Check if the command is for Jamba Communications. if prefix == AJM.COMMAND_PREFIX then - -- Check if the sender is trusted. - sender = Ambiguate(sender, "none") - AJM:DebugMessage( "Sender after ambiguate: ", sender ) + --checks the char is in the team if not everyone can change settings and we do not want that if JambaPrivate.Team.IsCharacterInTeam( sender ) == true then - AJM:DebugMessage( "Sender is in team list." ) + AJM:DebugMessage( "Sender is in team list." ) + --automaic setting team members online. -- we don't really need to keep sending this so we add a if + --AJM:Print("toonnonline", sender ) + if JambaPrivate.Team.GetCharacterOnlineStatus( characterName ) == false then + --AJM:Print("Setting Toon online", sender, characterName ) + JambaApi.setOnline( characterName, true) + end -- Split the command into its components. local moduleName, commandName, argumentsStringSerialized = strsplit( AJM.COMMAND_SEPERATOR, message ) local argumentsTable = {} -- Are there any arguments? if (argumentsStringSerialized ~= nil) and (argumentsStringSerialized:trim() == "") then -- No. + else + -- Deserialize the arguments. + local argumentsTableSerialized = { strsplit( AJM.COMMAND_ARGUMENT_SEPERATOR, argumentsStringSerialized ) } + for index, argumentSerialized in ipairs( argumentsTableSerialized ) do + local success, argument = AceSerializer:Deserialize( argumentSerialized ) + if success == true then + table.insert( argumentsTable, argument ) + else + error( L["A: Failed to deserialize command arguments for B from C."]( "AJM", moduleName, sender ) ) + end + end + end + -- Look for internal Jamba Communication commands. + if commandName == AJM.COMMAND_INTERNAL_SEND_SETTINGS then + -- Tell JambaCore to handle the settings received. + JambaPrivate.Core.OnSettingsReceived( sender, moduleName, unpack( argumentsTable ) ) + else + -- Any other command can go directly to the module that sent it. + AJM:DebugMessage( "Sending command on to module: ", sender, moduleName, commandName, unpack( argumentsTable ) ) + JambaPrivate.Core.OnCommandReceived( sender, moduleName, commandName, unpack( argumentsTable ) ) + end else - -- Deserialize the arguments. - local argumentsTableSerialized = { strsplit( AJM.COMMAND_ARGUMENT_SEPERATOR, argumentsStringSerialized ) } - for index, argumentSerialized in ipairs( argumentsTableSerialized ) do - local success, argument = AceSerializer:Deserialize( argumentSerialized ) - if success == true then - table.insert( argumentsTable, argument ) - else - error( L["A: Failed to deserialize command arguments for B from C."]( "AJM", moduleName, sender ) ) - end - end + AJM:DebugMessage( "Sender is NOT in team list." ) end - -- Look for internal Jamba Communication commands. - if commandName == AJM.COMMAND_INTERNAL_SEND_SETTINGS then - -- Tell JambaCore to handle the settings received. - JambaPrivate.Core.OnSettingsReceived( sender, moduleName, unpack( argumentsTable ) ) - else - -- Any other command can go directly to the module that sent it. - AJM:DebugMessage( "Sending command on to module: ", sender, moduleName, commandName, unpack( argumentsTable ) ) - JambaPrivate.Core.OnCommandReceived( sender, moduleName, commandName, unpack( argumentsTable ) ) - end - end end end @@ -430,6 +427,7 @@ end -- Send settings to all members of the current team. local function SendSettings( moduleName, settings ) -- Send a push settings command to all. + --AJM:Print("test", moduleName, AJM.COMMAND_INTERNAL_SEND_SETTINGS, settings ) CommandAll( moduleName, AJM.COMMAND_INTERNAL_SEND_SETTINGS, settings ) end @@ -439,7 +437,9 @@ local function SendCommandAll( moduleName, commandName, ... ) CommandAll( moduleName, commandName, ... ) end --- Command the master. +-- TODO: needs to be cleaned up at some point with other communication stuff + +-- Command the master. local function SendCommandMaster( moduleName, commandName, ... ) -- Send the command to the master character. CommandMaster( moduleName, commandName, ... ) @@ -457,7 +457,7 @@ end -- Initialize the addon. function AJM:OnInitialize() - AJM.channelPollTimer = nil + --AJM.channelPollTimer = nil -- Register commands with AceComms - tell AceComms to call the CommandReceived function when a command is received. AJM:RegisterComm( AJM.COMMAND_PREFIX, "CommandReceived" ) -- Create the settings database supplying the settings values along with defaults. @@ -471,26 +471,22 @@ function AJM:OnInitialize() AJM:SettingsCreate() AJM.settingsFrame = AJM.settingsControl.widgetSettings.frame AJM:SettingsRefresh() - if AJM.db.assumeTeamAlwaysOnline == false then - -- Hook the ChatFrame_MessageEventHandler to hide any messages that are for the team online channel. - AJM:RawHook( "ChatFrame_MessageEventHandler", true ) - end - AJM.characterName = UnitName( "player" ) + --TODO: Is this needed? as its already in a module?? + local k = GetRealmName() + local realm = k:gsub( "%s+", "" ) + self.characterRealm = realm + self.characterNameLessRealm = UnitName( "player" ) + self.characterName = self.characterNameLessRealm.."-"..self.characterRealm AJM.characterGUID = UnitGUID( "player" ) - AJM:RegisterChatCommand( AJM.chatCommand, "JambaChatCommand" ) + -- End of needed: + --AJM:RegisterChatCommand( AJM.chatCommand, "JambaChatCommand" ) -- Register communications as a module. JambaPrivate.Core.RegisterModule( AJM, AJM.moduleName ) - -- The last channel joined. - AJM.lastChannel = AJM.db.teamOnlineChannelName - AJM.channelJustMovedFrom = AJM.lastChannel end - + function AJM:OnEnable() - if AJM.db.assumeTeamAlwaysOnline == false then - -- Wait for some seconds before initialising the team online channel. - -- This lets the defaults channels get the usual channel numbers (i.e. Trade is /2). - AJM:ScheduleTimer( "InitialiseTeamOnlineChannel", 10 ) - end + --local hookSecure = true + --AJM:RawHook( "ChatFrame_MessageEventHandler", true ) if AJM.db.boostCommunication == true then AJM:BoostCommunication() -- Repeat every 5 minutes. @@ -520,32 +516,21 @@ function AJM:JambaChatCommand( input ) end end -function AJM:InitialiseTeamOnlineChannel() - -- Register for the list of members in a channel event. - AJM:RegisterEvent( "CHAT_MSG_CHANNEL_LIST" ) - -- And for joiners and leavers. - AJM:RegisterEvent( "CHAT_MSG_CHANNEL_JOIN" ) - AJM:RegisterEvent( "CHAT_MSG_CHANNEL_LEAVE" ) - -- Join the team online channel. - JoinTeamOnlineStatusChannel() - -- Ask for a list of characters in the team online channel. - ListChannelByName( AJM.lastChannel ) - AJM:StartChannelPollTimer() -end - +--[[ function AJM:StopChannelPollTimer() if AJM.channelPollTimer ~= nil then AJM:CancelTimer( AJM.channelPollTimer ) end end + function AJM:StartChannelPollTimer() -- Poll for characters every 5 seconds. AJM.channelPollTimer = AJM:ScheduleRepeatingTimer( ListChannelByName, 5, AJM.lastChannel ) end - +--]] function AJM:OnDisable() - AJM:CancelAllTimers() + --AJM:CancelAllTimers() end ------------------------------------------------------------------------------------------------------------- @@ -581,26 +566,35 @@ function AJM:SettingsCreateOptions( top ) local halfWidth = (headingWidth - horizontalSpacing) / 2 local column1Left = left local movingTop = top - -- Create a heading for information. - JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Team Online Check"], movingTop, false ) - movingTop = movingTop - headingHeight + JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Team Online Check"], movingTop, false )-- + movingTop = movingTop - headingHeight + --[[ AJM.settingsControl.checkBoxAssumeAlwaysOnline = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, column1Left, movingTop, - L["Assume All Team Members Always Online*"], + L["Use Team List Offline Button"], AJM.CheckBoxAssumeAlwaysOnline ) - movingTop = movingTop - checkBoxHeight + movingTop = movingTop - checkBoxHeight AJM.settingsControl.labelInformationAlwaysOnline = JambaHelperSettings:CreateContinueLabel( AJM.settingsControl, headingWidth, column1Left, movingTop, - L["*reload UI to take effect"] - ) - movingTop = movingTop - labelContinueHeight + L["**Untick this to use the WIP Set Offline team List Set offline Button"] + ) + --]] + AJM.settingsControl.checkBoxAutoSetTeamOnlineorOffline = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + headingWidth, + column1Left, + movingTop, + L["Auto Set Team Members On and Off Line"], + AJM.CheckBoxAutoSetTeamOnlineorOffline + ) + movingTop = movingTop - checkBoxHeight AJM.settingsControl.checkBoxBoostCommunication = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, @@ -617,64 +611,6 @@ function AJM:SettingsCreateOptions( top ) movingTop, L["**reload UI to take effect, may cause disconnections"] ) - movingTop = movingTop - labelContinueHeight - -- Create a heading for information. - JambaHelperSettings:CreateHeading( AJM.settingsControl, L["Team Online Channel"], movingTop, false ) - movingTop = movingTop - headingHeight - -- Information line 1. - AJM.settingsControl.labelInformation1 = JambaHelperSettings:CreateContinueLabel( - AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["After you change the channel name or password, push the"] - ) - movingTop = movingTop - labelContinueHeight - -- Information line 2. - AJM.settingsControl.labelInformation2 = JambaHelperSettings:CreateContinueLabel( - AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["new settings to all your other characters and then log off"] - ) - movingTop = movingTop - labelContinueHeight - -- Information line 3. - AJM.settingsControl.labelInformation3 = JambaHelperSettings:CreateContinueLabel( - AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["all your characters and log them on again."] - ) - movingTop = movingTop - labelContinueHeight - -- Channel name. - AJM.settingsControl.editBoxChannelName = JambaHelperSettings:CreateEditBox( AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["Channel Name"] - ) - AJM.settingsControl.editBoxChannelName:SetCallback( "OnEnterPressed", AJM.EditBoxChannelNameChanged ) - movingTop = movingTop - editBoxHeight - -- Channel password. - AJM.settingsControl.editBoxChannelPassword = JambaHelperSettings:CreateEditBox( AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["Channel Password"] - ) - AJM.settingsControl.editBoxChannelPassword:SetCallback( "OnEnterPressed", AJM.EditBoxChannelPasswordChanged ) - movingTop = movingTop - editBoxHeight - -- Change channel button. - AJM.settingsControl.buttonChangeChannel = JambaHelperSettings:CreateButton( - AJM.settingsControl, - headingWidth, - column1Left, - movingTop, - L["Change Channel (Debug)"], - AJM.SettingsChangeChannelClick - ) movingTop = movingTop - buttonHeight AJM.settingsControl.checkBoxShowChannel = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, @@ -688,17 +624,9 @@ function AJM:SettingsCreateOptions( top ) return movingTop end -function AJM:EditBoxChannelNameChanged( event, text ) - AJM.db.teamOnlineChannelName = text -end - -function AJM:EditBoxChannelPasswordChanged( event, text ) - AJM.db.teamOnlineChannelPassword = text -end - -function AJM:CheckBoxShowChannelClick( event, value ) - AJM.db.showOnlineChannel = value - AJM:SettingsRefresh() +function AJM:CheckBoxBoostCommunication( event, value ) + AJM.db.boostCommunication = value + AJM:SettingsRefresh() end function AJM:CheckBoxAssumeAlwaysOnline( event, value ) @@ -706,8 +634,8 @@ function AJM:CheckBoxAssumeAlwaysOnline( event, value ) AJM:SettingsRefresh() end -function AJM:CheckBoxBoostCommunication( event, value ) - AJM.db.boostCommunication = value +function AJM:CheckBoxAutoSetTeamOnlineorOffline( event, value ) + AJM.db.autoSetTeamOnlineorOffline = value AJM:SettingsRefresh() end @@ -719,10 +647,8 @@ function AJM:OnJambaProfileChanged() end function AJM:SettingsRefresh() - AJM.settingsControl.editBoxChannelName:SetText( AJM.db.teamOnlineChannelName ) - AJM.settingsControl.editBoxChannelPassword:SetText( AJM.db.teamOnlineChannelPassword ) - AJM.settingsControl.checkBoxShowChannel:SetValue( AJM.db.showOnlineChannel ) - AJM.settingsControl.checkBoxAssumeAlwaysOnline:SetValue( AJM.db.assumeTeamAlwaysOnline ) +-- AJM.settingsControl.checkBoxAssumeAlwaysOnline:SetValue( AJM.db.assumeTeamAlwaysOnline ) + AJM.settingsControl.checkBoxAutoSetTeamOnlineorOffline:SetValue( AJM.db.autoSetTeamOnlineorOffline ) AJM.settingsControl.checkBoxBoostCommunication:SetValue( AJM.db.boostCommunication ) end @@ -735,30 +661,18 @@ end function AJM:JambaOnSettingsReceived( characterName, settings ) if characterName ~= AJM.characterName then -- Update the settings. - AJM.db.teamOnlineChannelName = settings.teamOnlineChannelName - AJM.db.teamOnlineChannelPassword = settings.teamOnlineChannelPassword - AJM.db.showOnlineChannel = settings.showOnlineChannel AJM.db.assumeTeamAlwaysOnline = settings.assumeTeamAlwaysOnline + AJM.db.autoSetTeamOnlineorOffline = settings.autoSetTeamOnlineorOffline AJM.db.boostCommunication = settings.boostCommunication -- Refresh the settings. AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end -function AJM:ChangeChannelCommand( info, parameters ) - local name, password = strsplit( " ", parameters ) - AJM:ChangeChannelCommandAction( name, password ) -end - -function AJM:ChangeChannelCommandAction( name, password ) - AJM.db.teamOnlineChannelName = name - AJM.db.teamOnlineChannelPassword = password - AJM:SettingsRefresh() - AJM:SettingsChangeChannelClick( nil ) -end - -- text = message to send -- chatDestination = "PARTY, WHISPER, RAID, CHANNEL, etc" -- characterOrChannelName = character name if WHISPER or channel name if CHANNEL or nil otherwise @@ -768,8 +682,13 @@ end -- AJM.COMMUNICATION_PRIORITY_ALERT local function SendChatMessage( text, chatDestination, characterOrChannelName, priority ) -- Message small enough to send? + AJM:Print("test", text, chatDestination, characterOrChannelName, priority) + if text:len() <= 255 then + --AJM:Print("test TURE!!!!! TOBIG" ) ChatThrottleLib:SendChatMessage( priority, AJM.MESSAGE_PREFIX, text, chatDestination, nil, characterOrChannelName, nil ) + + else -- No, message is too big, split into smaller messages, taking UTF8 characters into account. local bytesAvailable = string.utf8len(text1) @@ -813,13 +732,16 @@ JambaPrivate.Communications.SendSettings = SendSettings JambaPrivate.Communications.SendCommandAll = SendCommandAll JambaPrivate.Communications.SendCommandMaster = SendCommandMaster JambaPrivate.Communications.SendCommandToon = SendCommandToon +JambaPrivate.Communications.SendCommandMaster = SendCommandMaster +JambaPrivate.Communications.SendCommandToon = SendCommandToon JambaPrivate.Communications.AssumeTeamAlwaysOnline = AssumeTeamAlwaysOnline -JambaPrivate.Communications.MESSAGE_CHARACTER_ONLINE = AJM.MESSAGE_CHARACTER_ONLINE -JambaPrivate.Communications.MESSAGE_CHARACTER_OFFLINE = AJM.MESSAGE_CHARACTER_OFFLINE - +-- moved to jamba-team +--JambaPrivate.Communications.MESSAGE_CHARACTER_ONLINE = AJM.MESSAGE_CHARACTER_ONLINE +--JambaPrivate.Communications.MESSAGE_CHARACTER_OFFLINE = AJM.MESSAGE_CHARACTER_OFFLINE JambaApi.SendChatMessage = SendChatMessage JambaApi.COMMUNICATION_PRIORITY_BULK = AJM.COMMUNICATION_PRIORITY_BULK JambaApi.COMMUNICATION_PRIORITY_NORMAL = AJM.COMMUNICATION_PRIORITY_NORMAL JambaApi.COMMUNICATION_PRIORITY_ALERT = AJM.COMMUNICATION_PRIORITY_ALERT -JambaApi.MESSAGE_CHARACTER_ONLINE = AJM.MESSAGE_CHARACTER_ONLINE -JambaApi.MESSAGE_CHARACTER_OFFLINE = AJM.MESSAGE_CHARACTER_OFFLINE +-- moved to jamba-team +--JambaApi.MESSAGE_CHARACTER_ONLINE = AJM.MESSAGE_CHARACTER_ONLINE +--JambaApi.MESSAGE_CHARACTER_OFFLINE = AJM.MESSAGE_CHARACTER_OFFLINE diff --git a/Jamba/JambaCore.lua b/Jamba/JambaCore.lua index 5eba2ff..25b8bb5 100644 --- a/Jamba/JambaCore.lua +++ b/Jamba/JambaCore.lua @@ -1,7 +1,9 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License + + ]]-- -- The global private table for Jamba. @@ -46,6 +48,17 @@ JambaPrivate.SettingsFrame.WidgetTree:EnableButtonTooltips( false ) JambaPrivate.SettingsFrame.Widget:AddChild( JambaPrivate.SettingsFrame.WidgetTree ) JambaPrivate.SettingsFrame.WidgetTree:SetLayout( "Fill" ) +function AJM:OnEnable() + if AJM.db.showStartupMessage4000 then + JambaStartupMessageFrameTitle:SetText( L["Jamba"].." "..GetAddOnMetadata("Jamba", "version").." - "..L["Release Notes / News"] ) + --JambaStartupMessageFrame:Show() + AJM.db.showStartupMessage4000 = false + end +end + +function AJM:OnDisable() +end + local function JambaSettingsTreeSort( a, b ) local aText = "" local bText = "" @@ -216,6 +229,7 @@ table.insert( UISpecialFrames, "JambaSettingsWindowsFrame" ) AJM.settings = { profile = { showMinimapIcon = true, + showStartupMessage4000 = true, }, } @@ -298,6 +312,9 @@ end -- Settings are received, pass them to the relevant module. local function OnSettingsReceived( sender, moduleName, settings ) + + sender = JambaUtilities:AddRealmToNameIfMissing( sender ) + --AJM:Print("onsettings", sender, moduleName ) -- Get the address of the module. local moduleAddress = AJM.registeredModulesByName[moduleName] -- Pass the module its settings. @@ -326,7 +343,7 @@ end -- Send a command for the module specified (using its address) to the master character. local function SendCommandToMaster( moduleAddress, commandName, ... ) --- Get the name of the module. + -- Get the name of the module. local moduleName = AJM.registeredModulesByAddress[moduleAddress] -- Send the command identified by the module name. JambaPrivate.Communications.SendCommandMaster( moduleName, commandName, ... ) @@ -341,6 +358,7 @@ end -- A command is received, pass it to the relevant module. local function OnCommandReceived( sender, moduleName, commandName, ... ) + sender = JambaUtilities:AddRealmToNameIfMissing( sender ) -- Get the address of the module. local moduleAddress = AJM.registeredModulesByName[moduleName] -- Pass the module its settings. @@ -519,12 +537,6 @@ function AJM:LoadJambaModule( moduleName ) end end -function AJM:OnEnable() -end - -function AJM:OnDisable() -end - function AJM:CoreSettingsCreateInfo( top ) -- Get positions and dimensions. local buttonPushAllSettingsWidth = 300 @@ -556,7 +568,7 @@ function AJM:CoreSettingsCreateInfo( top ) headingWidth, column1Left, movingTop, - L["Copyright 2008-2015 Michael 'Jafula' Miller"] + L["Copyright 2008-2016 Michael 'Jafula' Miller, Now managed By Ebony"] ) movingTop = movingTop - labelContinueHeight @@ -565,7 +577,7 @@ function AJM:CoreSettingsCreateInfo( top ) headingWidth, column1Left, movingTop, - L["Made in New Zealand"] + L["Made For MultiBoxing"] ) movingTop = movingTop - labelContinueHeight @@ -587,6 +599,42 @@ function AJM:CoreSettingsCreateInfo( top ) ) movingTop = movingTop - labelContinueHeight + AJM.settingsControl.labelInformation5 = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControl, + headingWidth, + column1Left, + movingTop, + L["Other useful websites:"] + ) + movingTop = movingTop - labelContinueHeight + + AJM.settingsControl.labelInformation6 = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControl, + headingWidth, + column1Left, + movingTop, + L["http://dual-boxing.com/"] + ) + movingTop = movingTop - labelContinueHeight + + AJM.settingsControl.labelInformation7 = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControl, + headingWidth, + column1Left, + movingTop, + "" + ) + movingTop = movingTop - labelContinueHeight + + AJM.settingsControl.labelInformation8 = JambaHelperSettings:CreateContinueLabel( + AJM.settingsControl, + headingWidth, + column1Left, + movingTop, + "" + ) + movingTop = movingTop - labelContinueHeight + AJM.settingsControl.labelInformation9 = JambaHelperSettings:CreateContinueLabel( AJM.settingsControl, headingWidth, @@ -601,7 +649,7 @@ function AJM:CoreSettingsCreateInfo( top ) headingWidth, column1Left, movingTop, - L["http://dual-boxing.com/"] + "" ) movingTop = movingTop - labelContinueHeight @@ -610,7 +658,7 @@ function AJM:CoreSettingsCreateInfo( top ) headingWidth, column1Left, movingTop, - "" + L["Special thanks to Michael 'Jafula' Miller who made Jamba"] ) movingTop = movingTop - labelContinueHeight @@ -675,6 +723,8 @@ end -- Core settings received. function AJM:JambaOnSettingsReceived( characterName, settings ) + --Checks character is not the the character that send the settings. Now checks the character has a realm on there name to match Jamba team list. + --characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) if characterName ~= AJM.characterName then -- Update the settings. -- TODO: What is this minimap icon? @@ -683,6 +733,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -718,6 +770,6 @@ JambaPrivate.Core.OnSettingsReceived = OnSettingsReceived JambaPrivate.Core.SendCommandToTeam = SendCommandToTeam JambaPrivate.Core.SendCommandToMaster = SendCommandToMaster JambaPrivate.Core.SendCommandToToon = SendCommandToToon --- TODO: Remove send command to slaves? ---JambaPrivate.Core.SendCommandToSlaves = SendCommandToSlaves -JambaPrivate.Core.OnCommandReceived = OnCommandReceived +-- TODO: Remove send command to minions? +--JambaPrivate.Core.SendCommandToMinions = SendCommandToMinions +JambaPrivate.Core.OnCommandReceived = OnCommandReceived \ No newline at end of file diff --git a/Jamba/JambaEmbeds.xml b/Jamba/JambaEmbeds.xml index 40a66cf..eb2a6de 100644 --- a/Jamba/JambaEmbeds.xml +++ b/Jamba/JambaEmbeds.xml @@ -1,6 +1,6 @@ <!-- Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License http://jafula.com/jamba/ --> diff --git a/Jamba/JambaHelperSettings.lua b/Jamba/JambaHelperSettings.lua index edd48c7..a36ed66 100644 --- a/Jamba/JambaHelperSettings.lua +++ b/Jamba/JambaHelperSettings.lua @@ -1,6 +1,8 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller + + License: The MIT License ]]-- diff --git a/Jamba/JambaMessage.lua b/Jamba/JambaMessage.lua index 412ef0e..54ae245 100644 --- a/Jamba/JambaMessage.lua +++ b/Jamba/JambaMessage.lua @@ -1,6 +1,8 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller + + License: The MIT License ]]-- @@ -18,6 +20,10 @@ local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" ) local JambaHelperSettings = LibStub:GetLibrary( "JambaHelperSettings-1.0" ) local Media = LibStub("LibSharedMedia-3.0") +-- Built in Sounds +Media:Register("sound", "Jamba: RaidWarning", "Sound\\interface\\RaidWarning.ogg") + + -- Constants and Locale for this module. AJM.moduleName = "Jamba-Message" AJM.settingsDatabaseName = "JambaMessageProfileDB" @@ -181,6 +187,7 @@ AJM.settings = { ["type"] = 8, ["name"] = L["Default Warning"], ["tag"] = JambaPrivate.Tag.MasterTag(), + ["soundToPlay"] = "Jamba: RaidWarning", }, { ["type"] = 12, @@ -256,6 +263,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -817,13 +826,14 @@ local function DefaultWarningArea() end local function DisplayMessageDefaultChat( sender, message, suppressSender ) + local senderName = Ambiguate(sender, "none") local chatTimestamp = "" if (CHAT_TIMESTAMP_FORMAT) then chatTimestamp = BetterDate( CHAT_TIMESTAMP_FORMAT, time() ) end local completeMessage = chatTimestamp if suppressSender == false then - completeMessage = completeMessage.."|Hplayer:"..sender.."|h["..sender.."]|h"..L[": "] + completeMessage = completeMessage.."|Hplayer:"..sender.."|h["..senderName.."]|h"..L[": "] end completeMessage = completeMessage..message DEFAULT_CHAT_FRAME:AddMessage( completeMessage ) @@ -866,18 +876,21 @@ end local function DisplayMessageRaidWarning( sender, message, suppressSender ) local completeMessage = "" + local senderName = Ambiguate(sender, "none") if suppressSender == false then - completeMessage = completeMessage..sender..L[": "] + completeMessage = completeMessage..senderName..L[": "] end completeMessage = completeMessage..message RaidNotice_AddMessage( RaidWarningFrame, completeMessage, ChatTypeInfo["RAID_WARNING"] ) - PlaySound( "RaidWarning" ) + -- This is now registerd though Shared Media so it can be truned off if the user choices. *ebony + --PlaySound( "RaidWarning" ) end local function DisplayMessageParrot( sender, message, areaOnScreenName, suppressSender ) local completeMessage = "" + local senderName = Ambiguate(sender, "none") if suppressSender == false then - completeMessage = completeMessage..sender..L[": "] + completeMessage = completeMessage..senderName..L[": "] end completeMessage = completeMessage..message if Parrot ~= nil then @@ -890,8 +903,9 @@ end local function DisplayMessageMikSBT( sender, message, areaOnScreenName, suppressSender ) local completeMessage = "" + local senderName = Ambiguate(sender, "none") if suppressSender == false then - completeMessage = completeMessage..sender..L[": "] + completeMessage = completeMessage..senderName..L[": "] end completeMessage = completeMessage..message if MikSBT ~= nil then diff --git a/Jamba/JambaModule.lua b/Jamba/JambaModule.lua index 72ba1e5..a95fc1c 100644 --- a/Jamba/JambaModule.lua +++ b/Jamba/JambaModule.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -12,7 +12,6 @@ if not JambaModule then end -- Load libraries. -local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" ) LibStub( "AceConsole-3.0" ):Embed( JambaModule ) ------------------------------------------------------------------------------------------------------------- @@ -110,7 +109,15 @@ function JambaModule:JambaModuleInitialize( settingsFrame ) -- Register the chat command for this module. self:RegisterChatCommand( self.chatCommand, "JambaChatCommand" ) -- Remember the characters name. - self.characterName = UnitName( "player" ) + -- If server has a space in realm name GetRealmName() will show space this will not work with blizzard API so we need to hack this to work --ebony + --local _, k = UnitFullName("player") + local k = GetRealmName() + local realm = k:gsub( "%s+", "") + self.characterRealm = realm + self.characterNameLessRealm = UnitName( "player" ) + --self.characterName = UnitFullName( "player" ) + self.characterName = self.characterNameLessRealm.."-"..self.characterRealm + --self.characterName = UnitFullName("player") self.characterGUID = UnitGUID( "player" ) -- Register this module with Jamba. self:JambaRegisterModule( self.moduleName ) diff --git a/Jamba/JambaStartupMessage.xml b/Jamba/JambaStartupMessage.xml new file mode 100644 index 0000000..c6c9507 --- /dev/null +++ b/Jamba/JambaStartupMessage.xml @@ -0,0 +1,82 @@ +<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"> + <Frame name="JambaStartupMessageFrame" toplevel="true" frameStrata="DIALOG" enableMouse="true" hidden="true" movable="true" parent="UIParent" inherits="TranslucentFrameTemplate"> + <Size> + <AbsDimension x="600" y="500"/> + </Size> + <Anchors> + <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER" x="0" y="0"/> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <FontString name="$parentTitle" inherits="GameFontNormal" text="Jamba Startup Message"> + <Anchors> + <Anchor point="TOPLEFT" x="24" y="-18"/> + </Anchors> + </FontString> + </Layer> + </Layers> + <Frames> + <Frame name="JambaStartupMessageContainer" enableMouse="true"> + <Anchors> + <Anchor point="TOPLEFT" x="22" y="-36"/> + <Anchor point="TOPRIGHT" x="-22" y="-36"/> + <Anchor point="BOTTOM" x="0" y="42"/> + </Anchors> + <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> + <EdgeSize> + <AbsValue val="12"/> + </EdgeSize> + <TileSize> + <AbsValue val="8"/> + </TileSize> + <BackgroundInsets> + <AbsInset left="1" right="1" top="1" bottom="1"/> + </BackgroundInsets> + </Backdrop> + <Frames> + <ScrollFrame name="JambaStartupMessageScrollFrame" enableMouse="true" inherits="MinimalScrollFrameTemplate"> + <Anchors> + <Anchor point="TOPLEFT" x="8" y="-4"/> + <Anchor point="TOPRIGHT" x="-25" y="-4"/> + <Anchor point="BOTTOM" x="0" y="5"/> + </Anchors> + <ScrollChild> + <Frame> + <Size x="10" y="10"/> + <Frames> + <SimpleHTML name="JambaStartupMessageHTMLFrame" file="Interface\Addons\Jamba\startupmessage.html"> + <Size x="520" y="200"/> + <Anchors> + <Anchor point="TOPLEFT" x="0" y="-4"/> + </Anchors> + <FontString inherits="GameFontHighlight" justifyH="LEFT"/> + <FontStringHeader1 inherits="SystemFont_Huge1" justifyH="LEFT"/> + <FontStringHeader2 inherits="GameFontHighlightLarge" justifyH="LEFT"/> + </SimpleHTML> + </Frames> + </Frame> + </ScrollChild> + </ScrollFrame> + </Frames> + <Scripts> + <OnLoad> + self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b); + self:SetBackdropColor(0.0, 0.0, 0.0, 0.9); + </OnLoad> + </Scripts> + </Frame> + <Button name="$parentCloseButton" inherits="UIPanelButtonTemplate" text="CLOSE"> + <Size x="90" y="22"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" x="-24" y="16"/> + </Anchors> + <Scripts> + <OnClick> + self:GetParent():Hide(); + </OnClick> + </Scripts> + </Button> + </Frames> + </Frame> +</Ui> \ No newline at end of file diff --git a/Jamba/JambaTag.lua b/Jamba/JambaTag.lua index a646f5c..e606aa8 100644 --- a/Jamba/JambaTag.lua +++ b/Jamba/JambaTag.lua @@ -1,7 +1,10 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License + + + ]]-- -- Create the addon using AceAddon-3.0 and embed some libraries. @@ -218,6 +221,7 @@ end -- Settings received. function AJM:JambaOnSettingsReceived( characterName, settings ) + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) if characterName ~= AJM.characterName then -- Update the settings. AJM.db.tagList = JambaUtilities:CopyTable( settings.tagList ) @@ -230,6 +234,8 @@ function AJM:JambaOnSettingsReceived( characterName, settings ) AJM:SettingsTeamListRowClick( 1, 1 ) -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -296,8 +302,8 @@ local function MasterTag() return L["master"] end -local function SlaveTag() - return L["slave"] +local function MinionTag() + return L["minion"] end local function JustMeTag() @@ -321,7 +327,7 @@ local function GetTagAtPosition( position ) end local function IsTagASystemTag( tag ) - if tag == MasterTag() or tag == SlaveTag() or tag == AllTag() or tag == JustMeTag() then + if tag == MasterTag() or tag == MinionTag() or tag == AllTag() or tag == JustMeTag() then return true end for token, localizedName in pairs( AJM.tagClassesFemale ) do @@ -338,6 +344,7 @@ local function IsTagASystemTag( tag ) end local function GetTagListForCharacter( characterName ) + characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) if AJM.db.tagList[characterName] == nil then AJM.db.tagList[characterName] = {} end @@ -359,7 +366,7 @@ function AJM:InitializeAllTagsList() -- Add system tags to the list. AddTagToAllTagsList( AllTag() ) AddTagToAllTagsList( MasterTag() ) - AddTagToAllTagsList( SlaveTag() ) + AddTagToAllTagsList( MinionTag() ) AddTagToAllTagsList( JustMeTag() ) -- Add class tags to the list. AJM.tagClassesFemale = {} @@ -488,7 +495,7 @@ end -- Add tag to character from the command line. function AJM:AddTagCommand( info, parameters ) local characterNameOrExistingTag, tag = strsplit( " ", parameters ) - local characterName = JambaUtilities:Capitalise( characterNameOrExistingTag ) + local characterName = characterNameOrExistingTag local finalCharacterNameOrExistingTag = characterNameOrExistingTag if JambaPrivate.Team.IsCharacterInTeam( characterName ) == true then finalCharacterNameOrExistingTag = characterName @@ -499,7 +506,7 @@ end -- Remove tag from character from the command line. function AJM:RemoveTagCommand( info, parameters ) local characterNameOrExistingTag, tag = strsplit( " ", parameters ) - local characterName = JambaUtilities:Capitalise( characterNameOrExistingTag ) + local characterName = characterNameOrExistingTag local finalCharacterNameOrExistingTag = characterNameOrExistingTag if JambaPrivate.Team.IsCharacterInTeam( characterName ) == true then finalCharacterNameOrExistingTag = characterName @@ -555,28 +562,29 @@ local function CheckSystemTagsAreCorrect() if localizedName ~= nil then InternalAddTagToCharacter( characterName, JambaUtilities:Lowercase( localizedName )) end - -- Master or slave? + -- Master or minion? if JambaPrivate.Team.IsCharacterTheMaster( characterName ) == true then - -- Make sure the master has the master tag and not a slave tag. + -- Make sure the master has the master tag and not a minion tag. if DoesTagListHaveTag( characterTagList, MasterTag() ) == false then AddTag( characterTagList, MasterTag() ) end - if DoesTagListHaveTag( characterTagList, SlaveTag() ) == true then - RemoveTag( characterTagList, SlaveTag() ) + if DoesTagListHaveTag( characterTagList, MinionTag() ) == true then + RemoveTag( characterTagList, MinionTag() ) end else - -- Make sure slaves have the slave tag and not the master tag. + -- Make sure minions have the minion tag and not the master tag. if DoesTagListHaveTag( characterTagList, MasterTag() ) == true then RemoveTag( characterTagList, MasterTag() ) end - if DoesTagListHaveTag( characterTagList, SlaveTag() ) == false then - AddTag( characterTagList, SlaveTag() ) + if DoesTagListHaveTag( characterTagList, MinionTag() ) == false then + AddTag( characterTagList, MinionTag() ) end end end end local function DoesCharacterHaveTag( characterName, tag ) + --characterName = JambaUtilities:AddRealmToNameIfMissing( characterName ) local characterTagList = GetTagListForCharacter( characterName ) return DoesTagListHaveTag( characterTagList, tag ) end @@ -740,7 +748,7 @@ end -- Functions available from Jamba Tag for other Jamba internal objects. JambaPrivate.Tag.AllTag = AllTag JambaPrivate.Tag.MasterTag = MasterTag -JambaPrivate.Tag.SlaveTag = SlaveTag +JambaPrivate.Tag.MinionTag = MinionTag JambaPrivate.Tag.JustMeTag = JustMeTag JambaPrivate.Tag.AllTagsList = AllTagsList JambaPrivate.Tag.AllTagsListIterator = AllTagsListIterator @@ -751,7 +759,7 @@ JambaPrivate.Tag.GetCharacterWithTag = GetCharacterWithTag -- Functions available for other addons. JambaApi.AllTag = AllTag JambaApi.MasterTag = MasterTag -JambaApi.SlaveTag = SlaveTag +JambaApi.MinionTag = MinionTag JambaApi.JustMeTag = JustMeTag JambaApi.AllTagsList = AllTagsList JambaApi.AllTagsListIterator = AllTagsListIterator diff --git a/Jamba/JambaTeam.lua b/Jamba/JambaTeam.lua index 661f4db..6839f20 100644 --- a/Jamba/JambaTeam.lua +++ b/Jamba/JambaTeam.lua @@ -1,6 +1,8 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller + + License: The MIT License ]]-- @@ -36,6 +38,7 @@ AJM.settings = { profile = { master = "", teamList = {}, + characterOnline = {}, focusChangeSetMaster = false, masterChangePromoteLeader = false, inviteAcceptTeam = true, @@ -47,6 +50,7 @@ AJM.settings = { lootSetAutomatically = false, lootSetFreeForAll = true, lootSetMasterLooter = false, + lootSetPersLooter = false, lootSlavesOptOutOfLoot = false, lootToGroupIfStrangerPresent = true, lootToGroupFriendsAreNotStrangers = false, @@ -70,7 +74,15 @@ function AJM:GetConfiguration() usage = "/jamba-team add <name>", get = false, set = "AddMemberCommand", - }, + }, + --setoffline = { TODO CLKAN UP> + -- type = "input", + -- name = L["Set Offline"], + -- desc = L["Sets a member offline"], + -- usage = "/jamba-team setoffline <name>", + -- get = false, + -- set = "SetMemberOfflineCommand", + --}, remove = { type = "input", name = L["Remove"], @@ -125,7 +137,23 @@ function AJM:GetConfiguration() desc = L["Remove all members from the team."], usage = "/jamba-team removeall", get = false, - set = "RemoveAllMembersFromTeam", + set = "DoRemoveAllMembersFromTeam", + }, + setalloffline = { + type = "input", + name = L["Set Team OffLine"], + desc = L["Set All Team Members OffLine"], + usage = "/jamba-team setalloffline", + get = false, + set = "setAllMembersOffline", + }, + setallonline = { + type = "input", + name = L["Set Team OnLine"], + desc = L["Set All Team Members OnLine"], + usage = "/jamba-team setallonline", + get = false, + set = "setAllMembersOnline", }, push = { type = "input", @@ -134,15 +162,16 @@ function AJM:GetConfiguration() usage = "/jamba-team push", get = false, set = "JambaSendSettings", - }, + }, }, } return configuration end -- Create the character online table and ordered characters tables. -AJM.characterOnline = {} +--AJM.characterOnline = {} AJM.orderedCharacters = {} +AJM.orderedCharactersOnline = {} ------------------------------------------------------------------------------------------------------------- -- Command this module sends. @@ -152,6 +181,9 @@ AJM.orderedCharacters = {} AJM.COMMAND_LEAVE_PARTY = "JambaTeamLeaveGroup" -- Set master command. AJM.COMMAND_SET_MASTER = "JambaTeamSetMaster" +-- Set Minion OffLine +AJM.COMMAND_SET_OFFLINE = "JambaTeamSetOffline" +AJM.COMMAND_SET_ONLINE = "JambaTeamSetOnline" ------------------------------------------------------------------------------------------------------------- -- Messages module sends. @@ -165,7 +197,11 @@ AJM.MESSAGE_TEAM_ORDER_CHANGED = "JambaTeamOrderChanged" AJM.MESSAGE_TEAM_CHARACTER_ADDED = "JambaTeamCharacterAdded" -- Character has been removed, parameter: characterName. AJM.MESSAGE_TEAM_CHARACTER_REMOVED = "JambaTeamCharacterRemoved" --- Character has been added, parameter: characterName. +-- character online +AJM.MESSAGE_CHARACTER_ONLINE = "JmbTmChrOn" +-- character offline +AJM.MESSAGE_CHARACTER_OFFLINE = "JmbTmChrOf" + ------------------------------------------------------------------------------------------------------------- -- Constants used by module. @@ -176,6 +212,7 @@ AJM.PARTY_LOOT_GROUP = "group" AJM.PARTY_LOOT_MASTER = "master" AJM.PARTY_LOOT_NEEDBEFOREGREED = "needbeforegreed" AJM.PARTY_LOOT_ROUNDROBIN = "roundrobin" +AJM.PARTY_LOOT_PERSONAL = "personalloot" ------------------------------------------------------------------------------------------------------------- -- Settings Dialogs. @@ -250,7 +287,6 @@ local function SettingsCreateTeamList() L["Add"], AJM.SettingsAddClick ) - --ebony AJM.settingsControl.teamListButtonParty = JambaHelperSettings:CreateButton( AJM.settingsControl, teamListButtonControlWidth, @@ -286,11 +322,19 @@ local function SettingsCreateTeamList() AJM.settingsControl.teamListButtonDisband = JambaHelperSettings:CreateButton( AJM.settingsControl, inviteDisbandButtonWidth, - left + inviteDisbandButtonWidth + horizontalSpacing, + left + inviteDisbandButtonWidth + horizontalSpacing, bottomOfList, L["Disband"], AJM.SettingsDisbandClick - ) + ) +-- AJM.settingsControl.teamListButtonOffline = JambaHelperSettings:CreateButton( +-- AJM.settingsControl, +-- setMasterButtonWidth, +-- left + inviteDisbandButtonWidth + horizontalSpacing + inviteDisbandButtonWidth + horizontalSpacing + setMasterButtonWidth + horizontalSpacing, +-- bottomOfList, +-- L["Set On-Line"], +-- AJM.SettingsOfflineClick +-- ) return bottomOfSection end @@ -329,7 +373,7 @@ local function SettingsCreateMasterControl( top ) headingWidth, left, top - headingHeight - checkBoxHeight - checkBoxHeight, - L["Auto activate click-to-move on Slaves and deactivate on Master."], + L["Auto activate click-to-move on Minions and deactivate on Master."], AJM.SettingsMasterChangeClickToMoveToggle ) return bottomOfSection @@ -381,12 +425,12 @@ local function SettingsCreatePartyInvitationsControl( top ) top - headingHeight - checkBoxHeight, L["Accept from BattleNet/RealD friends."], AJM.SettingsAcceptInviteBNFriendsToggle - ) + ) AJM.settingsControl.partyInviteControlCheckBoxAcceptGuild = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, checkBoxWidth, column1Left, - top - headingHeight - checkBoxHeight - checkBoxHeight, + top - headingHeight - checkBoxHeight - checkBoxHeight, L["Accept from guild."], AJM.SettingsAcceptInviteGuildToggle ) @@ -445,11 +489,20 @@ local function SettingsCreatePartyLootControl( top ) AJM.SettingsSetMasterLooterToggle ) AJM.settingsControl.partyLootControlCheckBoxSetMasterLooter:SetType( "radio" ) + AJM.settingsControl.partyLootControlCheckBoxSetPersLooter = JambaHelperSettings:CreateCheckBox( + AJM.settingsControl, + checkBoxWidth, + column1Left, + top - headingHeight - checkBoxHeight - radioBoxHeight, + L["Personal Loot"], + AJM.SettingsSetPersLooterToggle + ) + AJM.settingsControl.partyLootControlCheckBoxSetPersLooter:SetType( "radio" ) AJM.settingsControl.partyLootControlCheckBoxStrangerToGroup = JambaHelperSettings:CreateCheckBox( AJM.settingsControl, headingWidth, column1Left, - top - headingHeight - checkBoxHeight - radioBoxHeight, + top - headingHeight - checkBoxHeight - radioBoxHeight - radioBoxHeight, L["Override: Set loot to Group Loot if stranger in group."], AJM.SettingsSetStrangerToGroup ) @@ -457,7 +510,7 @@ local function SettingsCreatePartyLootControl( top ) AJM.settingsControl, headingWidth, column1Left + indentContinueLabel, - top - headingHeight - checkBoxHeight - radioBoxHeight - checkBoxHeight, + top - headingHeight - checkBoxHeight - radioBoxHeight - radioBoxHeight -checkBoxHeight, L["Friends Are Not Strangers"], AJM.SettingsSetFriendsNotStrangers ) @@ -465,9 +518,9 @@ local function SettingsCreatePartyLootControl( top ) AJM.settingsControl, headingWidth, column1Left, - top - headingHeight - checkBoxHeight - radioBoxHeight - checkBoxHeight - checkBoxHeight , - L["Slaves Opt Out of Loot"], - AJM.SettingsSetSlavesOptOutToggle + top - headingHeight - checkBoxHeight - radioBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight, + L["Minions Opt Out of Loot"], + AJM.SettingsSetMinionsOptOutToggle ) return bottomOfSection end @@ -503,7 +556,7 @@ end local function InitializePopupDialogs() -- Ask the name of the character to add as a new member. StaticPopupDialogs["JAMBATEAM_ASK_CHARACTER_NAME"] = { - text = L["Enter name of character to add:"], + text = L["Enter character to add in name-server format:"], button1 = ACCEPT, button2 = CANCEL, hasEditBox = 1, @@ -543,7 +596,27 @@ local function InitializePopupDialogs() OnAccept = function( self ) AJM:RemoveMemberGUI() end, - } + } + -- Master can not be set offline PopUp Box. + StaticPopupDialogs["MasterCanNotBeSetOffline"] = { + text = L["Master Can not be Set OffLine"], + button1 = OKAY, + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + } + -- OFFLINE TEST STUFF. + StaticPopupDialogs["SET_OFFLINE_WIP"] = { + text = L["WIP: This Button Does absolutely nothing at all, Unless you untick Use team List Offline Button in Core:communications Under Advanced. Report bugs to to me -EBONY"], + button1 = OKAY, + --button2 = CANCEL, + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + OnAccept = function( self ) + --AJM:RemoveMemberGUI() stuff goes here. + end, + } end ------------------------------------------------------------------------------------------------------------- @@ -554,10 +627,14 @@ local function TeamList() return pairs( AJM.db.teamList ) end +local function Offline() + return pairs( AJM.db.characterOnline) +end + -- Get the largest order number from the team list. local function GetTeamListMaximumOrder() local largestPosition = 0 - for characterName, position in pairs( AJM.db.teamList ) do + for characterName, position in pairs( AJM.db.teamList ) do if position > largestPosition then largestPosition = position end @@ -565,15 +642,53 @@ local function GetTeamListMaximumOrder() return largestPosition end +local function GetTeamListMaximumOrderOnline() + local totalMembersDisplayed = 0 + for index, characterName in JambaApi.TeamListOrderedOnline() do + --if JambaApi.GetCharacterOnlineStatus( characterName ) == true then + totalMembersDisplayed = totalMembersDisplayed + 1 + --end + end + return totalMembersDisplayed +end + + +--[[ TODO REMOVE ME -- Return true if the character specified is in the team. local function IsCharacterInTeam( characterName ) local isMember = false + if AJM.db.teamList[characterName] then + isMember = true + --AJM:Print('returning', isMember) + return isMember + end +end +--]] + +local function IsCharacterInTeam( characterName ) + local isMember = false if AJM.db.teamList[characterName] then isMember = true end + if not isMember then + for fullCharacterName, position in pairs( AJM.db.teamList ) do + local matchDash = fullCharacterName:find( "-" ) + if matchDash then + fullName = gsub(fullCharacterName, "%-[^|]+", "") + end + --AJM:Print('checking', checkCharacterName, 'vs', characterName) + if fullName == characterName then + --AJM:Print('match found') + isMember = true + break + end + end + end + --AJM:Print('returning', isMember) return isMember end + -- Get the master for this character. local function GetMasterName() return AJM.db.master @@ -589,47 +704,43 @@ local function IsCharacterTheMaster( characterName ) end -- Set the master for AJM character; the master character must be online. -local function SetMaster( value ) +local function SetMaster( master ) -- Make sure a valid string value is supplied. - if (value ~= nil) and (value:trim() ~= "") then - -- The name must be capitalised. - -- TODO: is it necessary to capitalise? - local master = JambaUtilities:Capitalise( value ) + if (master ~= nil) and (master:trim() ~= "") then + -- The name must be capitalised i still like this or though its not needed. + --local character = JambaUtilities:Capitalise( master ) + local character = JambaUtilities:AddRealmToNameIfMissing( master ) -- Only allow characters in the team list to be the master. - if IsCharacterInTeam( master ) == true then + if IsCharacterInTeam( character ) == true then -- Set the master. - AJM.db.master = master + AJM.db.master = character -- Refresh the settings. AJM:SettingsRefresh() -- Send a message to any listeners that the master has changed. - AJM:SendMessage( AJM.MESSAGE_TEAM_MASTER_CHANGED, master ) + AJM:SendMessage( AJM.MESSAGE_TEAM_MASTER_CHANGED, character ) else -- Character not in team. Tell the team. - AJM:JambaSendMessageToTeam( - AJM.characterName, - L["A is not in my team list. I can not set them to be my master."]( master ), - false - ) + AJM:JambaSendMessageToTeam( AJM.characterName, L["A is not in my team list. I can not set them to be my master."]( character ), false ) end end end -- Add a member to the member list. -local function AddMember( value ) +local function AddMember( characterName ) -- Wow names are at least two characters. - if value ~= nil and value:trim() ~= "" and value:len() > 1 then - -- Capitalise the name. - local characterName = JambaUtilities:Capitalise( value ) - -- Checks for realm and removes -realm if added - local characterName = JambaUtilities:RemoveRealmToNameIfAdded( characterName ) + if characterName ~= nil and characterName:trim() ~= "" and characterName:len() > 1 then -- If the character is not already on the list... - if AJM.db.teamList[characterName] == nil then + --local character = JambaUtilities:Capitalise( charactername ) + local character = JambaUtilities:AddRealmToNameIfMissing( characterName ) + if AJM.db.teamList[character] == nil then -- Get the maximum order number. local maxOrder = GetTeamListMaximumOrder() -- Yes, add to the member list. - AJM.db.teamList[characterName] = maxOrder + 1 + AJM.db.teamList[character] = maxOrder + 1 + JambaPrivate.Team.SetTeamOnline() + --AJM.Print("teamList", character) -- Send a message to any listeners that AJM character has been added. - AJM:SendMessage( AJM.MESSAGE_TEAM_CHARACTER_ADDED, characterName ) + AJM:SendMessage( AJM.MESSAGE_TEAM_CHARACTER_ADDED, character ) -- Refresh the settings. AJM:SettingsRefresh() end @@ -643,13 +754,14 @@ function AJM:AddMemberCommand( info, parameters ) AddMember( characterName ) end --- Add all party members to the member list. +-- Add all party members to the member list. does not worl cross rwalm todo function AJM:AddPartyMembers() local numberPartyMembers = GetNumSubgroupMembers() for iteratePartyMembers = numberPartyMembers, 1, -1 do - local partyMemberName = UnitName( "party"..iteratePartyMembers ) - if IsCharacterInTeam( partyMemberName ) == false then - AddMember( partyMemberName ) + local partyMemberName, partyMemberRealm = UnitName( "party"..iteratePartyMembers ) + local character = JambaUtilities:AddRealmToNameIfNotNil( partyMemberName, partyMemberRealm ) + if IsCharacterInTeam( character ) == false then + AddMember( character ) end end end @@ -700,6 +812,20 @@ local function GetPositionForCharacterName( findCharacterName ) return positionForCharacterName end +local function GetPositionForCharacterNameOnline( findCharacterName ) + local positionForCharacterName = 0 + --for characterName, characterPosition in pairs( AJM.db.teamList ) do + --AJM:Print("test", findCharacterName) + for index, characterName in JambaApi.TeamListOrderedOnline() do + if characterName == findCharacterName then + --AJM:Print("found", characterName, index) + positionForCharacterName = index + --break + end + end + return positionForCharacterName +end + -- Swap character positions. local function TeamListSwapCharacterPositions( position1, position2 ) -- Get characters at positions. @@ -733,31 +859,26 @@ local function ConfirmThereIsAMaster() end -- Remove a member from the member list. -local function RemoveMember( value ) - -- Wow names are at least two characters. - if value ~= nil and value:trim() ~= "" and value:len() > 1 then - -- Capitalise the name. - local characterName = JambaUtilities:Capitalise( value ) - -- Is character in team? - if IsCharacterInTeam( characterName ) == true then - -- Remove character from list. - local characterPosition = AJM.db.teamList[characterName] - AJM.db.teamList[characterName] = nil - -- If any character had an order greater than this character's order, then shift their order down by one. - for checkCharacterName, checkCharacterPosition in pairs( AJM.db.teamList ) do - if checkCharacterPosition > characterPosition then - AJM.db.teamList[checkCharacterName] = checkCharacterPosition - 1 - end +local function RemoveMember( characterName ) + -- Is character in team? + if IsCharacterInTeam( characterName ) == true then + -- Remove character from list. + local characterPosition = AJM.db.teamList[characterName] + AJM.db.teamList[characterName] = nil + -- If any character had an order greater than this character's order, then shift their order down by one. + for checkCharacterName, checkCharacterPosition in pairs( AJM.db.teamList ) do + if checkCharacterPosition > characterPosition then + AJM.db.teamList[checkCharacterName] = checkCharacterPosition - 1 end - -- Send a message to any listeners that this character has been removed. - AJM:SendMessage( AJM.MESSAGE_TEAM_CHARACTER_REMOVED, characterName ) - -- Make sure AJM character is a member. - ConfirmCharacterIsInTeam() - -- Make sure there is a master, if none, set this character. - ConfirmThereIsAMaster() - -- Refresh the settings. - AJM:SettingsRefresh() end + -- Send a message to any listeners that this character has been removed. + AJM:SendMessage( AJM.MESSAGE_TEAM_CHARACTER_REMOVED, characterName ) + -- Make sure AJM character is a member. + ConfirmCharacterIsInTeam() + -- Make sure there is a master, if none, set this character. + ConfirmThereIsAMaster() + -- Refresh the settings. + AJM:SettingsRefresh() end end @@ -772,17 +893,24 @@ end -- Remove member from the command line. function AJM:RemoveMemberCommand( info, parameters ) local characterName = parameters - -- Remove the character. - RemoveMember( characterName ) + -- Wow names are at least two characters. + if characterName ~= nil and characterName:trim() ~= "" and characterName:len() > 1 then + -- Remove the character. + RemoveMember( characterName ) + end end --- Remove all members from the team list via command line. -function AJM:RemoveAllMembersFromTeam( info, parameters ) +local function RemoveAllMembersFromTeam() for characterName, characterPosition in pairs( AJM.db.teamList ) do RemoveMember( characterName ) end end +-- Remove all members from the team list via command line. +function AJM:DoRemoveAllMembersFromTeam( info, parameters ) + RemoveAllMembersFromTeam() +end + function AJM:CommandIAmMaster( info, parameters ) local tag = parameters local target = AJM.characterName @@ -795,7 +923,7 @@ end function AJM:CommandSetMaster( info, parameters ) local target, tag = strsplit( " ", parameters ) - target = JambaUtilities:Capitalise( target ) + --target = JambaUtilities:Capitalise( target ) if tag ~= nil and tag:trim() ~= "" then AJM:JambaSendCommandToTeam( AJM.COMMAND_SET_MASTER, target, tag ) else @@ -818,28 +946,127 @@ local function GetCharacterOnlineStatus( characterName ) if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then return true end - return AJM.characterOnline[characterName] + return AJM.db.characterOnline[characterName] end -- Set a character's online status. local function SetCharacterOnlineStatus( characterName, isOnline ) - if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then - isOnline = true - end - AJM.characterOnline[characterName] = isOnline - AJM:SettingsTeamListScrollRefresh() + --TODO OLD CLEAN UP + --if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then + -- isOnline = true + --end + --AJM:Print('setting', character, 'to be online') + AJM.db.characterOnline[characterName] = isOnline end local function SetTeamStatusToOffline() - if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then - return - end + --if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then + -- return + --end -- Set all characters online status to false. for characterName, characterPosition in pairs( AJM.db.teamList ) do SetCharacterOnlineStatus( characterName, false ) + --SetCharacterOnlineStatus( AJM.characterName, true ) + AJM:SendMessage( AJM.MESSAGE_CHARACTER_OFFLINE ) + AJM:SettingsTeamListScrollRefresh() end end +local function SetTeamOnline() + --if JambaPrivate.Communications.AssumeTeamAlwaysOnline() == true then + -- return + --end + -- Set all characters online status to false. + for characterName, characterPosition in pairs( AJM.db.teamList ) do + SetCharacterOnlineStatus( characterName, true ) + AJM:SendMessage( AJM.MESSAGE_CHARACTER_ONLINE ) + AJM:SettingsTeamListScrollRefresh() + end +end + +--Set character Offline. +local function setOffline( characterName ) + -- can not set master Offline TODO REMOVE. + --if IsCharacterTheMaster( characterName ) == true then + -- StaticPopup_Show( "MasterCanNotBeSetOffline" ) + -- return + --else + local character = JambaUtilities:AddRealmToNameIfMissing( characterName ) + SetCharacterOnlineStatus( character, false ) + AJM:SendMessage( AJM.MESSAGE_CHARACTER_OFFLINE ) + AJM:SettingsTeamListScrollRefresh() + --end +end + +--Set character OnLine. +local function setOnline( characterName ) + local character = JambaUtilities:AddRealmToNameIfMissing( characterName ) + SetCharacterOnlineStatus( character, true ) + AJM:SendMessage( AJM.MESSAGE_CHARACTER_ONLINE ) + AJM:SettingsTeamListScrollRefresh() +end + +-- Set OfflineClick TODO CLean up +local function setOfflineClick ( characterName ) + if GetCharacterOnlineStatus( characterName ) == false then + setOnline( characterName, true ) + else + setOffline( characterName, false ) + --AJM:Print("setOffline", characterName ) + end + AJM:SettingsRefresh() +end + +-- Set member offline from the command line. AXED CLEAN UP REMOVE! +function AJM:SetMemberOfflineCommand( info, parameters ) + local characterName = parameters + --AJM:Print("is char in team", characterName ) + local matchDash = characterName:find( "-" ) + if matchDash then + if IsCharacterInTeam( characterName ) then + --AJM:Print("is char in team", characterName ) + --local character = JambaUtilities:AddRealmToNameIfMissing( characterName ) + if GetCharacterOnlineStatus( characterName ) == false then + setOnline( characterName, true ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_SET_ONLINE, characterName ) + else + setOffline( characterName, false ) + --AJM:Print("setOffline", characterName ) + AJM:JambaSendCommandToTeam( AJM.COMMAND_SET_OFFLINE, characterName ) + end + AJM:SettingsRefresh() + else + AJM:Print( L["A is not in my team list. I can not set them Offline."]( characterName ) ) + end + else + AJM:Print( "You need to add a Realm Name" ) + end +end + +function AJM.ReceivesetOffline( characterName ) + --AJM:Print("command", characterName ) + setOffline( characterName, false ) + AJM:SettingsRefresh() +end + +function AJM.ReceivesetOnline( characterName ) + --AJM:Print("command", characterName ) + setOnline( characterName, false ) + AJM:SettingsRefresh() +end + +function AJM:setAllMembersOffline() + SetTeamStatusToOffline() +end + +function AJM:setAllMembersOnline() + SetTeamOnline() +end + +------------------------------------------------------------------------------------------------------------- +-- Character team list ordering. +------------------------------------------------------------------------------------------------------------- + local function SortTeamListOrdered( characterA, characterB ) local positionA = GetPositionForCharacterName( characterA ) local positionB = GetPositionForCharacterName( characterB ) @@ -856,6 +1083,17 @@ local function TeamListOrdered() return ipairs( AJM.orderedCharacters ) end +-- Return all characters ordered online. +local function TeamListOrderedOnline() + JambaUtilities:ClearTable( AJM.orderedCharactersOnline ) + for characterName, characterPosition in pairs( AJM.db.teamList ) do + if JambaApi.GetCharacterOnlineStatus( characterName ) == true then + table.insert( AJM.orderedCharactersOnline, characterName ) + end + end + table.sort( AJM.orderedCharactersOnline, SortTeamListOrdered ) + return ipairs( AJM.orderedCharactersOnline ) +end ------------------------------------------------------------------------------------------------------------- -- Party. ------------------------------------------------------------------------------------------------------------- @@ -882,10 +1120,10 @@ function AJM.DoTeamPartyInvite() InviteUnit( AJM.inviteList[AJM.currentInviteCount] ) AJM.currentInviteCount = AJM.currentInviteCount + 1 if AJM.currentInviteCount < AJM.inviteCount then - if GetTeamListMaximumOrder() > 5 and AJM.db.inviteConvertToRaid == true then - ConvertToRaid() - end - AJM:ScheduleTimer( "DoTeamPartyInvite", 0.5 ) + if GetTeamListMaximumOrderOnline() > 5 and AJM.db.inviteConvertToRaid == true then + ConvertToRaid() + end + AJM:ScheduleTimer( "DoTeamPartyInvite", 0.5 ) else -- Process group checks. AJM:PARTY_LEADER_CHANGED( "PARTY_LEADER_CHANGED" ) @@ -915,7 +1153,9 @@ local function SetPartyLoot( desiredLootOption ) end -- If partyMaster between 1 and 4 then that player (party1 .. party4) is the master looter. if partyMaster > 0 then - if UnitName( "party"..partyMaster ) ~= GetMasterName() then + local checkName, checkRealm = UnitName( "party"..partyMaster ) + local character = JambaUtilities:AddRealmToNameIfNotNil( checkName, checkName ) + if character ~= GetMasterName() then -- Then, yes, can change loot method. canChangeLootMethod = true end @@ -926,7 +1166,9 @@ local function SetPartyLoot( desiredLootOption ) -- the same loot method; otherwise an infinite loop occurs). if canChangeLootMethod == true then if desiredLootOption == AJM.PARTY_LOOT_MASTER then - SetLootMethod( desiredLootOption, GetMasterName(), 1 ) + --SetLootMethod( desiredLootOption, GetMasterName(), 1 ) + SetLootMethod( desiredLootOption, ( Ambiguate( GetMasterName(), "none" ) ), 1 ) + --AJM.Print("setloot", name , desiredLootOption) else SetLootMethod( desiredLootOption ) end @@ -939,10 +1181,11 @@ function AJM:PLAYER_FOCUS_CHANGED() if AJM.db.focusChangeSetMaster == true then -- Get the name of the focused unit. local targetName, targetRealm = UnitName( "focus" ) + local name = JambaUtilities:AddRealmToNameIfNotNil( targetName, targetRealm ) -- Attempt to set this target as the master if the target is in the team. - if IsCharacterInTeam( targetName ) == true then - if (targetName ~= nil) and (targetName:trim() ~= "") then - SetMaster( targetName ) + if IsCharacterInTeam( name ) == true then + if (name ~= nil) and (name:trim() ~= "") then + SetMaster( name ) end end end @@ -956,13 +1199,14 @@ function AJM:PARTY_LEADER_CHANGED( event, ... ) if AJM.db.lootToGroupIfStrangerPresent == true then local numberPartyMembers = GetNumSubgroupMembers() for iteratePartyMembers = numberPartyMembers, 1, -1 do - local partyMemberName = UnitName( "party"..iteratePartyMembers ) - if IsCharacterInTeam( partyMemberName ) == false then + local partyMemberName, partyMemberRealm = UnitName( "party"..iteratePartyMembers ) + local character = JambaUtilities:AddRealmToNameIfNotNil( partyMemberName, partyMemberRealm ) + if IsCharacterInTeam( character ) == false then if AJM.db.lootToGroupFriendsAreNotStrangers == true then local isAFriend = false for friendIndex = 1, GetNumFriends() do local friendName = GetFriendInfo( friendIndex ) - if partyMemberName == friendName then + if character == friendName then isAFriend = true end end @@ -972,11 +1216,11 @@ function AJM:PARTY_LEADER_CHANGED( event, ... ) for toonIndex = 1, BNGetNumFriendToons( bnIndex ) do local _, friendName = BNGetFriendToonInfo( bnIndex, toonIndex ); friendName = friendName:match("(.+)%-.+") or friendName - if partyMemberName == friendName then + if character == friendName then isAFriend = true end end - end + end if isAFriend == false then haveStranger = true end @@ -998,17 +1242,21 @@ function AJM:PARTY_LEADER_CHANGED( event, ... ) if AJM.db.lootSetMasterLooter == true then SetPartyLoot( AJM.PARTY_LOOT_MASTER ) end + -- Automatically set the loot to Personal Loot + if AJM.db.lootSetPersLooter == true then + SetPartyLoot( AJM.PARTY_LOOT_PERSONAL ) + end end end end - AJM:CheckSlavesOptOutOfLoot() + AJM:CheckMinionsOptOutOfLoot() end function AJM:GROUP_ROSTER_UPDATE( event, ... ) - AJM:CheckSlavesOptOutOfLoot() + AJM:CheckMinionsOptOutOfLoot() end -function AJM:CheckSlavesOptOutOfLoot() +function AJM:CheckMinionsOptOutOfLoot() -- Set opt out of loot rolls? if AJM.db.lootSlavesOptOutOfLoot == true then -- Only if not the master. @@ -1034,10 +1282,10 @@ function AJM:PARTY_INVITE_REQUEST( event, inviter, ... ) -- Is character not in a group? if not IsInGroup( "player" ) then -- Accept an invite from members? - if AJM.db.inviteAcceptTeam == true then + if AJM.db.inviteAcceptTeam == true then -- If inviter found in team list, allow the invite to be accepted. if IsCharacterInTeam( inviter ) then - acceptInvite = true + acceptInvite = true end end -- Accept an invite from friends? @@ -1066,8 +1314,8 @@ function AJM:PARTY_INVITE_REQUEST( event, inviter, ... ) end end end - end - -- Accept an invite from guild members? + end + -- Accept and invite from guild members? if AJM.db.inviteAcceptGuild == true then if UnitIsInMyGuild( inviter ) then acceptInvite = true @@ -1104,10 +1352,9 @@ function AJM:PARTY_INVITE_REQUEST( event, inviter, ... ) -- flag is only set to stop the dialog from declining in its OnHide event). dialog.inviteAccepted = 1 break - end + end end StaticPopup_Hide( "PARTY_INVITE" ) - --Ebony Sometimes invite is from XREALM even though Your on the same realm and have joined the party. This should hide the Popup. StaticPopup_Hide( "PARTY_INVITE_XREALM" ) end end @@ -1123,10 +1370,10 @@ local function LeaveTheParty() end function AJM:OnMasterChange( message, characterName ) - local playerName = UnitName( "player" ) + local playerName = AJM.characterName if AJM.db.masterChangePromoteLeader == true then if IsInGroup( "player" ) and UnitIsGroupLeader( "player" ) == true and GetMasterName() ~= playerName then - PromoteToLeader( GetMasterName() ) + PromoteToLeader( Ambiguate( GetMasterName(), "all" ) ) end end if AJM.db.masterChangeClickToMove == true then @@ -1139,33 +1386,6 @@ function AJM:OnMasterChange( message, characterName ) end ------------------------------------------------------------------------------------------------------------- --- NPCS. -------------------------------------------------------------------------------------------------------------- - -local function IsCharacterTargetAnNpc() ---AJM:Print( "UnitIsPlayer (NPC): ", UnitIsPlayer("npc") ) - -- Is the character targeting something? Try and get the target's GUID. - local guid = UnitGUID( "npc" ) - if guid == nil then - -- No target, so target is not an npc. ---AJM:Print( "Target (NPC): None" ) - return false - else - -- Yes, targeting a valid character, what is it? - local guidRepresents = JambaUtilities:ParseGUID( guid ) - -- Is this character an NPC? - if guidRepresents == JambaUtilities.GUID_REPRESENTS_NPC then ---AJM:Print( "Target (NPC): NPC" ) - return true - else - -- Yes, a player, return false. ---AJM:Print( "Target (NPC): Player" ) - return false - end - end -end - -------------------------------------------------------------------------------------------------------------- -- Addon initialization, enabling and disabling. ------------------------------------------------------------------------------------------------------------- @@ -1183,8 +1403,9 @@ function AJM:OnInitialize() ConfirmCharacterIsInTeam() -- Make sure there is a master, if none, set this character. ConfirmThereIsAMaster() - -- Set team members online status to not connected. - SetTeamStatusToOffline() + -- Set team members online status to not connected. we do not want to do this on start-up! + --SetTeamStatusToOffline() + SetTeamOnline() -- Key bindings. JambaTeamSecureButtonInvite = CreateFrame( "CheckButton", "JambaTeamSecureButtonInvite", nil, "SecureActionButtonTemplate" ) JambaTeamSecureButtonInvite:SetAttribute( "type", "macro" ) @@ -1194,7 +1415,35 @@ function AJM:OnInitialize() JambaTeamSecureButtonDisband:SetAttribute( "type", "macro" ) JambaTeamSecureButtonDisband:SetAttribute( "macrotext", "/jamba-team disband" ) JambaTeamSecureButtonDisband:Hide() - + -- Update teamList if necessary to include realm names. Only used from upgrading form 3.x to 4.0 + local updatedTeamList = {} + --Ebony Using GetRealmName() shows realm name with a space the api does not like spaces. So we have to remove it + local k = GetRealmName() + -- remove space for server name if there is one. + local realmName = k:gsub( "%s+", "") + for characterName, position in pairs( AJM.db.teamList ) do + --AJM:Print( 'Iterating:', characterName, position ) + local updateMatchStart = characterName:find( "-" ) + if not updateMatchStart then + updatedTeamList[characterName.."-"..realmName] = position + AJM.db.teamList = JambaUtilities:CopyTable( updatedTeamList ) +-- TODO Clean ME UP. +-- else +-- if characterName then +-- updatedTeamList[characterName] = position +-- end + end + end +-- TODO CLEAN ME UP ebony +-- AJM.db.teamList = JambaUtilities:CopyTable( updatedTeamList ) +-- for characterName, position in pairs( AJM.db.teamList ) do +-- AJM:Print( 'Iterating after:', characterName, position ) +-- end +--todo look at this ebony +-- local updateMatchStart = AJM.db.master:find( "-" ) +-- if not updateMatchStart then +-- AJM.db.master = AJM.db.master.."-"..realmName +-- end end -- Called when the addon is enabled. @@ -1254,44 +1503,53 @@ function AJM:SettingsRefresh() AJM.settingsControl.partyLootControlCheckBoxSetLootMethod:SetValue( AJM.db.lootSetAutomatically ) AJM.settingsControl.partyLootControlCheckBoxSetFFA:SetValue( AJM.db.lootSetFreeForAll ) AJM.settingsControl.partyLootControlCheckBoxSetMasterLooter:SetValue( AJM.db.lootSetMasterLooter ) + AJM.settingsControl.partyLootControlCheckBoxSetPersLooter:SetValue( AJM.db.lootSetPersLooter ) AJM.settingsControl.partyLootControlCheckBoxStrangerToGroup:SetValue( AJM.db.lootToGroupIfStrangerPresent ) AJM.settingsControl.partyLootControlCheckBoxFriendsNotStrangers:SetValue( AJM.db.lootToGroupFriendsAreNotStrangers ) - AJM.settingsControl.partyLootControlCheckBoxSetOptOutOfLoot:SetValue( AJM.db.lootSlavesOptOutOfLoot ) + AJM.settingsControl.partyLootControlCheckBoxSetOptOutOfLoot:SetValue( AJM.db.lootSlavesOptOutOfLoot ) -- Ensure correct state. AJM.settingsControl.partyLootControlCheckBoxSetFFA:SetDisabled( not AJM.db.lootSetAutomatically ) AJM.settingsControl.partyLootControlCheckBoxSetMasterLooter:SetDisabled( not AJM.db.lootSetAutomatically ) + AJM.settingsControl.partyLootControlCheckBoxSetPersLooter:SetDisabled( not AJM.db.lootSetAutomatically ) AJM.settingsControl.partyLootControlCheckBoxStrangerToGroup:SetDisabled( not AJM.db.lootSetAutomatically ) AJM.settingsControl.partyLootControlCheckBoxFriendsNotStrangers:SetDisabled( not AJM.db.lootSetAutomatically ) -- Update the settings team list. AJM:SettingsTeamListScrollRefresh() -- Check the opt out of loot settings. - AJM:CheckSlavesOptOutOfLoot() + AJM:CheckMinionsOptOutOfLoot() end -- Settings received. function AJM:JambaOnSettingsReceived( characterName, settings ) - if characterName ~= AJM.characterName then - -- Update the settings. + if characterName ~= AJM.characterName then + -- Update the settings. AJM.db.teamList = JambaUtilities:CopyTable( settings.teamList ) AJM.db.focusChangeSetMaster = settings.focusChangeSetMaster AJM.db.masterChangePromoteLeader = settings.masterChangePromoteLeader AJM.db.inviteAcceptTeam = settings.inviteAcceptTeam AJM.db.inviteAcceptFriends = settings.inviteAcceptFriends - AJM.db.inviteAcceptBNFriends = settings.inviteBNAcceptFriends + AJM.db.inviteAcceptBNFriends = settings.inviteBNAcceptFriends AJM.db.inviteAcceptGuild = settings.inviteAcceptGuild AJM.db.inviteDeclineStrangers = settings.inviteDeclineStrangers AJM.db.inviteConvertToRaid = settings.inviteConvertToRaid AJM.db.lootSetAutomatically = settings.lootSetAutomatically AJM.db.lootSetFreeForAll = settings.lootSetFreeForAll AJM.db.lootSetMasterLooter = settings.lootSetMasterLooter + AJM.db.lootSetPersLooter = settings.lootSetPersLooter AJM.db.lootSlavesOptOutOfLoot = settings.lootSlavesOptOutOfLoot + AJM.db.lootToGroupIfStrangerPresent = settings.lootToGroupIfStrangerPresent + AJM.db.lootToGroupFriendsAreNotStrangers = settings.lootToGroupFriendsAreNotStrangers AJM.db.masterChangeClickToMove = settings.masterChangeClickToMove AJM.db.master = settings.master + --Copy the Offline team members. + AJM.db.characterOnline = JambaUtilities:CopyTable( settings.characterOnline ) SetMaster( settings.master ) -- Refresh the settings. - AJM:SettingsRefresh() + --AJM:SettingsRefresh() -- Tell the player. AJM:Print( L["Settings received from A."]( characterName ) ) + -- Tell the team? + --AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false ) end end @@ -1325,7 +1583,7 @@ function AJM:SettingsTeamListScrollRefresh() displayCharacterName = characterName.." "..L["(Offline)"] end local isMaster = false - local characterType = L["Slave"] + local characterType = L["Minion"] if IsCharacterTheMaster( characterName ) == true then characterType = L["Master"] isMaster = true @@ -1404,11 +1662,9 @@ function AJM:SettingsRemoveClick( event ) StaticPopup_Show( "JAMBATEAM_CONFIRM_REMOVE_CHARACTER", characterName ) end --- ebony function AJM.SettingsAddPartyClick( event ) AJM:AddPartyMembers() end - function AJM:SettingsInviteClick( event ) AJM:InviteTeamToParty() end @@ -1417,6 +1673,14 @@ function AJM:SettingsDisbandClick( event ) AJM:DisbandTeamFromParty() end +--TODO CLEAN UP if remove the button. Ebony + +function AJM:SettingsOfflineClick( event ) + local characterName = GetCharacterNameAtOrderPosition( AJM.settingsControl.teamListHighlightRow ) + setOfflineClick ( characterName ) + AJM:SettingsTeamListScrollRefresh() +end + function AJM:SettingsSetMasterClick( event ) local characterName = GetCharacterNameAtOrderPosition( AJM.settingsControl.teamListHighlightRow ) SetMaster( characterName ) @@ -1452,7 +1716,6 @@ function AJM:SettingsAcceptInviteBNFriendsToggle( event, checked ) AJM.db.inviteAcceptBNFriends = checked AJM:SettingsRefresh() end - function AJM:SettingsAcceptInviteGuildToggle( event, checked ) AJM.db.inviteAcceptGuild = checked AJM:SettingsRefresh() @@ -1467,7 +1730,6 @@ function AJM:SettingsinviteConvertToRaidToggle( event, checked ) AJM.db.inviteConvertToRaid = checked AJM:SettingsRefresh() end - function AJM:SettingsSetLootMethodToggle( event, checked ) AJM.db.lootSetAutomatically = checked AJM:SettingsRefresh() @@ -1476,12 +1738,21 @@ end function AJM:SettingsSetFFALootToggle( event, checked ) AJM.db.lootSetFreeForAll = checked AJM.db.lootSetMasterLooter = not checked + AJM.db.lootSetPersLooter = not checked AJM:SettingsRefresh() end function AJM:SettingsSetMasterLooterToggle( event, checked ) AJM.db.lootSetMasterLooter = checked AJM.db.lootSetFreeForAll = not checked + AJM.db.lootSetPersLooter = not checked + AJM:SettingsRefresh() +end + +function AJM:SettingsSetPersLooterToggle( event, checked ) + AJM.db.lootSetPersLooter = checked + AJM.db.lootSetFreeForAll = not checked + AJM.db.lootSetMasterLooter = not checked AJM:SettingsRefresh() end @@ -1495,7 +1766,7 @@ function AJM:SettingsSetFriendsNotStrangers( event, checked ) AJM:SettingsRefresh() end -function AJM:SettingsSetSlavesOptOutToggle( event, checked ) +function AJM:SettingsSetMinionsOptOutToggle( event, checked ) AJM.db.lootSlavesOptOutOfLoot = checked AJM:SettingsRefresh() end @@ -1540,6 +1811,17 @@ function AJM:JambaOnCommandReceived( sender, commandName, ... ) AJM:ReceiveCommandSetMaster( ... ) end end + --Ebony8 + if commandName == AJM.COMMAND_SET_OFFLINE then + if IsCharacterInTeam( sender ) == true then + AJM.ReceivesetOffline( ... ) + end + end + if commandName == AJM.COMMAND_SET_ONLINE then + if IsCharacterInTeam( sender ) == true then + AJM.ReceivesetOnline( ... ) + end + end end -- Functions available from Jamba Team for other Jamba internal objects. @@ -1553,11 +1835,12 @@ JambaPrivate.Team.IsCharacterTheMaster = IsCharacterTheMaster JambaPrivate.Team.GetMasterName = GetMasterName JambaPrivate.Team.SetTeamStatusToOffline = SetTeamStatusToOffline JambaPrivate.Team.GetCharacterOnlineStatus = GetCharacterOnlineStatus -JambaPrivate.Team.SetCharacterOnlineStatus = SetCharacterOnlineStatus +JambaPrivate.Team.SetTeamOnline = SetTeamOnline JambaPrivate.Team.GetCharacterNameAtOrderPosition = GetCharacterNameAtOrderPosition JambaPrivate.Team.GetTeamListMaximumOrder = GetTeamListMaximumOrder -JambaPrivate.Team.IsCharacterTargetAnNpc = IsCharacterTargetAnNpc JambaPrivate.Team.RemoveAllMembersFromTeam = RemoveAllMembersFromTeam +JambaPrivate.Team.setOffline = setOffline +JambaPrivate.Team.setOnline = setOline -- Functions available for other addons. JambaApi.MESSAGE_TEAM_MASTER_CHANGED = AJM.MESSAGE_TEAM_MASTER_CHANGED @@ -1565,13 +1848,20 @@ JambaApi.MESSAGE_TEAM_ORDER_CHANGED = AJM.MESSAGE_TEAM_ORDER_CHANGED JambaApi.MESSAGE_TEAM_CHARACTER_ADDED = AJM.MESSAGE_TEAM_CHARACTER_ADDED JambaApi.MESSAGE_TEAM_CHARACTER_REMOVED = AJM.MESSAGE_TEAM_CHARACTER_REMOVED JambaApi.IsCharacterInTeam = IsCharacterInTeam -JambaApi.IsCharacterTargetAnNpc = IsCharacterTargetAnNpc JambaApi.IsCharacterTheMaster = IsCharacterTheMaster JambaApi.GetMasterName = GetMasterName JambaApi.TeamList = TeamList +JambaApi.Offline = Offline JambaApi.TeamListOrdered = TeamListOrdered JambaApi.GetCharacterNameAtOrderPosition = GetCharacterNameAtOrderPosition JambaApi.GetPositionForCharacterName = GetPositionForCharacterName JambaApi.GetTeamListMaximumOrder = GetTeamListMaximumOrder JambaApi.GetCharacterOnlineStatus = GetCharacterOnlineStatus -JambaApi.RemoveAllMembersFromTeam = RemoveAllMembersFromTeam \ No newline at end of file +JambaApi.RemoveAllMembersFromTeam = RemoveAllMembersFromTeam +JambaApi.MESSAGE_CHARACTER_ONLINE = AJM.MESSAGE_CHARACTER_ONLINE +JambaApi.MESSAGE_CHARACTER_OFFLINE = AJM.MESSAGE_CHARACTER_OFFLINE +JambaApi.setOffline = setOffline +JambaApi.setOnline = setOnline +JambaApi.GetTeamListMaximumOrderOnline = GetTeamListMaximumOrderOnline +JambaApi.TeamListOrderedOnline = TeamListOrderedOnline +JambaApi.GetPositionForCharacterNameOnline = GetPositionForCharacterNameOnline \ No newline at end of file diff --git a/Jamba/JambaUtilities.lua b/Jamba/JambaUtilities.lua index 49e9f72..4bdb3b3 100644 --- a/Jamba/JambaUtilities.lua +++ b/Jamba/JambaUtilities.lua @@ -1,6 +1,6 @@ --[[ Jamba - Jafula's Awesome Multi-Boxer Assistant -Copyright 2008 - 2015 Michael "Jafula" Miller +Copyright 2008 - 2016 Michael "Jafula" Miller License: The MIT License ]]-- @@ -33,7 +33,6 @@ function JambaUtilities:CopyTable(object) return _copy(object) end --- Clear a table. function JambaUtilities:ClearTable( object ) for key in next, object do if type( object[key] ) == "table" then @@ -43,47 +42,56 @@ function JambaUtilities:ClearTable( object ) end end - ---ebony -function JambaUtilities:RemoveRealmToNameIfAdded( name ) - local fullName = name - local matchDash = name:find( "-" ) - if matchDash then - fullName = gsub(name, "%-[^|]+", "") - end +function JambaUtilities:Lowercase( name ) + return string.utf8lower( name ) +end +--[[ +function JambaUtilities:AddRealmToNameIfMissing( name ) + --local fullName = name + Fullname = name:gsub("^%l", string.upper) + local matchDash = Fullname:find( "-" ) + if not matchDash then + local realmName = GetRealmName() + Fullname = Fullname.."-"..realmName + end + return Fullname +end +--]] + +--AddRealmToNameIfMissing Blizzard Code does not like spaces in the realm name GetRealmName() pulls back the name with a Space Unwanted for most of the stuff we need to do. +function JambaUtilities:AddRealmToNameIfMissing( name ) + Name = name:gsub("^%l", string.upper ) + fullName = Name:gsub( "%s+", "") + local matchDash = fullName:find( "-" ) + if not matchDash then + local k = GetRealmName() + local realm = k:gsub( "%s+", "") + fullName = fullName.."-"..realm + end return fullName end + + +--if not string.find(name, "-") then +-- local _, realm = UnitFullName("player") +-- name = name.."-"..realm +--end + -- Capitalise the name. function JambaUtilities:Capitalise( name ) return string.utf8upper( string.utf8sub( name, 1, 1 ) )..string.utf8lower( string.utf8sub( name, 2 ) ) end --- Capitalise the name. -function JambaUtilities:Lowercase( name ) - return string.utf8lower( name ) -end - -JambaUtilities.GUID_REPRESENTS_PLAYER = 0 -JambaUtilities.GUID_REPRESENTS_NPC = 1 -JambaUtilities.GUID_REPRESENTS_PET = 2 -JambaUtilities.GUID_REPRESENTS_VEHICLE = 3 - --- Parse a GUID. -function JambaUtilities:ParseGUID( guid ) - local first3 = tonumber( "0x"..strsub( guid, 3,5 ) ) - local unitType = bit.band( first3, 0x00f ) - if unitType == 0x000 then - return JambaUtilities.GUID_REPRESENTS_PLAYER - elseif unitType == 0x003 then - return JambaUtilities.GUID_REPRESENTS_NPC - elseif unitType == 0x004 then - return JambaUtilities.GUID_REPRESENTS_PET - elseif unitType == 0x005 then - return JambaUtilities.GUID_REPRESENTS_VEHICLE +function JambaUtilities:AddRealmToNameIfNotNil( name, realm ) + local fullName = name + if realm ~= nil and realm:trim() ~= "" then + fullName = name.."-"..realm end + return fullName end + -- Money constants. JambaUtilities.COLOUR_COPPER = "eda55f" JambaUtilities.COLOUR_SILVER = "c7c7cf" diff --git a/Jamba/LICENSE b/Jamba/LICENSE new file mode 100644 index 0000000..1975f7b --- /dev/null +++ b/Jamba/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2008-2016 Michael "Jafula" Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/Jamba/LibActionButtonJamba-1.0.lua b/Jamba/LibActionButtonJamba-1.0.lua index 74c144b..5de0d97 100644 --- a/Jamba/LibActionButtonJamba-1.0.lua +++ b/Jamba/LibActionButtonJamba-1.0.lua @@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ]] local MAJOR_VERSION = "LibActionButtonJamba-1.0" -local MINOR_VERSION = 57 +local MINOR_VERSION = 60 if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) @@ -55,9 +55,11 @@ local str_match, format, tinsert, tremove = string.match, format, tinsert, tremo -- GLOBALS: GetItemIcon, GetItemCount, GetItemCooldown, IsEquippedItem, IsCurrentItem, IsUsableItem, IsConsumableItem, IsItemInRange -- GLOBALS: GetActionCharges, IsItemAction, GetSpellCharges -- GLOBALS: RANGE_INDICATOR, ATTACK_BUTTON_FLASH_TIME, TOOLTIP_UPDATE_TIME +-- GLOBALS: DraenorZoneAbilityFrame, HasDraenorZoneAbility, GetLastDraenorSpellTexture local KeyBound = LibStub("LibKeyBound-1.0", true) local CBH = LibStub("CallbackHandler-1.0") +local LBG = LibStub("LibButtonGlow-1.0", true) lib.eventFrame = lib.eventFrame or CreateFrame("Frame") lib.eventFrame:UnregisterAllEvents() @@ -110,8 +112,7 @@ local ButtonRegistry, ActiveButtons, ActionButtons, NonActionButtons = lib.butto local Update, UpdateButtonState, UpdateUsable, UpdateCount, UpdateCooldown, UpdateTooltip, UpdateNewAction local StartFlash, StopFlash, UpdateFlash, UpdateHotkeys, UpdateRangeTimer, UpdateOverlayGlow local UpdateFlyout, ShowGrid, HideGrid, UpdateGrid, SetupSecureSnippets, WrapOnClick -local ShowOverlayGlow, HideOverlayGlow, GetOverlayGlow, OverlayGlowAnimOutFinished -local HookCooldown +local ShowOverlayGlow, HideOverlayGlow local InitializeEventHandler, OnEvent, ForAllButtons, OnUpdate @@ -181,9 +182,6 @@ function lib:CreateButton(id, name, header, config) -- adjust count/stack size button.Count:SetFont(button.Count:GetFont(), 16, "OUTLINE") - -- hook Cooldown stuff for alpha fix in 6.0 - HookCooldown(button) - -- Store the button in the registry, needed for event and OnUpdate handling if not next(ButtonRegistry) then InitializeEventHandler() @@ -438,7 +436,7 @@ function Generic:UpdateState(state) control:RunFor(frame, frame:GetAttribute("UpdateState"), frame:GetAttribute("state")) ]]) else - -- TODO + -- TODO end self:UpdateAction() end @@ -490,10 +488,6 @@ function Generic:AddToMasque(group) self.MasqueSkinned = true end -function Generic:UpdateAlpha() - UpdateCooldown(self) -end - ----------------------------------------------------------- --- frame scripts @@ -543,7 +537,7 @@ end -- to place it on the button. Like action buttons work. function Generic:PreClick() if self._state_type == "action" or self._state_type == "pet" - or InCombatLockdown() or self:GetAttribute("LABdisableDragNDrop") + or InCombatLockdown() or self:GetAttribute("LABdisableDragNDrop") then return end @@ -720,8 +714,8 @@ function OnEvent(frame, event, arg1, ...) elseif event == "PLAYER_TARGET_CHANGED" then UpdateRangeTimer() elseif (event == "ACTIONBAR_UPDATE_STATE") or - ((event == "UNIT_ENTERED_VEHICLE" or event == "UNIT_EXITED_VEHICLE") and (arg1 == "player")) or - ((event == "COMPANION_UPDATE") and (arg1 == "MOUNT")) then + ((event == "UNIT_ENTERED_VEHICLE" or event == "UNIT_EXITED_VEHICLE") and (arg1 == "player")) or + ((event == "COMPANION_UPDATE") and (arg1 == "MOUNT")) then ForAllButtons(UpdateButtonState, true) elseif event == "ACTIONBAR_UPDATE_USABLE" then for button in next, ActionButtons do @@ -1047,6 +1041,23 @@ function Update(self) -- Update icon and hotkey local texture = self:GetTexture() + + -- Draenor zone button handling + self.draenorZoneDisabled = false + self.icon:SetDesaturated(false) + if self._state_type == "action" then + local action_type, id = GetActionInfo(self._state_action) + if ((action_type == "spell" or action_type == "companion") and DraenorZoneAbilityFrame and DraenorZoneAbilityFrame.baseName and not HasDraenorZoneAbility()) then + local name = GetSpellInfo(DraenorZoneAbilityFrame.baseName) + local abilityName = GetSpellInfo(id) + if name == abilityName then + texture = GetLastDraenorSpellTexture() + self.draenorZoneDisabled = true + self.icon:SetDesaturated(true) + end + end + end + if texture then self.icon:SetTexture(texture) self.icon:Show() @@ -1099,7 +1110,7 @@ function Update(self) end function Generic:UpdateLocal() - -- dummy function the other button types can override for special updating +-- dummy function the other button types can override for special updating end function UpdateButtonState(self) @@ -1154,45 +1165,6 @@ function UpdateCount(self) end end -local function SetCooldownHook(cooldown, ...) - local effectiveAlpha = cooldown:GetEffectiveAlpha() - local start, duration = ... - - if start ~= 0 or duration ~= 0 then - -- update swipe alpha - cooldown.__metaLAB.SetSwipeColor(cooldown, cooldown.__SwipeR, cooldown.__SwipeG, cooldown.__SwipeB, cooldown.__SwipeA * effectiveAlpha) - - -- only draw bling and edge if alpha is over 50% - cooldown:SetDrawBling(effectiveAlpha > 0.5) - if effectiveAlpha < 0.5 then - cooldown:SetDrawEdge(false) - end - - -- ensure the swipe isn't drawn on fully faded bars - if effectiveAlpha <= 0.0 then - cooldown:SetDrawSwipe(false) - end - end - - return cooldown.__metaLAB.SetCooldown(cooldown, ...) -end - -local function SetSwipeColorHook(cooldown, r, g, b, a) - local effectiveAlpha = cooldown:GetEffectiveAlpha() - cooldown.__SwipeR, cooldown.__SwipeG, cooldown.__SwipeB, cooldown.__SwipeA = r, g, b, (a or 1) - return cooldown.__metaLAB.SetSwipeColor(cooldown, r, g, b, a * effectiveAlpha) -end - -function HookCooldown(button) - if not button.cooldown.__metaLAB then - button.cooldown.__metaLAB = getmetatable(button.cooldown).__index - button.cooldown.__SwipeR, button.cooldown.__SwipeG, button.cooldown.__SwipeB, button.cooldown.__SwipeA = 0, 0, 0, 0.8 - - button.cooldown.SetCooldown = SetCooldownHook - button.cooldown.SetSwipeColor = SetSwipeColorHook - end -end - function OnCooldownDone(self) self:SetScript("OnCooldownDone", nil) UpdateCooldown(self:GetParent()) @@ -1205,17 +1177,17 @@ function UpdateCooldown(self) if (locStart + locDuration) > (start + duration) then if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_LOSS_OF_CONTROL then self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge-LoC") + self.cooldown:SetSwipeColor(0.17, 0, 0) self.cooldown:SetHideCountdownNumbers(true) self.cooldown.currentCooldownType = COOLDOWN_TYPE_LOSS_OF_CONTROL - self.cooldown:SetSwipeColor(0.17, 0, 0, 0.8) end CooldownFrame_SetTimer(self.cooldown, locStart, locDuration, 1, nil, nil, true) else if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_NORMAL then self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge") + self.cooldown:SetSwipeColor(0, 0, 0) self.cooldown:SetHideCountdownNumbers(false) self.cooldown.currentCooldownType = COOLDOWN_TYPE_NORMAL - self.cooldown:SetSwipeColor(0, 0, 0, 0.8) end if locStart > 0 then self.cooldown:SetScript("OnCooldownDone", OnCooldownDone) @@ -1270,64 +1242,18 @@ function UpdateHotkeys(self) end end -local function OverlayGlow_OnHide(self) - if self.animOut:IsPlaying() then - self.animOut:Stop() - OverlayGlowAnimOutFinished(self.animOut) - end -end - -function GetOverlayGlow() - local overlay = tremove(lib.unusedOverlayGlows); - if not overlay then - lib.numOverlays = lib.numOverlays + 1 - overlay = CreateFrame("Frame", "LAB10ActionButtonOverlay"..lib.numOverlays, UIParent, "ActionBarButtonSpellActivationAlert") - overlay.animOut:SetScript("OnFinished", OverlayGlowAnimOutFinished) - overlay:SetScript("OnHide", OverlayGlow_OnHide) - end - return overlay -end - function ShowOverlayGlow(self) - if self.overlay then - if self.overlay.animOut:IsPlaying() then - self.overlay.animOut:Stop() - self.overlay.animIn:Play() - end - else - self.overlay = GetOverlayGlow() - local frameWidth, frameHeight = self:GetSize() - self.overlay:SetParent(self) - self.overlay:ClearAllPoints() - --Make the height/width available before the next frame: - self.overlay:SetSize(frameWidth * 1.4, frameHeight * 1.4) - self.overlay:SetPoint("TOPLEFT", self, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2) - self.overlay:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2) - self.overlay.animIn:Play() + if LBG then + LBG.ShowOverlayGlow(self) end end function HideOverlayGlow(self) - if self.overlay then - if self.overlay.animIn:IsPlaying() then - self.overlay.animIn:Stop() - end - if self:IsVisible() then - self.overlay.animOut:Play() - else - OverlayGlowAnimOutFinished(self.overlay.animOut) - end + if LBG then + LBG.HideOverlayGlow(self) end end -function OverlayGlowAnimOutFinished(animGroup) - local overlay = animGroup:GetParent() - local actionButton = overlay:GetParent() - overlay:Hide() - tinsert(lib.unusedOverlayGlows, overlay) - actionButton.overlay = nil -end - function UpdateOverlayGlow(self) local spellId = self:GetSpellId() if spellId and IsSpellOverlayed(spellId) then diff --git a/Jamba/LibActionButtonJamba-1.00.lua b/Jamba/LibActionButtonJamba-1.00.lua new file mode 100644 index 0000000..74c144b --- /dev/null +++ b/Jamba/LibActionButtonJamba-1.00.lua @@ -0,0 +1,1576 @@ +--[[ +Copyright (c) 2010-2014, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com> + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the developer nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +]] +local MAJOR_VERSION = "LibActionButtonJamba-1.0" +local MINOR_VERSION = 57 + +if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end +local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) +if not lib then return end + +-- Lua functions +local _G = _G +local type, error, tostring, tonumber, assert, select = type, error, tostring, tonumber, assert, select +local setmetatable, wipe, unpack, pairs, next = setmetatable, wipe, unpack, pairs, next +local str_match, format, tinsert, tremove = string.match, format, tinsert, tremove + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- Note: No WoW API function get upvalued to allow proper interaction with any addons that try to hook them. +-- GLOBALS: LibStub, CreateFrame, InCombatLockdown, ClearCursor, GetCursorInfo, GameTooltip, GameTooltip_SetDefaultAnchor +-- GLOBALS: GetBindingKey, GetBindingText, SetBinding, SetBindingClick, GetCVar, GetMacroInfo +-- GLOBALS: PickupAction, PickupItem, PickupMacro, PickupPetAction, PickupSpell, PickupCompanion, PickupEquipmentSet +-- GLOBALS: CooldownFrame_SetTimer, UIParent, IsSpellOverlayed, SpellFlyout, GetMouseFocus, SetClampedTextureRotation +-- GLOBALS: GetActionInfo, GetActionTexture, HasAction, GetActionText, GetActionCount, GetActionCooldown, IsAttackAction +-- GLOBALS: IsAutoRepeatAction, IsEquippedAction, IsCurrentAction, IsConsumableAction, IsUsableAction, IsStackableAction, IsActionInRange +-- GLOBALS: GetSpellLink, GetMacroSpell, GetSpellTexture, GetSpellCount, GetSpellCooldown, IsAttackSpell, IsCurrentSpell +-- GLOBALS: FindSpellBookSlotBySpellID, IsUsableSpell, IsConsumableSpell, IsSpellInRange, IsAutoRepeatSpell +-- GLOBALS: GetItemIcon, GetItemCount, GetItemCooldown, IsEquippedItem, IsCurrentItem, IsUsableItem, IsConsumableItem, IsItemInRange +-- GLOBALS: GetActionCharges, IsItemAction, GetSpellCharges +-- GLOBALS: RANGE_INDICATOR, ATTACK_BUTTON_FLASH_TIME, TOOLTIP_UPDATE_TIME + +local KeyBound = LibStub("LibKeyBound-1.0", true) +local CBH = LibStub("CallbackHandler-1.0") + +lib.eventFrame = lib.eventFrame or CreateFrame("Frame") +lib.eventFrame:UnregisterAllEvents() + +lib.buttonRegistry = lib.buttonRegistry or {} +lib.activeButtons = lib.activeButtons or {} +lib.actionButtons = lib.actionButtons or {} +lib.nonActionButtons = lib.nonActionButtons or {} + +lib.unusedOverlayGlows = lib.unusedOverlayGlows or {} +lib.numOverlays = lib.numOverlays or 0 + +lib.ACTION_HIGHLIGHT_MARKS = lib.ACTION_HIGHLIGHT_MARKS or setmetatable({}, { __index = ACTION_HIGHLIGHT_MARKS }) + +lib.callbacks = lib.callbacks or CBH:New(lib) + +local Generic = CreateFrame("CheckButton") +local Generic_MT = {__index = Generic} + +local Action = setmetatable({}, {__index = Generic}) +local Action_MT = {__index = Action} + +local PetAction = setmetatable({}, {__index = Generic}) +local PetAction_MT = {__index = PetAction} + +local Spell = setmetatable({}, {__index = Generic}) +local Spell_MT = {__index = Spell} + +local Item = setmetatable({}, {__index = Generic}) +local Item_MT = {__index = Item} + +local Macro = setmetatable({}, {__index = Generic}) +local Macro_MT = {__index = Macro} + +local Custom = setmetatable({}, {__index = Generic}) +local Custom_MT = {__index = Custom} + +local type_meta_map = { + empty = Generic_MT, + action = Action_MT, + --pet = PetAction_MT, + spell = Spell_MT, + item = Item_MT, + macro = Macro_MT, + custom = Custom_MT +} + +local ButtonRegistry, ActiveButtons, ActionButtons, NonActionButtons = lib.buttonRegistry, lib.activeButtons, lib.actionButtons, lib.nonActionButtons + +local Update, UpdateButtonState, UpdateUsable, UpdateCount, UpdateCooldown, UpdateTooltip, UpdateNewAction +local StartFlash, StopFlash, UpdateFlash, UpdateHotkeys, UpdateRangeTimer, UpdateOverlayGlow +local UpdateFlyout, ShowGrid, HideGrid, UpdateGrid, SetupSecureSnippets, WrapOnClick +local ShowOverlayGlow, HideOverlayGlow, GetOverlayGlow, OverlayGlowAnimOutFinished +local HookCooldown + +local InitializeEventHandler, OnEvent, ForAllButtons, OnUpdate + +local DefaultConfig = { + outOfRangeColoring = "button", + tooltip = "enabled", + showGrid = false, + colors = { + range = { 0.8, 0.1, 0.1 }, + mana = { 0.5, 0.5, 1.0 } + }, + hideElements = { + macro = false, + hotkey = false, + equipped = false, + }, + keyBoundTarget = false, + clickOnDown = false, + flyoutDirection = "UP", +} + +--- Create a new action button. +-- @param id Internal id of the button (not used by LibActionButton-1.0, only for tracking inside the calling addon) +-- @param name Name of the button frame to be created (not used by LibActionButton-1.0 aside from naming the frame) +-- @param header Header that drives these action buttons (if any) +function lib:CreateButton(id, name, header, config) + if type(name) ~= "string" then + error("Usage: CreateButton(id, name. header): Buttons must have a valid name!", 2) + end + if not header then + error("Usage: CreateButton(id, name, header): Buttons without a secure header are not yet supported!", 2) + end + + if not KeyBound then + KeyBound = LibStub("LibKeyBound-1.0", true) + end + + local button = setmetatable(CreateFrame("CheckButton", name, header, "SecureActionButtonTemplate, ActionButtonTemplate"), Generic_MT) + button:RegisterForDrag("LeftButton", "RightButton") + button:RegisterForClicks("AnyUp") + + -- Frame Scripts + button:SetScript("OnEnter", Generic.OnEnter) + button:SetScript("OnLeave", Generic.OnLeave) + button:SetScript("PreClick", Generic.PreClick) + button:SetScript("PostClick", Generic.PostClick) + + button.id = id + button.header = header + -- Mapping of state -> action + button.state_types = {} + button.state_actions = {} + + -- Store the LAB Version that created this button for debugging + button.__LAB_Version = MINOR_VERSION + + -- just in case we're not run by a header, default to state 0 + button:SetAttribute("state", 0) + + SetupSecureSnippets(button) + WrapOnClick(button) + + -- adjust hotkey style for better readability + button.HotKey:SetFont(button.HotKey:GetFont(), 13, "OUTLINE") + button.HotKey:SetVertexColor(0.75, 0.75, 0.75) + + -- adjust count/stack size + button.Count:SetFont(button.Count:GetFont(), 16, "OUTLINE") + + -- hook Cooldown stuff for alpha fix in 6.0 + HookCooldown(button) + + -- Store the button in the registry, needed for event and OnUpdate handling + if not next(ButtonRegistry) then + InitializeEventHandler() + end + ButtonRegistry[button] = true + + button:UpdateConfig(config) + + -- run an initial update + button:UpdateAction() + UpdateHotkeys(button) + + -- somewhat of a hack for the Flyout buttons to not error. + button.action = 0 + + lib.callbacks:Fire("OnButtonCreated", button) + + return button +end + +function SetupSecureSnippets(button) + button:SetAttribute("_custom", Custom.RunCustom) + -- secure UpdateState(self, state) + -- update the type and action of the button based on the state + button:SetAttribute("UpdateState", [[ + local state = ... + self:SetAttribute("state", state) + local type, action = (self:GetAttribute(format("labtype-%s", state)) or "empty"), self:GetAttribute(format("labaction-%s", state)) + + self:SetAttribute("type", type) + if type ~= "empty" and type ~= "custom" then + local action_field = (type == "pet") and "action" or type + self:SetAttribute(action_field, action) + self:SetAttribute("action_field", action_field) + end + local onStateChanged = self:GetAttribute("OnStateChanged") + if onStateChanged then + self:Run(onStateChanged, state, type, action) + end + ]]) + + -- this function is invoked by the header when the state changes + button:SetAttribute("_childupdate-state", [[ + self:RunAttribute("UpdateState", message) + self:CallMethod("UpdateAction") + ]]) + + -- secure PickupButton(self, kind, value, ...) + -- utility function to place a object on the cursor + button:SetAttribute("PickupButton", [[ + local kind, value = ... + if kind == "empty" then + return "clear" + elseif kind == "action" or kind == "pet" then + local actionType = (kind == "pet") and "petaction" or kind + return actionType, value + elseif kind == "spell" or kind == "item" or kind == "macro" then + return "clear", kind, value + else + print("LibActionButton-1.0: Unknown type: " .. tostring(kind)) + return false + end + ]]) + + button:SetAttribute("OnDragStart", [[ + if (self:GetAttribute("buttonlock") and not IsModifiedClick("PICKUPACTION")) or self:GetAttribute("LABdisableDragNDrop") then return false end + local state = self:GetAttribute("state") + local type = self:GetAttribute("type") + -- if the button is empty, we can't drag anything off it + if type == "empty" or type == "custom" then + return false + end + -- Get the value for the action attribute + local action_field = self:GetAttribute("action_field") + local action = self:GetAttribute(action_field) + + -- non-action fields need to change their type to empty + if type ~= "action" and type ~= "pet" then + self:SetAttribute(format("labtype-%s", state), "empty") + self:SetAttribute(format("labaction-%s", state), nil) + -- update internal state + self:RunAttribute("UpdateState", state) + -- send a notification to the insecure code + self:CallMethod("ButtonContentsChanged", state, "empty", nil) + end + -- return the button contents for pickup + return self:RunAttribute("PickupButton", type, action) + ]]) + + button:SetAttribute("OnReceiveDrag", [[ + if self:GetAttribute("LABdisableDragNDrop") then return false end + local kind, value, subtype, extra = ... + if not kind or not value then return false end + local state = self:GetAttribute("state") + local buttonType, buttonAction = self:GetAttribute("type"), nil + if buttonType == "custom" then return false end + -- action buttons can do their magic themself + -- for all other buttons, we'll need to update the content now + if buttonType ~= "action" and buttonType ~= "pet" then + -- with "spell" types, the 4th value contains the actual spell id + if kind == "spell" then + if extra then + value = extra + else + print("no spell id?", ...) + end + elseif kind == "item" and value then + value = format("item:%d", value) + end + + -- Get the action that was on the button before + if buttonType ~= "empty" then + buttonAction = self:GetAttribute(self:GetAttribute("action_field")) + end + + -- TODO: validate what kind of action is being fed in here + -- We can only use a handful of the possible things on the cursor + -- return false for all those we can't put on buttons + + self:SetAttribute(format("labtype-%s", state), kind) + self:SetAttribute(format("labaction-%s", state), value) + -- update internal state + self:RunAttribute("UpdateState", state) + -- send a notification to the insecure code + self:CallMethod("ButtonContentsChanged", state, kind, value) + else + -- get the action for (pet-)action buttons + buttonAction = self:GetAttribute("action") + end + return self:RunAttribute("PickupButton", buttonType, buttonAction) + ]]) + + button:SetScript("OnDragStart", nil) + -- Wrapped OnDragStart(self, button, kind, value, ...) + button.header:WrapScript(button, "OnDragStart", [[ + return self:RunAttribute("OnDragStart") + ]]) + -- Wrap twice, because the post-script is not run when the pre-script causes a pickup (doh) + -- we also need some phony message, or it won't work =/ + button.header:WrapScript(button, "OnDragStart", [[ + return "message", "update" + ]], [[ + self:RunAttribute("UpdateState", self:GetAttribute("state")) + ]]) + + button:SetScript("OnReceiveDrag", nil) + -- Wrapped OnReceiveDrag(self, button, kind, value, ...) + button.header:WrapScript(button, "OnReceiveDrag", [[ + return self:RunAttribute("OnReceiveDrag", kind, value, ...) + ]]) + -- Wrap twice, because the post-script is not run when the pre-script causes a pickup (doh) + -- we also need some phony message, or it won't work =/ + button.header:WrapScript(button, "OnReceiveDrag", [[ + return "message", "update" + ]], [[ + self:RunAttribute("UpdateState", self:GetAttribute("state")) + ]]) +end + +function WrapOnClick(button) + -- Wrap OnClick, to catch changes to actions that are applied with a click on the button. + button.header:WrapScript(button, "OnClick", [[ + if self:GetAttribute("type") == "action" then + local type, action = GetActionInfo(self:GetAttribute("action")) + return nil, format("%s|%s", tostring(type), tostring(action)) + end + ]], [[ + local type, action = GetActionInfo(self:GetAttribute("action")) + if message ~= format("%s|%s", tostring(type), tostring(action)) then + self:RunAttribute("UpdateState", self:GetAttribute("state")) + end + ]]) +end + +----------------------------------------------------------- +--- utility + +function lib:GetAllButtons() + local buttons = {} + for button in next, ButtonRegistry do + buttons[button] = true + end + return buttons +end + +function Generic:ClearSetPoint(...) + self:ClearAllPoints() + self:SetPoint(...) +end + +function Generic:NewHeader(header) + self.header = header + self:SetParent(header) + SetupSecureSnippets(self) + WrapOnClick(self) +end + + +----------------------------------------------------------- +--- state management + +function Generic:ClearStates() + for state in pairs(self.state_types) do + self:SetAttribute(format("labtype-%s", state), nil) + self:SetAttribute(format("labaction-%s", state), nil) + end + wipe(self.state_types) + wipe(self.state_actions) +end + +function Generic:SetState(state, kind, action) + if not state then state = self:GetAttribute("state") end + state = tostring(state) + -- we allow a nil kind for setting a empty state + if not kind then kind = "empty" end + if not type_meta_map[kind] then + error("SetStateAction: unknown action type: " .. tostring(kind), 2) + end + if kind ~= "empty" and action == nil then + error("SetStateAction: an action is required for non-empty states", 2) + end + if kind ~= "custom" and action ~= nil and type(action) ~= "number" and type(action) ~= "string" or (kind == "custom" and type(action) ~= "table") then + error("SetStateAction: invalid action data type, only strings and numbers allowed", 2) + end + + if kind == "item" then + if tonumber(action) then + action = format("item:%s", action) + else + local itemString = str_match(action, "^|c%x+|H(item[%d:]+)|h%[") + if itemString then + action = itemString + end + end + end + + self.state_types[state] = kind + self.state_actions[state] = action + self:UpdateState(state) +end + +function Generic:UpdateState(state) + if not state then state = self:GetAttribute("state") end + state = tostring(state) + self:SetAttribute(format("labtype-%s", state), self.state_types[state]) + self:SetAttribute(format("labaction-%s", state), self.state_actions[state]) + if state ~= tostring(self:GetAttribute("state")) then return end + if self.header then + self.header:SetFrameRef("updateButton", self) + self.header:Execute([[ + local frame = self:GetFrameRef("updateButton") + control:RunFor(frame, frame:GetAttribute("UpdateState"), frame:GetAttribute("state")) + ]]) + else + -- TODO + end + self:UpdateAction() +end + +function Generic:GetAction(state) + if not state then state = self:GetAttribute("state") end + state = tostring(state) + return self.state_types[state] or "empty", self.state_actions[state] +end + +function Generic:UpdateAllStates() + for state in pairs(self.state_types) do + self:UpdateState(state) + end +end + +function Generic:ButtonContentsChanged(state, kind, value) + state = tostring(state) + self.state_types[state] = kind or "empty" + self.state_actions[state] = value + lib.callbacks:Fire("OnButtonContentsChanged", self, state, self.state_types[state], self.state_actions[state]) + self:UpdateAction(self) +end + +function Generic:DisableDragNDrop(flag) + if InCombatLockdown() then + error("LibActionButton-1.0: You can only toggle DragNDrop out of combat!", 2) + end + if flag then + self:SetAttribute("LABdisableDragNDrop", true) + else + self:SetAttribute("LABdisableDragNDrop", nil) + end +end + +function Generic:AddToButtonFacade(group) + if type(group) ~= "table" or type(group.AddButton) ~= "function" then + error("LibActionButton-1.0:AddToButtonFacade: You need to supply a proper group to use!", 2) + end + group:AddButton(self) + self.LBFSkinned = true +end + +function Generic:AddToMasque(group) + if type(group) ~= "table" or type(group.AddButton) ~= "function" then + error("LibActionButton-1.0:AddToMasque: You need to supply a proper group to use!", 2) + end + group:AddButton(self) + self.MasqueSkinned = true +end + +function Generic:UpdateAlpha() + UpdateCooldown(self) +end + +----------------------------------------------------------- +--- frame scripts + +-- copied (and adjusted) from SecureHandlers.lua +local function PickupAny(kind, target, detail, ...) + if kind == "clear" then + ClearCursor() + kind, target, detail = target, detail, ... + end + + if kind == 'action' then + PickupAction(target) + elseif kind == 'item' then + PickupItem(target) + elseif kind == 'macro' then + PickupMacro(target) + elseif kind == 'petaction' then + PickupPetAction(target) + elseif kind == 'spell' then + PickupSpell(target) + elseif kind == 'companion' then + PickupCompanion(target, detail) + elseif kind == 'equipmentset' then + PickupEquipmentSet(target) + end +end + +function Generic:OnEnter() + if self.config.tooltip ~= "disabled" and (self.config.tooltip ~= "nocombat" or not InCombatLockdown()) then + UpdateTooltip(self) + end + if KeyBound then + KeyBound:Set(self) + end + + if self._state_type == "action" and self.NewActionTexture then + lib.ACTION_HIGHLIGHT_MARKS[self._state_action] = false + UpdateNewAction(self) + end +end + +function Generic:OnLeave() + GameTooltip:Hide() +end + +-- Insecure drag handler to allow clicking on the button with an action on the cursor +-- to place it on the button. Like action buttons work. +function Generic:PreClick() + if self._state_type == "action" or self._state_type == "pet" + or InCombatLockdown() or self:GetAttribute("LABdisableDragNDrop") + then + return + end + -- check if there is actually something on the cursor + local kind, value, subtype = GetCursorInfo() + if not (kind and value) then return end + self._old_type = self._state_type + if self._state_type and self._state_type ~= "empty" then + self._old_type = self._state_type + self:SetAttribute("type", "empty") + --self:SetState(nil, "empty", nil) + end + self._receiving_drag = true +end + +local function formatHelper(input) + if type(input) == "string" then + return format("%q", input) + else + return tostring(input) + end +end + +function Generic:PostClick() + UpdateButtonState(self) + if self._receiving_drag and not InCombatLockdown() then + if self._old_type then + self:SetAttribute("type", self._old_type) + self._old_type = nil + end + local oldType, oldAction = self._state_type, self._state_action + local kind, data, subtype, extra = GetCursorInfo() + self.header:SetFrameRef("updateButton", self) + self.header:Execute(format([[ + local frame = self:GetFrameRef("updateButton") + control:RunFor(frame, frame:GetAttribute("OnReceiveDrag"), %s, %s, %s, %s) + control:RunFor(frame, frame:GetAttribute("UpdateState"), %s) + ]], formatHelper(kind), formatHelper(data), formatHelper(subtype), formatHelper(extra), formatHelper(self:GetAttribute("state")))) + PickupAny("clear", oldType, oldAction) + end + self._receiving_drag = nil +end + +----------------------------------------------------------- +--- configuration + +local function merge(target, source, default) + for k,v in pairs(default) do + if type(v) ~= "table" then + if source and source[k] ~= nil then + target[k] = source[k] + else + target[k] = v + end + else + if type(target[k]) ~= "table" then target[k] = {} else wipe(target[k]) end + merge(target[k], type(source) == "table" and source[k], v) + end + end + return target +end + +function Generic:UpdateConfig(config) + if config and type(config) ~= "table" then + error("LibActionButton-1.0: UpdateConfig requires a valid configuration!", 2) + end + local oldconfig = self.config + if not self.config then self.config = {} end + -- merge the two configs + merge(self.config, config, DefaultConfig) + + if self.config.outOfRangeColoring == "button" or (oldconfig and oldconfig.outOfRangeColoring == "button") then + UpdateUsable(self) + end + if self.config.outOfRangeColoring == "hotkey" then + self.outOfRange = nil + elseif oldconfig and oldconfig.outOfRangeColoring == "hotkey" then + self.HotKey:SetVertexColor(0.75, 0.75, 0.75) + end + + if self.config.hideElements.macro then + self.Name:Hide() + else + self.Name:Show() + end + + self:SetAttribute("flyoutDirection", self.config.flyoutDirection) + + UpdateHotkeys(self) + UpdateGrid(self) + Update(self) + self:RegisterForClicks(self.config.clickOnDown and "AnyDown" or "AnyUp") +end + +----------------------------------------------------------- +--- event handler + +function ForAllButtons(method, onlyWithAction) + assert(type(method) == "function") + for button in next, (onlyWithAction and ActiveButtons or ButtonRegistry) do + method(button) + end +end + +function InitializeEventHandler() + lib.eventFrame:SetScript("OnEvent", OnEvent) + lib.eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD") + lib.eventFrame:RegisterEvent("ACTIONBAR_SHOWGRID") + lib.eventFrame:RegisterEvent("ACTIONBAR_HIDEGRID") + --lib.eventFrame:RegisterEvent("ACTIONBAR_PAGE_CHANGED") + --lib.eventFrame:RegisterEvent("UPDATE_BONUS_ACTIONBAR") + lib.eventFrame:RegisterEvent("ACTIONBAR_SLOT_CHANGED") + lib.eventFrame:RegisterEvent("UPDATE_BINDINGS") + lib.eventFrame:RegisterEvent("UPDATE_SHAPESHIFT_FORM") + lib.eventFrame:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR") + + lib.eventFrame:RegisterEvent("ACTIONBAR_UPDATE_STATE") + lib.eventFrame:RegisterEvent("ACTIONBAR_UPDATE_USABLE") + lib.eventFrame:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN") + lib.eventFrame:RegisterEvent("PLAYER_TARGET_CHANGED") + lib.eventFrame:RegisterEvent("TRADE_SKILL_SHOW") + lib.eventFrame:RegisterEvent("TRADE_SKILL_CLOSE") + lib.eventFrame:RegisterEvent("ARCHAEOLOGY_CLOSED") + lib.eventFrame:RegisterEvent("PLAYER_ENTER_COMBAT") + lib.eventFrame:RegisterEvent("PLAYER_LEAVE_COMBAT") + lib.eventFrame:RegisterEvent("START_AUTOREPEAT_SPELL") + lib.eventFrame:RegisterEvent("STOP_AUTOREPEAT_SPELL") + lib.eventFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") + lib.eventFrame:RegisterEvent("UNIT_EXITED_VEHICLE") + lib.eventFrame:RegisterEvent("COMPANION_UPDATE") + lib.eventFrame:RegisterEvent("UNIT_INVENTORY_CHANGED") + lib.eventFrame:RegisterEvent("LEARNED_SPELL_IN_TAB") + lib.eventFrame:RegisterEvent("PET_STABLE_UPDATE") + lib.eventFrame:RegisterEvent("PET_STABLE_SHOW") + lib.eventFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW") + lib.eventFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE") + lib.eventFrame:RegisterEvent("SPELL_UPDATE_CHARGES") + lib.eventFrame:RegisterEvent("UPDATE_SUMMONPETS_ACTION") + + -- With those two, do we still need the ACTIONBAR equivalents of them? + lib.eventFrame:RegisterEvent("SPELL_UPDATE_COOLDOWN") + lib.eventFrame:RegisterEvent("SPELL_UPDATE_USABLE") + lib.eventFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") + + lib.eventFrame:RegisterEvent("LOSS_OF_CONTROL_ADDED") + lib.eventFrame:RegisterEvent("LOSS_OF_CONTROL_UPDATE") + + lib.eventFrame:Show() + lib.eventFrame:SetScript("OnUpdate", OnUpdate) +end + +function OnEvent(frame, event, arg1, ...) + if (event == "UNIT_INVENTORY_CHANGED" and arg1 == "player") or event == "LEARNED_SPELL_IN_TAB" then + local tooltipOwner = GameTooltip:GetOwner() + if ButtonRegistry[tooltipOwner] then + tooltipOwner:SetTooltip() + end + elseif event == "ACTIONBAR_SLOT_CHANGED" then + for button in next, ButtonRegistry do + if button._state_type == "action" and (arg1 == 0 or arg1 == tonumber(button._state_action)) then + Update(button) + end + end + elseif event == "PLAYER_ENTERING_WORLD" or event == "UPDATE_SHAPESHIFT_FORM" or event == "UPDATE_VEHICLE_ACTIONBAR" then + ForAllButtons(Update) + elseif event == "ACTIONBAR_PAGE_CHANGED" or event == "UPDATE_BONUS_ACTIONBAR" then + -- TODO: Are these even needed? + elseif event == "ACTIONBAR_SHOWGRID" then + ShowGrid() + elseif event == "ACTIONBAR_HIDEGRID" then + HideGrid() + elseif event == "UPDATE_BINDINGS" then + ForAllButtons(UpdateHotkeys) + elseif event == "PLAYER_TARGET_CHANGED" then + UpdateRangeTimer() + elseif (event == "ACTIONBAR_UPDATE_STATE") or + ((event == "UNIT_ENTERED_VEHICLE" or event == "UNIT_EXITED_VEHICLE") and (arg1 == "player")) or + ((event == "COMPANION_UPDATE") and (arg1 == "MOUNT")) then + ForAllButtons(UpdateButtonState, true) + elseif event == "ACTIONBAR_UPDATE_USABLE" then + for button in next, ActionButtons do + UpdateUsable(button) + end + elseif event == "SPELL_UPDATE_USABLE" then + for button in next, NonActionButtons do + UpdateUsable(button) + end + elseif event == "ACTIONBAR_UPDATE_COOLDOWN" then + for button in next, ActionButtons do + UpdateCooldown(button) + if GameTooltip:GetOwner() == button then + UpdateTooltip(button) + end + end + elseif event == "SPELL_UPDATE_COOLDOWN" then + for button in next, NonActionButtons do + UpdateCooldown(button) + if GameTooltip:GetOwner() == button then + UpdateTooltip(button) + end + end + elseif event == "LOSS_OF_CONTROL_ADDED" then + for button in next, ActiveButtons do + UpdateCooldown(button) + if GameTooltip:GetOwner() == button then + UpdateTooltip(button) + end + end + elseif event == "LOSS_OF_CONTROL_UPDATE" then + for button in next, ActiveButtons do + UpdateCooldown(button) + end + elseif event == "TRADE_SKILL_SHOW" or event == "TRADE_SKILL_CLOSE" or event == "ARCHAEOLOGY_CLOSED" then + ForAllButtons(UpdateButtonState, true) + elseif event == "PLAYER_ENTER_COMBAT" then + for button in next, ActiveButtons do + if button:IsAttack() then + StartFlash(button) + end + end + elseif event == "PLAYER_LEAVE_COMBAT" then + for button in next, ActiveButtons do + if button:IsAttack() then + StopFlash(button) + end + end + elseif event == "START_AUTOREPEAT_SPELL" then + for button in next, ActiveButtons do + if button:IsAutoRepeat() then + StartFlash(button) + end + end + elseif event == "STOP_AUTOREPEAT_SPELL" then + for button in next, ActiveButtons do + if button.flashing == 1 and not button:IsAttack() then + StopFlash(button) + end + end + elseif event == "PET_STABLE_UPDATE" or event == "PET_STABLE_SHOW" then + ForAllButtons(Update) + elseif event == "SPELL_ACTIVATION_OVERLAY_GLOW_SHOW" then + for button in next, ActiveButtons do + local spellId = button:GetSpellId() + if spellId and spellId == arg1 then + ShowOverlayGlow(button) + else + if button._state_type == "action" then + local actionType, id = GetActionInfo(button._state_action) + if actionType == "flyout" and FlyoutHasSpell(id, arg1) then + ShowOverlayGlow(button) + end + end + end + end + elseif event == "SPELL_ACTIVATION_OVERLAY_GLOW_HIDE" then + for button in next, ActiveButtons do + local spellId = button:GetSpellId() + if spellId and spellId == arg1 then + HideOverlayGlow(button) + else + if button._state_type == "action" then + local actionType, id = GetActionInfo(button._state_action) + if actionType == "flyout" and FlyoutHasSpell(id, arg1) then + HideOverlayGlow(button) + end + end + end + end + elseif event == "PLAYER_EQUIPMENT_CHANGED" then + for button in next, ActiveButtons do + if button._state_type == "item" then + Update(button) + end + end + elseif event == "SPELL_UPDATE_CHARGES" then + ForAllButtons(UpdateCount, true) + elseif event == "UPDATE_SUMMONPETS_ACTION" then + for button in next, ActiveButtons do + if button._state_type == "action" then + local actionType, id = GetActionInfo(button._state_action) + if actionType == "summonpet" then + local texture = GetActionTexture(button._state_action) + if texture then + button.icon:SetTexture(texture) + end + end + end + end + end +end + +local flashTime = 0 +local rangeTimer = -1 +function OnUpdate(_, elapsed) + flashTime = flashTime - elapsed + rangeTimer = rangeTimer - elapsed + -- Run the loop only when there is something to update + if rangeTimer <= 0 or flashTime <= 0 then + for button in next, ActiveButtons do + -- Flashing + if button.flashing == 1 and flashTime <= 0 then + if button.Flash:IsShown() then + button.Flash:Hide() + else + button.Flash:Show() + end + end + + -- Range + if rangeTimer <= 0 then + local inRange = button:IsInRange() + local oldRange = button.outOfRange + button.outOfRange = (inRange == false) + if oldRange ~= button.outOfRange then + if button.config.outOfRangeColoring == "button" then + UpdateUsable(button) + elseif button.config.outOfRangeColoring == "hotkey" then + local hotkey = button.HotKey + if hotkey:GetText() == RANGE_INDICATOR then + if inRange == false then + hotkey:Show() + else + hotkey:Hide() + end + end + if inRange == false then + hotkey:SetVertexColor(unpack(button.config.colors.range)) + else + hotkey:SetVertexColor(0.75, 0.75, 0.75) + end + end + end + end + end + + -- Update values + if flashTime <= 0 then + flashTime = flashTime + ATTACK_BUTTON_FLASH_TIME + end + if rangeTimer <= 0 then + rangeTimer = TOOLTIP_UPDATE_TIME + end + end +end + +local gridCounter = 0 +function ShowGrid() + gridCounter = gridCounter + 1 + if gridCounter >= 1 then + for button in next, ButtonRegistry do + if button:IsShown() then + button:SetAlpha(1.0) + end + end + end +end + +function HideGrid() + if gridCounter > 0 then + gridCounter = gridCounter - 1 + end + if gridCounter == 0 then + for button in next, ButtonRegistry do + if button:IsShown() and not button:HasAction() and not button.config.showGrid then + button:SetAlpha(0.0) + end + end + end +end + +function UpdateGrid(self) + if self.config.showGrid then + self:SetAlpha(1.0) + elseif gridCounter == 0 and self:IsShown() and not self:HasAction() then + self:SetAlpha(0.0) + end +end + +----------------------------------------------------------- +--- KeyBound integration + +function Generic:GetBindingAction() + return self.config.keyBoundTarget or "CLICK "..self:GetName()..":LeftButton" +end + +function Generic:GetHotkey() + local name = "CLICK "..self:GetName()..":LeftButton" + local key = GetBindingKey(self.config.keyBoundTarget or name) + if not key and self.config.keyBoundTarget then + key = GetBindingKey(name) + end + if key then + return KeyBound and KeyBound:ToShortKey(key) or key + end +end + +local function getKeys(binding, keys) + keys = keys or "" + for i = 1, select("#", GetBindingKey(binding)) do + local hotKey = select(i, GetBindingKey(binding)) + if keys ~= "" then + keys = keys .. ", " + end + keys = keys .. GetBindingText(hotKey, "KEY_") + end + return keys +end + +function Generic:GetBindings() + local keys, binding + + if self.config.keyBoundTarget then + keys = getKeys(self.config.keyBoundTarget) + end + + keys = getKeys("CLICK "..self:GetName()..":LeftButton") + + return keys +end + +function Generic:SetKey(key) + if self.config.keyBoundTarget then + SetBinding(key, self.config.keyBoundTarget) + else + SetBindingClick(key, self:GetName(), "LeftButton") + end + lib.callbacks:Fire("OnKeybindingChanged", self, key) +end + +local function clearBindings(binding) + while GetBindingKey(binding) do + SetBinding(GetBindingKey(binding), nil) + end +end + +function Generic:ClearBindings() + if self.config.keyBoundTarget then + clearBindings(self.config.keyBoundTarget) + end + clearBindings("CLICK "..self:GetName()..":LeftButton") + lib.callbacks:Fire("OnKeybindingChanged", self, nil) +end + +----------------------------------------------------------- +--- button management + +function Generic:UpdateAction(force) + local type, action = self:GetAction() + if force or type ~= self._state_type or action ~= self._state_action then + -- type changed, update the metatable + if force or self._state_type ~= type then + local meta = type_meta_map[type] or type_meta_map.empty + setmetatable(self, meta) + self._state_type = type + end + self._state_action = action + Update(self) + end +end + +function Update(self) + if self:HasAction() then + ActiveButtons[self] = true + if self._state_type == "action" then + ActionButtons[self] = true + NonActionButtons[self] = nil + else + ActionButtons[self] = nil + NonActionButtons[self] = true + end + self:SetAlpha(1.0) + UpdateButtonState(self) + UpdateUsable(self) + UpdateCooldown(self) + UpdateFlash(self) + else + ActiveButtons[self] = nil + ActionButtons[self] = nil + NonActionButtons[self] = nil + if gridCounter == 0 and not self.config.showGrid then + self:SetAlpha(0.0) + end + self.cooldown:Hide() + self:SetChecked(false) + end + + -- Add a green border if button is an equipped item + if self:IsEquipped() and not self.config.hideElements.equipped then + self.Border:SetVertexColor(0, 1.0, 0, 0.35) + self.Border:Show() + else + self.Border:Hide() + end + + -- Update Action Text + if not self:IsConsumableOrStackable() then + self.Name:SetText(self:GetActionText()) + else + self.Name:SetText("") + end + + -- Update icon and hotkey + local texture = self:GetTexture() + if texture then + self.icon:SetTexture(texture) + self.icon:Show() + self.rangeTimer = - 1 + self:SetNormalTexture("Interface\\Buttons\\UI-Quickslot2") + if not self.LBFSkinned and not self.MasqueSkinned then + self.NormalTexture:SetTexCoord(0, 0, 0, 0) + end + else + self.icon:Hide() + self.cooldown:Hide() + self.rangeTimer = nil + self:SetNormalTexture("Interface\\Buttons\\UI-Quickslot") + if self.HotKey:GetText() == RANGE_INDICATOR then + self.HotKey:Hide() + else + self.HotKey:SetVertexColor(0.75, 0.75, 0.75) + end + if not self.LBFSkinned and not self.MasqueSkinned then + self.NormalTexture:SetTexCoord(-0.15, 1.15, -0.15, 1.17) + end + end + + self:UpdateLocal() + + UpdateCount(self) + + UpdateFlyout(self) + + UpdateOverlayGlow(self) + + UpdateNewAction(self) + + if GameTooltip:GetOwner() == self then + UpdateTooltip(self) + end + + -- this could've been a spec change, need to call OnStateChanged for action buttons, if present + if not InCombatLockdown() and self._state_type == "action" then + local onStateChanged = self:GetAttribute("OnStateChanged") + if onStateChanged then + self.header:SetFrameRef("updateButton", self) + self.header:Execute(([[ + local frame = self:GetFrameRef("updateButton") + control:RunFor(frame, frame:GetAttribute("OnStateChanged"), %s, %s, %s) + ]]):format(formatHelper(self:GetAttribute("state")), formatHelper(self._state_type), formatHelper(self._state_action))) + end + end + lib.callbacks:Fire("OnButtonUpdate", self) +end + +function Generic:UpdateLocal() + -- dummy function the other button types can override for special updating +end + +function UpdateButtonState(self) + if self:IsCurrentlyActive() or self:IsAutoRepeat() then + self:SetChecked(true) + else + self:SetChecked(false) + end + lib.callbacks:Fire("OnButtonState", self) +end + +function UpdateUsable(self) + -- TODO: make the colors configurable + -- TODO: allow disabling of the whole recoloring + if self.config.outOfRangeColoring == "button" and self.outOfRange then + self.icon:SetVertexColor(unpack(self.config.colors.range)) + else + local isUsable, notEnoughMana = self:IsUsable() + if isUsable then + self.icon:SetVertexColor(1.0, 1.0, 1.0) + --self.NormalTexture:SetVertexColor(1.0, 1.0, 1.0) + elseif notEnoughMana then + self.icon:SetVertexColor(unpack(self.config.colors.mana)) + --self.NormalTexture:SetVertexColor(0.5, 0.5, 1.0) + else + self.icon:SetVertexColor(0.4, 0.4, 0.4) + --self.NormalTexture:SetVertexColor(1.0, 1.0, 1.0) + end + end + lib.callbacks:Fire("OnButtonUsable", self) +end + +function UpdateCount(self) + if not self:HasAction() then + self.Count:SetText("") + return + end + if self:IsConsumableOrStackable() then + local count = self:GetCount() + if count > (self.maxDisplayCount or 9999) then + self.Count:SetText("*") + else + self.Count:SetText(count) + end + else + local charges, maxCharges, chargeStart, chargeDuration = self:GetCharges() + if charges and maxCharges and maxCharges > 0 then + self.Count:SetText(charges) + else + self.Count:SetText("") + end + end +end + +local function SetCooldownHook(cooldown, ...) + local effectiveAlpha = cooldown:GetEffectiveAlpha() + local start, duration = ... + + if start ~= 0 or duration ~= 0 then + -- update swipe alpha + cooldown.__metaLAB.SetSwipeColor(cooldown, cooldown.__SwipeR, cooldown.__SwipeG, cooldown.__SwipeB, cooldown.__SwipeA * effectiveAlpha) + + -- only draw bling and edge if alpha is over 50% + cooldown:SetDrawBling(effectiveAlpha > 0.5) + if effectiveAlpha < 0.5 then + cooldown:SetDrawEdge(false) + end + + -- ensure the swipe isn't drawn on fully faded bars + if effectiveAlpha <= 0.0 then + cooldown:SetDrawSwipe(false) + end + end + + return cooldown.__metaLAB.SetCooldown(cooldown, ...) +end + +local function SetSwipeColorHook(cooldown, r, g, b, a) + local effectiveAlpha = cooldown:GetEffectiveAlpha() + cooldown.__SwipeR, cooldown.__SwipeG, cooldown.__SwipeB, cooldown.__SwipeA = r, g, b, (a or 1) + return cooldown.__metaLAB.SetSwipeColor(cooldown, r, g, b, a * effectiveAlpha) +end + +function HookCooldown(button) + if not button.cooldown.__metaLAB then + button.cooldown.__metaLAB = getmetatable(button.cooldown).__index + button.cooldown.__SwipeR, button.cooldown.__SwipeG, button.cooldown.__SwipeB, button.cooldown.__SwipeA = 0, 0, 0, 0.8 + + button.cooldown.SetCooldown = SetCooldownHook + button.cooldown.SetSwipeColor = SetSwipeColorHook + end +end + +function OnCooldownDone(self) + self:SetScript("OnCooldownDone", nil) + UpdateCooldown(self:GetParent()) +end + +function UpdateCooldown(self) + local locStart, locDuration = self:GetLossOfControlCooldown() + local start, duration, enable, charges, maxCharges = self:GetCooldown() + + if (locStart + locDuration) > (start + duration) then + if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_LOSS_OF_CONTROL then + self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge-LoC") + self.cooldown:SetHideCountdownNumbers(true) + self.cooldown.currentCooldownType = COOLDOWN_TYPE_LOSS_OF_CONTROL + self.cooldown:SetSwipeColor(0.17, 0, 0, 0.8) + end + CooldownFrame_SetTimer(self.cooldown, locStart, locDuration, 1, nil, nil, true) + else + if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_NORMAL then + self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge") + self.cooldown:SetHideCountdownNumbers(false) + self.cooldown.currentCooldownType = COOLDOWN_TYPE_NORMAL + self.cooldown:SetSwipeColor(0, 0, 0, 0.8) + end + if locStart > 0 then + self.cooldown:SetScript("OnCooldownDone", OnCooldownDone) + end + CooldownFrame_SetTimer(self.cooldown, start, duration, enable, charges, maxCharges) + end +end + +function StartFlash(self) + self.flashing = 1 + flashTime = 0 + UpdateButtonState(self) +end + +function StopFlash(self) + self.flashing = 0 + self.Flash:Hide() + UpdateButtonState(self) +end + +function UpdateFlash(self) + if (self:IsAttack() and self:IsCurrentlyActive()) or self:IsAutoRepeat() then + StartFlash(self) + else + StopFlash(self) + end +end + +function UpdateTooltip(self) + if (GetCVar("UberTooltips") == "1") then + GameTooltip_SetDefaultAnchor(GameTooltip, self); + else + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + end + if self:SetTooltip() then + self.UpdateTooltip = UpdateTooltip + else + self.UpdateTooltip = nil + end +end + +function UpdateHotkeys(self) + local key = self:GetHotkey() + if not key or key == "" or self.config.hideElements.hotkey then + self.HotKey:SetText(RANGE_INDICATOR) + self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", 1, - 2) + self.HotKey:Hide() + else + self.HotKey:SetText(key) + self.HotKey:SetPoint("TOPLEFT", self, "TOPLEFT", - 2, - 2) + self.HotKey:Show() + end +end + +local function OverlayGlow_OnHide(self) + if self.animOut:IsPlaying() then + self.animOut:Stop() + OverlayGlowAnimOutFinished(self.animOut) + end +end + +function GetOverlayGlow() + local overlay = tremove(lib.unusedOverlayGlows); + if not overlay then + lib.numOverlays = lib.numOverlays + 1 + overlay = CreateFrame("Frame", "LAB10ActionButtonOverlay"..lib.numOverlays, UIParent, "ActionBarButtonSpellActivationAlert") + overlay.animOut:SetScript("OnFinished", OverlayGlowAnimOutFinished) + overlay:SetScript("OnHide", OverlayGlow_OnHide) + end + return overlay +end + +function ShowOverlayGlow(self) + if self.overlay then + if self.overlay.animOut:IsPlaying() then + self.overlay.animOut:Stop() + self.overlay.animIn:Play() + end + else + self.overlay = GetOverlayGlow() + local frameWidth, frameHeight = self:GetSize() + self.overlay:SetParent(self) + self.overlay:ClearAllPoints() + --Make the height/width available before the next frame: + self.overlay:SetSize(frameWidth * 1.4, frameHeight * 1.4) + self.overlay:SetPoint("TOPLEFT", self, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2) + self.overlay:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2) + self.overlay.animIn:Play() + end +end + +function HideOverlayGlow(self) + if self.overlay then + if self.overlay.animIn:IsPlaying() then + self.overlay.animIn:Stop() + end + if self:IsVisible() then + self.overlay.animOut:Play() + else + OverlayGlowAnimOutFinished(self.overlay.animOut) + end + end +end + +function OverlayGlowAnimOutFinished(animGroup) + local overlay = animGroup:GetParent() + local actionButton = overlay:GetParent() + overlay:Hide() + tinsert(lib.unusedOverlayGlows, overlay) + actionButton.overlay = nil +end + +function UpdateOverlayGlow(self) + local spellId = self:GetSpellId() + if spellId and IsSpellOverlayed(spellId) then + ShowOverlayGlow(self) + else + HideOverlayGlow(self) + end +end + +hooksecurefunc("MarkNewActionHighlight", function(action, flag) + lib.ACTION_HIGHLIGHT_MARKS[action] = flag + for button in next, ButtonRegistry do + if button._state_type == "action" and action == tonumber(button._state_action) then + UpdateNewAction(button) + end + end +end) + +function UpdateNewAction(self) + -- special handling for "New Action" markers + if self.NewActionTexture then + if self._state_type == "action" and lib.ACTION_HIGHLIGHT_MARKS[self._state_action] then + self.NewActionTexture:Show() + else + self.NewActionTexture:Hide() + end + end +end + +-- Hook UpdateFlyout so we can use the blizzy templates +hooksecurefunc("ActionButton_UpdateFlyout", function(self, ...) + if ButtonRegistry[self] then + UpdateFlyout(self) + end +end) + +function UpdateFlyout(self) + -- disabled FlyoutBorder/BorderShadow, those are not handled by LBF and look terrible + self.FlyoutBorder:Hide() + self.FlyoutBorderShadow:Hide() + if self._state_type == "action" then + -- based on ActionButton_UpdateFlyout in ActionButton.lua + local actionType = GetActionInfo(self._state_action) + if actionType == "flyout" then + -- Update border and determine arrow position + local arrowDistance + if (SpellFlyout and SpellFlyout:IsShown() and SpellFlyout:GetParent() == self) or GetMouseFocus() == self then + arrowDistance = 5 + else + arrowDistance = 2 + end + + -- Update arrow + self.FlyoutArrow:Show() + self.FlyoutArrow:ClearAllPoints() + local direction = self:GetAttribute("flyoutDirection"); + if direction == "LEFT" then + self.FlyoutArrow:SetPoint("LEFT", self, "LEFT", -arrowDistance, 0) + SetClampedTextureRotation(self.FlyoutArrow, 270) + elseif direction == "RIGHT" then + self.FlyoutArrow:SetPoint("RIGHT", self, "RIGHT", arrowDistance, 0) + SetClampedTextureRotation(self.FlyoutArrow, 90) + elseif direction == "DOWN" then + self.FlyoutArrow:SetPoint("BOTTOM", self, "BOTTOM", 0, -arrowDistance) + SetClampedTextureRotation(self.FlyoutArrow, 180) + else + self.FlyoutArrow:SetPoint("TOP", self, "TOP", 0, arrowDistance) + SetClampedTextureRotation(self.FlyoutArrow, 0) + end + + -- return here, otherwise flyout is hidden + return + end + end + self.FlyoutArrow:Hide() +end + +function UpdateRangeTimer() + rangeTimer = -1 +end + +local function GetSpellIdByName(spellName) + if not spellName then return end + local spellLink = GetSpellLink(spellName) + if spellLink then + return tonumber(spellLink:match("spell:(%d+)")) + end + return nil +end + +----------------------------------------------------------- +--- WoW API mapping +--- Generic Button +Generic.HasAction = function(self) return nil end +Generic.GetActionText = function(self) return "" end +Generic.GetTexture = function(self) return nil end +Generic.GetCharges = function(self) return nil end +Generic.GetCount = function(self) return 0 end +Generic.GetCooldown = function(self) return 0, 0, 0 end +Generic.IsAttack = function(self) return nil end +Generic.IsEquipped = function(self) return nil end +Generic.IsCurrentlyActive = function(self) return nil end +Generic.IsAutoRepeat = function(self) return nil end +Generic.IsUsable = function(self) return nil end +Generic.IsConsumableOrStackable = function(self) return nil end +Generic.IsUnitInRange = function(self, unit) return nil end +Generic.IsInRange = function(self) + local unit = self:GetAttribute("unit") + if unit == "player" then + unit = nil + end + local val = self:IsUnitInRange(unit) + -- map 1/0 to true false, since the return values are inconsistent between actions and spells + if val == 1 then val = true elseif val == 0 then val = false end + return val +end +Generic.SetTooltip = function(self) return nil end +Generic.GetSpellId = function(self) return nil end +Generic.GetLossOfControlCooldown = function(self) return 0, 0 end + +----------------------------------------------------------- +--- Action Button +Action.HasAction = function(self) return HasAction(self._state_action) end +Action.GetActionText = function(self) return GetActionText(self._state_action) end +Action.GetTexture = function(self) return GetActionTexture(self._state_action) end +Action.GetCharges = function(self) return GetActionCharges(self._state_action) end +Action.GetCount = function(self) return GetActionCount(self._state_action) end +Action.GetCooldown = function(self) return GetActionCooldown(self._state_action) end +Action.IsAttack = function(self) return IsAttackAction(self._state_action) end +Action.IsEquipped = function(self) return IsEquippedAction(self._state_action) end +Action.IsCurrentlyActive = function(self) return IsCurrentAction(self._state_action) end +Action.IsAutoRepeat = function(self) return IsAutoRepeatAction(self._state_action) end +Action.IsUsable = function(self) return IsUsableAction(self._state_action) end +Action.IsConsumableOrStackable = function(self) return IsConsumableAction(self._state_action) or IsStackableAction(self._state_action) or (not IsItemAction(self._state_action) and GetActionCount(self._state_action) > 0) end +Action.IsUnitInRange = function(self, unit) return IsActionInRange(self._state_action, unit) end +Action.SetTooltip = function(self) return GameTooltip:SetAction(self._state_action) end +Action.GetSpellId = function(self) + local actionType, id, subType = GetActionInfo(self._state_action) + if actionType == "spell" then + return id + elseif actionType == "macro" then + local _, _, spellId = GetMacroSpell(id) + return spellId + end +end +Action.GetLossOfControlCooldown = function(self) return GetActionLossOfControlCooldown(self._state_action) end + +----------------------------------------------------------- +--- Spell Button +Spell.HasAction = function(self) return true end +Spell.GetActionText = function(self) return "" end +Spell.GetTexture = function(self) return GetSpellTexture(self._state_action) end +Spell.GetCharges = function(self) return GetSpellCharges(self._state_action) end +Spell.GetCount = function(self) return GetSpellCount(self._state_action) end +Spell.GetCooldown = function(self) return GetSpellCooldown(self._state_action) end +Spell.IsAttack = function(self) return IsAttackSpell(FindSpellBookSlotBySpellID(self._state_action), "spell") end -- needs spell book id as of 4.0.1.13066 +Spell.IsEquipped = function(self) return nil end +Spell.IsCurrentlyActive = function(self) return IsCurrentSpell(self._state_action) end +Spell.IsAutoRepeat = function(self) return IsAutoRepeatSpell(FindSpellBookSlotBySpellID(self._state_action), "spell") end -- needs spell book id as of 4.0.1.13066 +Spell.IsUsable = function(self) return IsUsableSpell(self._state_action) end +Spell.IsConsumableOrStackable = function(self) return IsConsumableSpell(self._state_action) end +Spell.IsUnitInRange = function(self, unit) return IsSpellInRange(FindSpellBookSlotBySpellID(self._state_action), "spell", unit) end -- needs spell book id as of 4.0.1.13066 +Spell.SetTooltip = function(self) return GameTooltip:SetSpellByID(self._state_action) end +Spell.GetSpellId = function(self) return self._state_action end + +----------------------------------------------------------- +--- Item Button +local function getItemId(input) + return input:match("^item:(%d+)") +end + +Item.HasAction = function(self) return true end +Item.GetActionText = function(self) return "" end +Item.GetTexture = function(self) return GetItemIcon(self._state_action) end +Item.GetCharges = function(self) return nil end +Item.GetCount = function(self) return GetItemCount(self._state_action, nil, true) end +Item.GetCooldown = function(self) return GetItemCooldown(getItemId(self._state_action)) end +Item.IsAttack = function(self) return nil end +Item.IsEquipped = function(self) return IsEquippedItem(self._state_action) end +Item.IsCurrentlyActive = function(self) return IsCurrentItem(self._state_action) end +Item.IsAutoRepeat = function(self) return nil end +Item.IsUsable = function(self) return IsUsableItem(self._state_action) end +Item.IsConsumableOrStackable = function(self) return IsConsumableItem(self._state_action) end +Item.IsUnitInRange = function(self, unit) return IsItemInRange(self._state_action, unit) end +Item.SetTooltip = function(self) return GameTooltip:SetHyperlink(self._state_action) end +Item.GetSpellId = function(self) return nil end + +----------------------------------------------------------- +--- Macro Button +-- TODO: map results of GetMacroSpell/GetMacroItem to proper results +Macro.HasAction = function(self) return true end +Macro.GetActionText = function(self) return (GetMacroInfo(self._state_action)) end +Macro.GetTexture = function(self) return (select(2, GetMacroInfo(self._state_action))) end +Macro.GetCharges = function(self) return nil end +Macro.GetCount = function(self) return 0 end +Macro.GetCooldown = function(self) return 0, 0, 0 end +Macro.IsAttack = function(self) return nil end +Macro.IsEquipped = function(self) return nil end +Macro.IsCurrentlyActive = function(self) return nil end +Macro.IsAutoRepeat = function(self) return nil end +Macro.IsUsable = function(self) return nil end +Macro.IsConsumableOrStackable = function(self) return nil end +Macro.IsUnitInRange = function(self, unit) return nil end +Macro.SetTooltip = function(self) return nil end +Macro.GetSpellId = function(self) return nil end + +----------------------------------------------------------- +--- Custom Button +Custom.HasAction = function(self) return true end +Custom.GetActionText = function(self) return "" end +Custom.GetTexture = function(self) return self._state_action.texture end +Custom.GetCharges = function(self) return nil end +Custom.GetCount = function(self) return 0 end +Custom.GetCooldown = function(self) return 0, 0, 0 end +Custom.IsAttack = function(self) return nil end +Custom.IsEquipped = function(self) return nil end +Custom.IsCurrentlyActive = function(self) return nil end +Custom.IsAutoRepeat = function(self) return nil end +Custom.IsUsable = function(self) return true end +Custom.IsConsumableOrStackable = function(self) return nil end +Custom.IsUnitInRange = function(self, unit) return nil end +Custom.SetTooltip = function(self) return GameTooltip:SetText(self._state_action.tooltip) end +Custom.GetSpellId = function(self) return nil end +Custom.RunCustom = function(self, unit, button) return self._state_action.func(self, unit, button) end + +----------------------------------------------------------- +--- Update old Buttons +if oldversion and next(lib.buttonRegistry) then + InitializeEventHandler() + for button in next, lib.buttonRegistry do + -- this refreshes the metatable on the button + Generic.UpdateAction(button, true) + SetupSecureSnippets(button) + if oldversion < 12 then + WrapOnClick(button) + end + if oldversion < 23 then + if button.overlay then + button.overlay:Hide() + ActionButton_HideOverlayGlow(button) + button.overlay = nil + UpdateOverlayGlow(button) + end + end + end +end diff --git a/Jamba/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/Jamba/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index 8dbd134..820aea8 100644 --- a/Jamba/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/Jamba/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1,10 +1,10 @@ --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. -- @class file -- @name AceConfigDialog-3.0 --- @release $Id: AceConfigDialog-3.0.lua 1113 2014-09-11 20:18:16Z nevcairiel $ +-- @release $Id: AceConfigDialog-3.0.lua 1126 2014-11-10 06:38:01Z nevcairiel $ local LibStub = LibStub -local MAJOR, MINOR = "AceConfigDialog-3.0", 59 +local MAJOR, MINOR = "AceConfigDialog-3.0", 60 local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigDialog then return end @@ -542,16 +542,16 @@ local function OptionOnMouseOver(widget, event) if descStyle and descStyle ~= "tooltip" then return end - GameTooltip:SetText(name, 1, .82, 0, 1) + GameTooltip:SetText(name, 1, .82, 0, true) if opt.type == "multiselect" then - GameTooltip:AddLine(user.text,0.5, 0.5, 0.8, 1) + GameTooltip:AddLine(user.text, 0.5, 0.5, 0.8, true) end if type(desc) == "string" then - GameTooltip:AddLine(desc, 1, 1, 1, 1) + GameTooltip:AddLine(desc, 1, 1, 1, true) end if type(usage) == "string" then - GameTooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1) + GameTooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true) end GameTooltip:Show() @@ -1448,10 +1448,10 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button) GameTooltip:SetPoint("LEFT",button,"RIGHT") end - GameTooltip:SetText(name, 1, .82, 0, 1) + GameTooltip:SetText(name, 1, .82, 0, true) if type(desc) == "string" then - GameTooltip:AddLine(desc, 1, 1, 1, 1) + GameTooltip:AddLine(desc, 1, 1, 1, true) end GameTooltip:Show() diff --git a/Jamba/Libs/AceDB-3.0/AceDB-3.0.lua b/Jamba/Libs/AceDB-3.0/AceDB-3.0.lua index 79f4b39..a17c6f1 100644 --- a/Jamba/Libs/AceDB-3.0/AceDB-3.0.lua +++ b/Jamba/Libs/AceDB-3.0/AceDB-3.0.lua @@ -39,8 +39,8 @@ -- end -- @class file -- @name AceDB-3.0.lua --- @release $Id: AceDB-3.0.lua 1115 2014-09-21 11:52:35Z kaelten $ -local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 25 +-- @release $Id: AceDB-3.0.lua 1124 2014-10-27 21:00:07Z funkydude $ +local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 26 local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) if not AceDB then return end -- No upgrade needed @@ -263,7 +263,7 @@ local factionrealmKey = factionKey .. " - " .. realmKey local localeKey = GetLocale():lower() local regionTable = { "US", "KR", "EU", "TW", "CN" } -local regionKey = _G["GetCurrentRegion"] and regionTable[GetCurrentRegion()] or string.sub(GetCVar("realmList"), 1, 2):upper() +local regionKey = regionTable[GetCurrentRegion()] local factionrealmregionKey = factionrealmKey .. " - " .. regionKey -- Actual database initialization function @@ -303,7 +303,7 @@ local function initdb(sv, defaults, defaultProfile, olddb, parent) ["factionrealm"] = factionrealmKey, ["factionrealmregion"] = factionrealmregionKey, ["profile"] = profileKey, - ["locale"] = localeKey, + ["locale"] = localeKey, ["global"] = true, ["profiles"] = true, } diff --git a/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc index 2cc3cec..87824a8 100644 --- a/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc +++ b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc @@ -1,24 +1,7 @@ -## Interface: 50001 -## X-Curse-Packaged-Version: r46 -## X-Curse-Project-Name: AceGUI-3.0-SharedMediaWidgets -## X-Curse-Project-ID: ace-gui-3-0-shared-media-widgets -## X-Curse-Repository-ID: wow/ace-gui-3-0-shared-media-widgets/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline +## Interface: 50300 ## Title: Lib: AceGUI-3.0-SharedMediaWidgets ## Notes: Enables AceGUI-3.0 widgets for the 5 basic SharedMedia-3.0 types -## Version: 4.0.0 ## Author: Yssaril ## OptionalDeps: Ace3, LibSharedMedia-3.0, Libstub, CallbackHandler-1.0 ## X-Category: Library diff --git a/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 19e5675..0c8701b 100644 --- a/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -3,7 +3,7 @@ local DataVersion = 9001 -- dev version always overwrites everything else :) --@end-debug@]===] --@non-debug@ -local DataVersion = 46 +local DataVersion = 47 --@end-non-debug@ local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) diff --git a/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt new file mode 100644 index 0000000..2163c0d --- /dev/null +++ b/Jamba/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt @@ -0,0 +1,19 @@ +------------------------------------------------------------------------ +r48 | funkydude | 2013-05-26 11:10:27 +0000 (Sun, 26 May 2013) | 1 line +Changed paths: + A /tags/r48-release (from /trunk:47) + +Tagging as r48-release +------------------------------------------------------------------------ +r47 | funkydude | 2013-05-26 11:09:17 +0000 (Sun, 26 May 2013) | 1 line +Changed paths: + M /trunk/AceGUI-3.0-SharedMediaWidgets.toc + +bump toc +------------------------------------------------------------------------ +r46 | Phanx | 2013-01-02 06:47:48 +0000 (Wed, 02 Jan 2013) | 1 line +Changed paths: + M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua + +Fixed an anchoring issue that could prevent interaction with menu buttons. +------------------------------------------------------------------------ diff --git a/Jamba/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Jamba/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 6fbe066..085449b 100644 --- a/Jamba/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Jamba/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -2,7 +2,7 @@ TreeGroup Container Container that uses a tree control to switch between groups. -------------------------------------------------------------------------------]] -local Type, Version = "TreeGroup", 36 +local Type, Version = "TreeGroup", 38 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -212,7 +212,7 @@ local function Button_OnEnter(frame) if self.enabletooltips then GameTooltip:SetOwner(frame, "ANCHOR_NONE") GameTooltip:SetPoint("LEFT",frame,"RIGHT") - GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1) + GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true) GameTooltip:Show() end @@ -335,6 +335,8 @@ local methods = { button.toggle.button = button button.toggle:SetScript("OnClick",Expand_OnClick) + button.text:SetHeight(14) -- Prevents text wrapping + return button end, diff --git a/Jamba/Libs/AceTab-3.0/AceConfigTab-3.0.lua b/Jamba/Libs/AceTab-3.0/AceConfigTab-3.0.lua deleted file mode 100644 index cf3403c..0000000 --- a/Jamba/Libs/AceTab-3.0/AceConfigTab-3.0.lua +++ /dev/null @@ -1,105 +0,0 @@ ---- AceConfigTab-3.0 provides support for tab-completion to AceConfig tables. --- Note: This library is not yet finalized. --- @class file --- @name AceConfigTab-3.0 --- @release $Id: AceConfigTab-3.0.lua 769 2009-04-04 11:05:08Z nevcairiel $ - -local MAJOR, MINOR = "AceConfigTab-3.0", 1 -local lib = LibStub:NewLibrary(MAJOR, MINOR) - -if not lib then return end - -local ac = LibStub("AceConsole-3.0") - -local function printf(...) - DEFAULT_CHAT_FRAME:AddMessage(string.format(...)) -end - --- getChildren(opt, ...) --- --- Retrieve the next valid group args in an AceConfig table. --- --- opt - AceConfig options table --- ... - args following the slash command --- --- opt will need to be determined by the slash-command --- The args will be obtained using AceConsole:GetArgs() or something similar on the remainder of the line. --- --- Returns arg1, arg2, ... -local function getLevel(opt, ...) - -- Walk down the options tree to the last arg in the commandline, or return if it does not follow the tree. - local path = "" - local lastChild - for i = 1, select('#', ...) do - local arg = select(i, ...) - if not arg or type(arg) == 'number' then break end - if opt.plugins then - for k in pairs(opt.plugins) do - if string.lower(k) == string.lower(arg) then - opt = opt.plugins[k] - path = path..arg.." " - lastChild = arg - break - end - end - elseif opt.args then - for k in pairs(opt.args) do - if string.lower(k) == string.lower(arg) then - opt = opt.args[k] - path = path..arg.." " - lastChild = arg - break - end - end - else - break - end - end - return opt, path -end - -local function getChildren(opt, ...) - local lastChild, path - opt, path, lastChild = getLevel(opt, ...) - local args = {} - for _, field in ipairs({"args", "plugins"}) do - if type(opt[field]) == 'table' then - for k in pairs(opt[field]) do - if opt[field].type ~= 'header' then - table.insert(args, k) - end - end - end - end - return args, path -end - ---LibStub("AceConfig-3.0"):RegisterOptionsTable("ag_UnitFrames", aUF.Options.table) -local function createWordlist(t, cmdline, pos) - local cmd = string.match(cmdline, "(/[^ \t\n]+)") - local argslist = string.sub(cmdline, pos, this:GetCursorPosition()) - local opt -- TODO: figure out options table using cmd - opt = LibStub("AceConfigRegistry-3.0"):GetOptionsTable("ag_UnitFrames", "cmd", "AceTab-3.0") -- hardcoded temporarily for testing - if not opt then return end - local args, path = getChildren(opt, ac:GetArgs(argslist, #argslist/2)) -- largest # of args representable by a string of length #argslist, since they must be separated by spaces - for _, v in ipairs(args) do - table.insert(t, path..v) - end -end - -local function usage(t, matches, _, cmdline) - local cmd = string.match(cmdline, "(/[^ \t\n]+)") - local argslist = string.sub(cmdline, #cmd, this:GetCursorPosition()) - local opt -- TODO: figure out options table using cmd - opt = LibStub("AceConfigRegistry-3.0"):GetOptionsTable("ag_UnitFrames")("cmd", "AceTab-3.0") -- hardcoded temporarily for testing - if not opt then return end - local level = getLevel(opt, ac:GetArgs(argslist, #argslist/2)) -- largest # of args representable by a string of length #argslist, since they must be separated by spaces - local option - for _, m in pairs(matches) do - local tail = string.match(m, "([^ \t\n]+)$") - option = level.plugins and level.plugins[tail] or level.args and level.args[tail] - printf("%s - %s", tail, option.desc) - end -end - -LibStub("AceTab-3.0"):RegisterTabCompletion("aguftest", "%/%w+ ", createWordlist, usage) diff --git a/Jamba/Libs/Changelog-Ace3-r1130.txt b/Jamba/Libs/Changelog-Ace3-r1130.txt new file mode 100644 index 0000000..b2c12d6 --- /dev/null +++ b/Jamba/Libs/Changelog-Ace3-r1130.txt @@ -0,0 +1,27 @@ +------------------------------------------------------------------------ +r1130 | funkydude | 2015-03-11 14:02:46 +0000 (Wed, 11 Mar 2015) | 1 line +Changed paths: + M /trunk/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua + +AceGUIContainer-TreeGroup: Use :SetHeight for preventing word wrap. Same fix different method. +------------------------------------------------------------------------ +r1129 | nevcairiel | 2015-03-11 10:36:23 +0000 (Wed, 11 Mar 2015) | 1 line +Changed paths: + M /trunk/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua + +AceGUI-3.0: TreeGroup: Prevent word wrap in the tree elements +------------------------------------------------------------------------ +r1127 | nevcairiel | 2015-02-24 14:26:09 +0000 (Tue, 24 Feb 2015) | 1 line +Changed paths: + M /trunk/Ace3.toc + M /trunk/changelog.txt + +Update changelog, bump TOC +------------------------------------------------------------------------ +r1126 | nevcairiel | 2014-11-10 06:38:01 +0000 (Mon, 10 Nov 2014) | 1 line +Changed paths: + M /trunk/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua + M /trunk/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua + +Use true/false in GameTooltip:SetText/AddLine instead of 1/0 +------------------------------------------------------------------------ diff --git a/Jamba/Libs/LibBabble-Class-3.0/LibBabble-Class-3.0.toc b/Jamba/Libs/LibBabble-Class-3.0/LibBabble-Class-3.0.toc index f082c8f..00026f5 100644 --- a/Jamba/Libs/LibBabble-Class-3.0/LibBabble-Class-3.0.toc +++ b/Jamba/Libs/LibBabble-Class-3.0/LibBabble-Class-3.0.toc @@ -6,25 +6,6 @@ ## Notes-frFR: Une bibliothèque d'aide à la localisation. ## Notes-esES: Una biblioteca para ayudar con las localizaciones. ## Author: ckknight -## X-eMail: ckknight@gmail.com -## X-Category: Library -## X-License: MIT -## X-Curse-Packaged-Version: r56 -## X-Curse-Project-Name: LibBabble-Class-3.0 -## X-Curse-Project-ID: libbabble-class-3-0 -## X-Curse-Repository-ID: wow/libbabble-class-3-0/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub\LibStub.lua lib.xml diff --git a/Jamba/Libs/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc b/Jamba/Libs/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc index 88324ac..2f4ecbd 100644 --- a/Jamba/Libs/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc +++ b/Jamba/Libs/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc @@ -4,25 +4,6 @@ ## Notes: A library to help with localization of item types and subtypes. ## Notes-esES: Una libreria para ayudar con la traduccion de tipos y subtipos de objetos. ## Author: ckknight -## X-eMail: ckknight@gmail.com -## X-Category: Library -## X-License: MIT -## X-Curse-Packaged-Version: 5.2-release1 -## X-Curse-Project-Name: LibBabble-Inventory-3.0 -## X-Curse-Project-ID: libbabble-inventory-3-0 -## X-Curse-Repository-ID: wow/libbabble-inventory-3-0/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub\LibStub.lua lib.xml diff --git a/Jamba/Libs/LibBabble-Inventory-3.0/LibStub/LibStub.toc b/Jamba/Libs/LibBabble-Inventory-3.0/LibStub/LibStub.toc index ecddf17..0985aab 100644 --- a/Jamba/Libs/LibBabble-Inventory-3.0/LibStub/LibStub.toc +++ b/Jamba/Libs/LibBabble-Inventory-3.0/LibStub/LibStub.toc @@ -2,24 +2,5 @@ ## Title: Lib: LibStub ## Notes: Universal Library Stub ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel -## X-Website: http://www.wowace.com/addons/libstub/ -## X-Category: Library -## X-License: Public Domain -## X-Curse-Packaged-Version: 1.0.3-50001 -## X-Curse-Project-Name: LibStub -## X-Curse-Project-ID: libstub -## X-Curse-Repository-ID: wow/libstub/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub.lua diff --git a/Jamba/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua b/Jamba/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua index cfaa768..55aa35f 100644 --- a/Jamba/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua +++ b/Jamba/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua @@ -1,4 +1,4 @@ -local MAJOR,MINOR = "LibBagUtils-1.0", tonumber(("$Revision: 27 $"):match("%d+")) +local MAJOR,MINOR = "LibBagUtils-1.0", tonumber(("$Revision: 35 $"):match("%d+")) local lib = LibStub:NewLibrary(MAJOR,MINOR) -- @@ -40,6 +40,7 @@ local BANK_CONTAINER = BANK_CONTAINER -- local KEYRING_CONTAINER = KEYRING_CONTAINER local NUM_BANKBAGSLOTS = NUM_BANKBAGSLOTS local NUM_BAG_SLOTS = NUM_BAG_SLOTS +local REAGENTBANK_CONTAINER = REAGENTBANK_CONTAINER -- no longer used: lib.frame = lib.frame or CreateFrame("frame", string.gsub(MAJOR,"[^%w]", "_").."_Frame") if lib.frame then @@ -221,7 +222,7 @@ end ----------------------------------------------------------------------- -- API :IterateBags("which", itemFamily) -- --- which - string: "BAGS", "BANK", "BAGSBANK" +-- which - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- itemFamily - number: bitmasked itemFamily; will accept combinations -- 0: will only iterate regular bags -- nil: will iterate all bags (including possible future special bags!) @@ -233,6 +234,7 @@ local bags = { BAGS = {}, BANK = {}, BAGSBANK = {}, + REAGENTBANK = {}, } -- Carried bags @@ -256,6 +258,9 @@ for k,v in pairs(bags.BANK) do bags.BAGSBANK[k]=v end +-- Reagent Bank +bags.REAGENTBANK[REAGENTBANK_CONTAINER] = REAGENTBANK_CONTAINER + local function iterbags(tab, cur) cur = next(tab, cur) while cur do @@ -284,6 +289,8 @@ function lib:IterateBags(which, itemFamily) error([[Usage: LibBagUtils:IterateBags("which"[, itemFamily])]], 2) end + if which == "REAGENTBANK" and not IsReagentBankUnlocked() then return function() end, baglist end + if not itemFamily then return iterbags, baglist elseif itemFamily==0 then @@ -306,7 +313,7 @@ end ----------------------------------------------------------------------- -- API: CountSlots(which, itemFamily) -- --- which - string: "BAGS", "BANK", "BAGSBANK" +-- which - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- itemFamily - bitmasked itemFamily; see :IterateBags -- -- Returns: numFreeSlots, numTotalSlots @@ -318,9 +325,9 @@ function lib:CountSlots(which, itemFamily) error([[Usage: LibBagUtils:IterateBags("which"[, itemFamily])]], 2) end - local free,tot=0,0 - + if which == "REAGENTBANK" and not IsReagentBankUnlocked() then return free,tot end + if not itemFamily then for bag in pairs(baglist) do free = free + myGetContainerNumFreeSlots(bag) @@ -354,15 +361,26 @@ end -- -- Returns true if the given bag is a bank bag -function lib:IsBank(bag) +function lib:IsBank(bag, incReagentBank) return bag==BANK_CONTAINER or - (bag>=NUM_BAG_SLOTS+1 and bag<=NUM_BAG_SLOTS+NUM_BANKBAGSLOTS) + (bag>=NUM_BAG_SLOTS+1 and bag<=NUM_BAG_SLOTS+NUM_BANKBAGSLOTS) or (incReagentBank and lib:IsReagentBank(bag)) +end + +----------------------------------------------------------------------- +-- API :IsReagentBank(bag) +-- +-- bag - number: bag number +-- +-- Returns true if the given bag is the reagent bank "bag" + +function lib:IsReagentBank(bag) + return IsReagentBankUnlocked() and (bag==REAGENTBANK_CONTAINER and true or nil) or nil end ----------------------------------------------------------------------- -- API :Iterate("which"[, "lookingfor"]) -- --- which - string: "BAGS", "BANK", "BAGSBANK" +-- which - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- lookingfor - OPTIONAL: itemLink, itemName, itemString or itemId(number) -- -- Returns an iterator that can be used in a for loop, e.g.: @@ -370,6 +388,7 @@ end -- for bag,slot,link in LBU:Iterate("BAGSBANK", 29434) do -- find all badges of justice function lib:Iterate(which, lookingfor) + if which == "REAGENTBANK" and not IsReagentBankUnlocked() then return function() end end local baglist=bags[which] if not baglist then @@ -408,13 +427,15 @@ end ----------------------------------------------------------------------- -- API :Find("where", "lookingfor", findLocked]) -- --- where - string: "BAGS", "BANK", "BAGSBANK" +-- where - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- lookingfor - itemLink, itemName, itemString or itemId(number) -- findLocked - OPTIONAL: if true, will also return locked slots -- -- Returns: bag,slot,link or nil on failure function lib:Find(where,lookingfor,findLocked) + if where == "REAGENTBANK" and not IsReagentBankUnlocked() then return nil end + for bag,slot,link in lib:Iterate(where,lookingfor) do local _, itemCount, locked, _, _ = GetContainerItemInfo(bag,slot) if findLocked or not locked then @@ -427,13 +448,15 @@ end ----------------------------------------------------------------------- -- API :FindSmallestStack("where", "lookingfor"[, findLocked]) -- --- where - string: "BAGS", "BANK", "BAGSBANK" +-- where - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- lookingfor - itemLink, itemName, itemString or itemId(number) -- findLocked - OPTIONAL: if true, will also return locked slots -- -- Returns: bag,slot,size or nil on failure function lib:FindSmallestStack(where,lookingfor,findLocked) + if where == "REAGENTBANK" and not IsReagentBankUnlocked() then return nil end + local smallest=9e9 local smbag,smslot for bag,slot in lib:Iterate(where,lookingfor) do @@ -456,14 +479,17 @@ end -- Put the item currently held by the cursor in the most suitable bag -- (considering specialty bags, already-existing stacks..) -- --- where - string: "BAGS", "BANK", "BAGSBANK" +-- where - string: "BAGS", "BANK", "BAGSBANK", "REAGENTBANK" -- count - OPTIONAL: number: if given, PutItem() will attempt to stack the item on top of another suitable stack. This is not possible without knowing the count. -- dontClearOnFail - OPTIONAL: boolean: If the put operation fails due to no room, do NOT clear the cursor. (Note that some other wow client errors WILL clear the cursor) -- -- Returns: bag,slot or false for out-of-room -- 0,0 will be returned if the function is called without an item in the cursor +-- nil when which is REAGENTBANK and the ReagentBank has not been unlocked local function putinbag(destbag) + if where == "REAGENTBANK" and not IsReagentBankUnlocked() then return nil end + for slot=1,GetContainerNumSlots(destbag) do if (not GetContainerItemInfo(destbag,slot)) and (not isLocked(destbag,slot)) then -- empty! PickupContainerItem(destbag,slot) @@ -477,6 +503,8 @@ local function putinbag(destbag) end function lib:PutItem(where, count, dontClearOnFail) + if where == "REAGENTBANK" and not IsReagentBankUnlocked() then return nil end + local cursorType,itemId,itemLink = GetCursorInfo() if cursorType~="item" then geterrorhandler()(MAJOR..": PutItem(): There was no item in the cursor.") diff --git a/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua b/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua new file mode 100644 index 0000000..b587030 --- /dev/null +++ b/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.lua @@ -0,0 +1,242 @@ +--[[ +Copyright (c) 2015, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com> + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the developer nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +]] +local MAJOR_VERSION = "LibButtonGlow-1.0" +local MINOR_VERSION = 4 + +if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end +local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) +if not lib then return end + +local Masque = LibStub("Masque", true) + +lib.unusedOverlays = lib.unusedOverlays or {} +lib.numOverlays = lib.numOverlays or 0 + +local tinsert, tremove, tostring = table.insert, table.remove, tostring + +local function OverlayGlowAnimOutFinished(animGroup) + local overlay = animGroup:GetParent() + local frame = overlay:GetParent() + overlay:Hide() + tinsert(lib.unusedOverlays, overlay) + frame.__LBGoverlay = nil +end + +local function OverlayGlow_OnHide(self) + if self.animOut:IsPlaying() then + self.animOut:Stop() + OverlayGlowAnimOutFinished(self.animOut) + end +end + +local function CreateScaleAnim(group, target, order, duration, x, y, delay) + local scale = group:CreateAnimation("Scale") + scale:SetTarget(target:GetName()) + scale:SetOrder(order) + scale:SetDuration(duration) + scale:SetScale(x, y) + + if delay then + scale:SetStartDelay(delay) + end +end + +local function CreateAlphaAnim(group, target, order, duration, change, delay) + local alpha = group:CreateAnimation("Alpha") + alpha:SetTarget(target:GetName()) + alpha:SetOrder(order) + alpha:SetDuration(duration) + alpha:SetChange(change) + + if delay then + alpha:SetStartDelay(delay) + end +end + +local function AnimIn_OnPlay(group) + local frame = group:GetParent() + local frameWidth, frameHeight = frame:GetSize() + frame.spark:SetSize(frameWidth, frameHeight) + frame.spark:SetAlpha(0.3) + frame.innerGlow:SetSize(frameWidth / 2, frameHeight / 2) + frame.innerGlow:SetAlpha(1.0) + frame.innerGlowOver:SetAlpha(1.0) + frame.outerGlow:SetSize(frameWidth * 2, frameHeight * 2) + frame.outerGlow:SetAlpha(1.0) + frame.outerGlowOver:SetAlpha(1.0) + frame.ants:SetSize(frameWidth * 0.85, frameHeight * 0.85) + frame.ants:SetAlpha(0) + frame:Show() +end + +local function AnimIn_OnFinished(group) + local frame = group:GetParent() + local frameWidth, frameHeight = frame:GetSize() + frame.spark:SetAlpha(0) + frame.innerGlow:SetAlpha(0) + frame.innerGlow:SetSize(frameWidth, frameHeight) + frame.innerGlowOver:SetAlpha(0.0) + frame.outerGlow:SetSize(frameWidth, frameHeight) + frame.outerGlowOver:SetAlpha(0.0) + frame.outerGlowOver:SetSize(frameWidth, frameHeight) + frame.ants:SetAlpha(1.0) +end + +local function CreateOverlayGlow() + lib.numOverlays = lib.numOverlays + 1 + + -- create frame and textures + local name = "ButtonGlowOverlay" .. tostring(lib.numOverlays) + local overlay = CreateFrame("Frame", name, UIParent) + + -- spark + overlay.spark = overlay:CreateTexture(name .. "Spark", "BACKGROUND") + overlay.spark:SetPoint("CENTER") + overlay.spark:SetAlpha(0) + overlay.spark:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) + overlay.spark:SetTexCoord(0.00781250, 0.61718750, 0.00390625, 0.26953125) + + -- inner glow + overlay.innerGlow = overlay:CreateTexture(name .. "InnerGlow", "ARTWORK") + overlay.innerGlow:SetPoint("CENTER") + overlay.innerGlow:SetAlpha(0) + overlay.innerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) + overlay.innerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375) + + -- inner glow over + overlay.innerGlowOver = overlay:CreateTexture(name .. "InnerGlowOver", "ARTWORK") + overlay.innerGlowOver:SetPoint("TOPLEFT", overlay.innerGlow, "TOPLEFT") + overlay.innerGlowOver:SetPoint("BOTTOMRIGHT", overlay.innerGlow, "BOTTOMRIGHT") + overlay.innerGlowOver:SetAlpha(0) + overlay.innerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) + overlay.innerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625) + + -- outer glow + overlay.outerGlow = overlay:CreateTexture(name .. "OuterGlow", "ARTWORK") + overlay.outerGlow:SetPoint("CENTER") + overlay.outerGlow:SetAlpha(0) + overlay.outerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) + overlay.outerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375) + + -- outer glow over + overlay.outerGlowOver = overlay:CreateTexture(name .. "OuterGlowOver", "ARTWORK") + overlay.outerGlowOver:SetPoint("TOPLEFT", overlay.outerGlow, "TOPLEFT") + overlay.outerGlowOver:SetPoint("BOTTOMRIGHT", overlay.outerGlow, "BOTTOMRIGHT") + overlay.outerGlowOver:SetAlpha(0) + overlay.outerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) + overlay.outerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625) + + -- ants + overlay.ants = overlay:CreateTexture(name .. "Ants", "OVERLAY") + overlay.ants:SetPoint("CENTER") + overlay.ants:SetAlpha(0) + overlay.ants:SetTexture([[Interface\SpellActivationOverlay\IconAlertAnts]]) + + -- setup antimations + overlay.animIn = overlay:CreateAnimationGroup() + CreateScaleAnim(overlay.animIn, overlay.spark, 1, 0.2, 1.5, 1.5) + CreateAlphaAnim(overlay.animIn, overlay.spark, 1, 0.2, 1) + CreateScaleAnim(overlay.animIn, overlay.innerGlow, 1, 0.3, 2, 2) + CreateScaleAnim(overlay.animIn, overlay.innerGlowOver, 1, 0.3, 2, 2) + CreateAlphaAnim(overlay.animIn, overlay.innerGlowOver, 1, 0.3, -1) + CreateScaleAnim(overlay.animIn, overlay.outerGlow, 1, 0.3, 0.5, 0.5) + CreateScaleAnim(overlay.animIn, overlay.outerGlowOver, 1, 0.3, 0.5, 0.5) + CreateAlphaAnim(overlay.animIn, overlay.outerGlowOver, 1, 0.3, -1) + CreateScaleAnim(overlay.animIn, overlay.spark, 1, 0.2, 2/3, 2/3, 0.2) + CreateAlphaAnim(overlay.animIn, overlay.spark, 1, 0.2, -1, 0.2) + CreateAlphaAnim(overlay.animIn, overlay.innerGlow, 1, 0.2, -1, 0.3) + CreateAlphaAnim(overlay.animIn, overlay.ants, 1, 0.2, 1, 0.3) + overlay.animIn:SetScript("OnPlay", AnimIn_OnPlay) + overlay.animIn:SetScript("OnFinished", AnimIn_OnFinished) + + overlay.animOut = overlay:CreateAnimationGroup() + CreateAlphaAnim(overlay.animOut, overlay.outerGlowOver, 1, 0.2, 1) + CreateAlphaAnim(overlay.animOut, overlay.ants, 1, 0.2, -1) + CreateAlphaAnim(overlay.animOut, overlay.outerGlowOver, 2, 0.2, -1) + CreateAlphaAnim(overlay.animOut, overlay.outerGlow, 2, 0.2, -1) + overlay.animOut:SetScript("OnFinished", OverlayGlowAnimOutFinished) + + -- scripts + overlay:SetScript("OnUpdate", ActionButton_OverlayGlowOnUpdate) + overlay:SetScript("OnHide", OverlayGlow_OnHide) + + overlay.__LBGVersion = MINOR_VERSION + + return overlay +end + +local function GetOverlayGlow() + local overlay = tremove(lib.unusedOverlays) + if not overlay then + overlay = CreateOverlayGlow() + end + return overlay +end + +function lib.ShowOverlayGlow(frame) + if frame.__LBGoverlay then + if frame.__LBGoverlay.animOut:IsPlaying() then + frame.__LBGoverlay.animOut:Stop() + frame.__LBGoverlay.animIn:Play() + end + else + local overlay = GetOverlayGlow() + local frameWidth, frameHeight = frame:GetSize() + overlay:SetParent(frame) + overlay:ClearAllPoints() + --Make the height/width available before the next frame: + overlay:SetSize(frameWidth * 1.4, frameHeight * 1.4) + overlay:SetPoint("TOPLEFT", frame, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2) + overlay:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2) + overlay.animIn:Play() + frame.__LBGoverlay = overlay + + if Masque and Masque.UpdateSpellAlert and (not frame.overlay or not issecurevariable(frame, "overlay")) then + local old_overlay = frame.overlay + frame.overlay = overlay + Masque:UpdateSpellAlert(frame) + + frame.overlay = old_overlay + end + end +end + +function lib.HideOverlayGlow(frame) + if frame.__LBGoverlay then + if frame.__LBGoverlay.animIn:IsPlaying() then + frame.__LBGoverlay.animIn:Stop() + end + if frame:IsVisible() then + frame.__LBGoverlay.animOut:Play() + else + OverlayGlowAnimOutFinished(frame.__LBGoverlay.animOut) + end + end +end diff --git a/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.toc b/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.toc new file mode 100644 index 0000000..013a034 --- /dev/null +++ b/Jamba/Libs/LibButtonGlow-1.0/LibButtonGlow-1.0.toc @@ -0,0 +1,18 @@ +## Interface: 60100 +## Title: Lib: ButtonGlow-1.0 +## Notes: Replacement for ActionButton_Show/HideOverlayGlow APIs +## Author: Nevcairiel +## X-eMail: h.leppkes@gmail.com +## X-Category: Library +## X-License: BSD +## X-Website: http://www.wowace.com/addons/libbuttonglow-1-0/ +## Version: 1.2.1 +## OptionalDeps: Masque +## X-Curse-Packaged-Version: 1.2.1 +## X-Curse-Project-Name: LibButtonGlow-1.0 +## X-Curse-Project-ID: libbuttonglow-1-0 +## X-Curse-Repository-ID: wow/libbuttonglow-1-0/mainline + +LibStub\LibStub.lua + +LibButtonGlow-1.0.lua diff --git a/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.lua b/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.lua new file mode 100644 index 0000000..0a41ac0 --- /dev/null +++ b/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.lua @@ -0,0 +1,30 @@ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info +-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke +local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! +local LibStub = _G[LIBSTUB_MAJOR] + +if not LibStub or LibStub.minor < LIBSTUB_MINOR then + LibStub = LibStub or {libs = {}, minors = {} } + _G[LIBSTUB_MAJOR] = LibStub + LibStub.minor = LIBSTUB_MINOR + + function LibStub:NewLibrary(major, minor) + assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") + minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") + + local oldminor = self.minors[major] + if oldminor and oldminor >= minor then return nil end + self.minors[major], self.libs[major] = minor, self.libs[major] or {} + return self.libs[major], oldminor + end + + function LibStub:GetLibrary(major, silent) + if not self.libs[major] and not silent then + error(("Cannot find a library instance of %q."):format(tostring(major)), 2) + end + return self.libs[major], self.minors[major] + end + + function LibStub:IterateLibraries() return pairs(self.libs) end + setmetatable(LibStub, { __call = LibStub.GetLibrary }) +end diff --git a/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.toc b/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.toc new file mode 100644 index 0000000..17cf732 --- /dev/null +++ b/Jamba/Libs/LibButtonGlow-1.0/LibStub/LibStub.toc @@ -0,0 +1,13 @@ +## Interface: 20400 +## Title: Lib: LibStub +## Notes: Universal Library Stub +## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel +## X-Website: http://jira.wowace.com/browse/LS +## X-Category: Library +## X-License: Public Domain +## X-Curse-Packaged-Version: 1.0 +## X-Curse-Project-Name: LibStub +## X-Curse-Project-ID: libstub +## X-Curse-Repository-ID: wow/libstub/mainline + +LibStub.lua diff --git a/Jamba/Libs/LibDeformat-3.0/LibDeformat-3.0.toc b/Jamba/Libs/LibDeformat-3.0/LibDeformat-3.0.toc index 20ab1e0..af0d1b1 100644 --- a/Jamba/Libs/LibDeformat-3.0/LibDeformat-3.0.toc +++ b/Jamba/Libs/LibDeformat-3.0/LibDeformat-3.0.toc @@ -6,22 +6,6 @@ ## X-Category: Library ## X-License: MIT ## LoadOnDemand: 1 -## X-Curse-Packaged-Version: v1 -## X-Curse-Project-Name: LibDeformat-3.0 -## X-Curse-Project-ID: libdeformat-3-0 -## X-Curse-Repository-ID: wow/libdeformat-3-0/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub\LibStub.lua lib.xml diff --git a/Jamba/Libs/LibGratuity-3.0/Changelog-LibGratuity-3.0-r48.txt b/Jamba/Libs/LibGratuity-3.0/Changelog-LibGratuity-3.0-r48.txt new file mode 100644 index 0000000..eb1467e --- /dev/null +++ b/Jamba/Libs/LibGratuity-3.0/Changelog-LibGratuity-3.0-r48.txt @@ -0,0 +1,13 @@ +------------------------------------------------------------------------ +r48 | arpharazon | 2014-06-11 06:15:27 +0000 (Wed, 11 Jun 2014) | 1 line +Changed paths: + M /trunk/LibGratuity-3.0.toc + +TOC updated for 5.4 +------------------------------------------------------------------------ +r47 | arpharazon | 2013-05-24 02:13:14 +0000 (Fri, 24 May 2013) | 1 line +Changed paths: + M /trunk/LibGratuity-3.0.toc + +TOC updated for 5.3 +------------------------------------------------------------------------ diff --git a/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.lua b/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.lua index 9a39325..af24c18 100644 --- a/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.lua +++ b/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.lua @@ -93,7 +93,7 @@ function lib:Find(txt, startln, endln, ignoreleft, ignoreright, exact) end; assert(type(txt) == "string" or type(txt) == "number") local t1, t2 = type(startln or 1), type(self:NumLines(endln)) - if (t1 ~= "number" or t2 ~= "number") then print(t1, t2, (startln or 1),self:NumLines(endln)) end + if (t1 ~= "number" or t2 ~= "number" ) then print(t1, t2, (startln or 1),self:NumLines(endln)) end for i=(startln or 1),self:NumLines(endln) do if not ignoreleft and self.vars.Llines[i] then local txtl = self.vars.Llines[i]:GetText() @@ -111,10 +111,10 @@ end -- Calls Find many times. -- Args are passed directly to Find, t1-t10 replace the txt arg -- Returns Find results for the first match found, if any -function lib:MultiFind(startln, endln, ignoreleft, ignoreright, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) +function lib:MultiFind(startln, endln, ignoreleft, ignoreright, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11) assert(type(t1) == "string" or type(t1) == "number") if t1 and self:Find(t1, startln, endln, ignoreleft, ignoreright) then return self:Find(t1, startln, endln, ignoreleft, ignoreright) - elseif t2 then return self:MultiFind(startln, endln, ignoreleft, ignoreright, t2,t3,t4,t5,t6,t7,t8,t9,t10) end + elseif t2 then return self:MultiFind(startln, endln, ignoreleft, ignoreright, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11) end end diff --git a/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.toc b/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.toc index 178977f..2087db7 100644 --- a/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.toc +++ b/Jamba/Libs/LibGratuity-3.0/LibGratuity-3.0.toc @@ -1,29 +1,10 @@ -## Interface: 50400 +## Interface: 50400 ## LoadOnDemand: 1 ## Title: Lib: Gratuity-3.0 ## Notes: Tooltip scanning library. ## Author: Tekkub Stoutwrithe ## Version: r$Revision: 41183 $ ## LastUpdate: $Date: 2007-06-21 15:59:31 -1000 (Thu, 21 Jun 2007) $ -## X-Website: http://www.wowace.com/addons/libgratuity-3-0/ -## X-Category: Library -## X-AceLibrary-Gratuity-2.0: true -## X-Curse-Packaged-Version: r46 -## X-Curse-Project-Name: LibGratuity-3.0 -## X-Curse-Project-ID: libgratuity-3-0 -## X-Curse-Repository-ID: wow/libgratuity-3-0/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub\LibStub.lua lib.xml diff --git a/Jamba/Libs/LibGratuity-3.0/LibStub/LibStub.toc b/Jamba/Libs/LibGratuity-3.0/LibStub/LibStub.toc index 434bb69..177947e 100644 --- a/Jamba/Libs/LibGratuity-3.0/LibStub/LibStub.toc +++ b/Jamba/Libs/LibGratuity-3.0/LibStub/LibStub.toc @@ -1,25 +1,6 @@ -## Interface: 50001 +## Interface: 50400 ## Title: Lib: LibStub ## Notes: Universal Library Stub ## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel -## X-Website: http://www.wowace.com/addons/libstub/ -## X-Category: Library -## X-License: Public Domain -## X-Curse-Packaged-Version: r97 -## X-Curse-Project-Name: LibStub -## X-Curse-Project-ID: libstub -## X-Curse-Repository-ID: wow/libstub/mainline -## X-Curse-Packaged-Version: release-6.0.3.4 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.7 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline -## X-Curse-Packaged-Version: release-6.0.3.5-3 -## X-Curse-Project-Name: Jamba -## X-Curse-Project-ID: jamba -## X-Curse-Repository-ID: wow/jamba/mainline LibStub.lua diff --git a/Jamba/Libs/UTF8/Changelog-UTF8-v1.1.txt b/Jamba/Libs/UTF8/Changelog-UTF8-v1.1.txt new file mode 100644 index 0000000..da84888 --- /dev/null +++ b/Jamba/Libs/UTF8/Changelog-UTF8-v1.1.txt @@ -0,0 +1,19 @@ +------------------------------------------------------------------------ +r6 | phanx | 2014-10-28 02:27:07 +0000 (Tue, 28 Oct 2014) | 1 line +Changed paths: + A /tags/v1.1 (from /trunk:5) + +Tagging as v1.1 +------------------------------------------------------------------------ +r5 | Phanx | 2014-10-28 02:26:44 +0000 (Tue, 28 Oct 2014) | 1 line +Changed paths: + M /trunk/UTF8.toc + +- Update TOC for a new release +------------------------------------------------------------------------ +r4 | Phanx | 2012-09-07 10:25:33 +0000 (Fri, 07 Sep 2012) | 1 line +Changed paths: + M /trunk/utf8.lua + +- Switched from slower x:sub notation to faster upvalued strsub(x) +------------------------------------------------------------------------ diff --git a/Jamba/Libs/UTF8/UTF8.toc b/Jamba/Libs/UTF8/UTF8.toc new file mode 100644 index 0000000..e90b134 --- /dev/null +++ b/Jamba/Libs/UTF8/UTF8.toc @@ -0,0 +1,11 @@ +## Interface: 60000 +## Version: v1.1 + +## Title: Lib: UTF8 +## Notes: A library for manipulating UTF-8 strings +## Author: Pastamancer +## X-License: BSD License +## X-Website: http://www.wowace.com/addons/utf8/ + +utf8data.lua +utf8.lua \ No newline at end of file diff --git a/Jamba/Libs/UTF8/utf8.lua b/Jamba/Libs/UTF8/utf8.lua index e5e30e0..485582c 100644 --- a/Jamba/Libs/UTF8/utf8.lua +++ b/Jamba/Libs/UTF8/utf8.lua @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --]] -- ABNF from RFC 3629 --- +-- -- UTF8-octets = *( UTF8-char ) -- UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4 -- UTF8-1 = %x00-7F @@ -52,11 +52,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / -- %xF4 %x80-8F 2( UTF8-tail ) -- UTF8-tail = %x80-BF --- +-- + +local strbyte, strlen, strsub, type = string.byte, string.len, string.sub, type -- returns the number of bytes used by the UTF-8 character at byte i in s -- also doubles as a UTF-8 character validator -local function utf8charbytes (s, i) +local function utf8charbytes(s, i) -- argument defaults i = i or 1 @@ -68,7 +70,7 @@ local function utf8charbytes (s, i) error("bad argument #2 to 'utf8charbytes' (number expected, got ".. type(i).. ")") end - local c = s:byte(i) + local c = strbyte(s, i) -- determine bytes needed for character, based on RFC 3629 -- validate byte 1 @@ -78,7 +80,7 @@ local function utf8charbytes (s, i) elseif c >= 194 and c <= 223 then -- UTF8-2 - local c2 = s:byte(i + 1) + local c2 = strbyte(s, i + 1) if not c2 then error("UTF-8 string terminated early") @@ -93,8 +95,8 @@ local function utf8charbytes (s, i) elseif c >= 224 and c <= 239 then -- UTF8-3 - local c2 = s:byte(i + 1) - local c3 = s:byte(i + 2) + local c2 = strbyte(s, i + 1) + local c3 = strbyte(s, i + 2) if not c2 or not c3 then error("UTF-8 string terminated early") @@ -118,9 +120,9 @@ local function utf8charbytes (s, i) elseif c >= 240 and c <= 244 then -- UTF8-4 - local c2 = s:byte(i + 1) - local c3 = s:byte(i + 2) - local c4 = s:byte(i + 3) + local c2 = strbyte(s, i + 1) + local c3 = strbyte(s, i + 2) + local c4 = strbyte(s, i + 3) if not c2 or not c3 or not c4 then error("UTF-8 string terminated early") @@ -134,7 +136,7 @@ local function utf8charbytes (s, i) elseif c2 < 128 or c2 > 191 then error("Invalid UTF-8 character") end - + -- validate byte 3 if c3 < 128 or c3 > 191 then error("Invalid UTF-8 character") @@ -152,18 +154,15 @@ local function utf8charbytes (s, i) end end --- Modified by Jafula - global function for Jamba. -jambautf8charbytes = utf8charbytes - -- returns the number of characters in a UTF-8 string -local function utf8len (s) +local function utf8len(s) -- argument checking if type(s) ~= "string" then error("bad argument #1 to 'utf8len' (string expected, got ".. type(s).. ")") end local pos = 1 - local bytes = s:len() + local bytes = strlen(s) local len = 0 while pos <= bytes do @@ -179,10 +178,9 @@ if not string.utf8len then string.utf8len = utf8len end - -- functions identically to string.sub except that i and j are UTF-8 characters -- instead of bytes -local function utf8sub (s, i, j) +local function utf8sub(s, i, j) -- argument defaults j = j or -1 @@ -198,11 +196,11 @@ local function utf8sub (s, i, j) end local pos = 1 - local bytes = s:len() + local bytes = strlen(s) local len = 0 -- only set l if i or j is negative - local l = (i >= 0 and j >= 0) or string.utf8len(s) + local l = (i >= 0 and j >= 0) or utf8len(s) local startChar = (i >= 0) and i or l + i + 1 local endChar = (j >= 0) and j or l + j + 1 @@ -229,7 +227,7 @@ local function utf8sub (s, i, j) end end - return s:sub(startByte, endByte) + return strsub(s, startByte, endByte) end -- install in the string library @@ -237,9 +235,8 @@ if not string.utf8sub then string.utf8sub = utf8sub end - -- replace UTF-8 characters based on a mapping table -local function utf8replace (s, mapping) +local function utf8replace(s, mapping) -- argument checking if type(s) ~= "string" then error("bad argument #1 to 'utf8replace' (string expected, got ".. type(s).. ")") @@ -249,13 +246,13 @@ local function utf8replace (s, mapping) end local pos = 1 - local bytes = s:len() + local bytes = strlen(s) local charbytes local newstr = "" while pos <= bytes do charbytes = utf8charbytes(s, pos) - local c = s:sub(pos, pos + charbytes - 1) + local c = strsub(s, pos, pos + charbytes - 1) newstr = newstr .. (mapping[c] or c) @@ -265,9 +262,8 @@ local function utf8replace (s, mapping) return newstr end - -- identical to string.upper except it knows about unicode simple case conversions -local function utf8upper (s) +local function utf8upper(s) return utf8replace(s, utf8_lc_uc) end @@ -276,9 +272,8 @@ if not string.utf8upper and utf8_lc_uc then string.utf8upper = utf8upper end - -- identical to string.lower except it knows about unicode simple case conversions -local function utf8lower (s) +local function utf8lower(s) return utf8replace(s, utf8_uc_lc) end @@ -287,29 +282,28 @@ if not string.utf8lower and utf8_uc_lc then string.utf8lower = utf8lower end - -- identical to string.reverse except that it supports UTF-8 -local function utf8reverse (s) +local function utf8reverse(s) -- argument checking if type(s) ~= "string" then error("bad argument #1 to 'utf8reverse' (string expected, got ".. type(s).. ")") end - local bytes = s:len() + local bytes = strlen(s) local pos = bytes local charbytes local newstr = "" while pos > 0 do - c = s:byte(pos) + c = strbyte(s, pos) while c >= 128 and c <= 191 do pos = pos - 1 - c = s:byte(pos) + c = strbyte(pos) end charbytes = utf8charbytes(s, pos) - newstr = newstr .. s:sub(pos, pos + charbytes - 1) + newstr = newstr .. strsub(s, pos, pos + charbytes - 1) pos = pos - 1 end @@ -320,4 +314,4 @@ end -- install in the string library if not string.utf8reverse then string.utf8reverse = utf8reverse -end +end \ No newline at end of file diff --git a/Jamba/Locales/JambaCore-Locale-enUS.lua b/Jamba/Locales/JambaCore-Locale-enUS.lua index 993625b..1be9ba5 100644 --- a/Jamba/Locales/JambaCore-Locale-enUS.lua +++ b/Jamba/Locales/JambaCore-Locale-enUS.lua @@ -39,12 +39,15 @@ L["all your characters and log them on again."] = true L["Show Online Channel Traffic (For Debugging Purposes)"] = true L["Change Channel"] = true L["Change the communications channel."] = true +L["Jamba4"] = true L["Jamba"] = true L["Jafula's Awesome Multi-Boxer Assistant"] = true -L["Copyright 2008-2015 Michael 'Jafula' Miller"] = true -L["Made in New Zealand"] = true +L["Copyright 2008-2016 Michael 'Jafula' Miller, Now managed By Ebony"] = true +L["Special thanks to Michael 'Jafula' Miller who made Jamba"] = true +L["Made For MultiBoxing"] = true L["Help & Documentation"] = true L["For user manuals and documentation please visit:"] = true +L["Other useful websites:"] = true L["http://dual-boxing.com/"] = true L["Special thanks to olipcs on dual-boxing.com for writing the FTL Helper module."] = true L["Advanced Loot by schilm (Max Schilling) - modified by Tehtsuo and Jafula."] = true @@ -58,4 +61,10 @@ L["Assume All Team Members Always Online*"] = true L["Boost Jamba to Jamba Communications**"] = true L["**reload UI to take effect, may cause disconnections"] = true L["*reload UI to take effect"] = true - +L["Release Notes / News"] = true +L["Close and Do Not Show Again"] = true +L["Close"] = true +-- test stuff +L["**Untick this to use the WIP Set Offline team List Set offline Button"] =true +L["Use Team List Offline Button"] = true +L["Auto Set Team Members On and Off Line"] = true \ No newline at end of file diff --git a/Jamba/Locales/JambaMessage-Locale-enUS.lua b/Jamba/Locales/JambaMessage-Locale-enUS.lua index 0b5e893..ceeda5b 100644 --- a/Jamba/Locales/JambaMessage-Locale-enUS.lua +++ b/Jamba/Locales/JambaMessage-Locale-enUS.lua @@ -13,6 +13,9 @@ L["Push the message settings to all characters in the team."] = true L["Settings received from A."] = function( characterName ) return string.format( "Settings received from %s.", characterName ) end +--L["Settings received from A."] = function( characterName ) +-- return "Settings received from "..characterName.."." +--end L["Default Chat Window"] = true L["Specific Chat Window"] = true L["Whisper"] = true diff --git a/Jamba/Locales/JambaTag-Locale-enUS.lua b/Jamba/Locales/JambaTag-Locale-enUS.lua index 853c866..bd05fc3 100644 --- a/Jamba/Locales/JambaTag-Locale-enUS.lua +++ b/Jamba/Locales/JambaTag-Locale-enUS.lua @@ -22,6 +22,6 @@ L["Settings received from A."] = function( characterName ) return "Settings received from "..characterName.."." end L["master"] = true -L["slave"] = true +L["minion"] = true L["all"] = true L["justme"] = true diff --git a/Jamba/Locales/JambaTeam-Locale-enUS.lua b/Jamba/Locales/JambaTeam-Locale-enUS.lua index f2005e3..142aa7b 100644 --- a/Jamba/Locales/JambaTeam-Locale-enUS.lua +++ b/Jamba/Locales/JambaTeam-Locale-enUS.lua @@ -14,6 +14,12 @@ L["Add a member to the team list."] = true L["Remove"] = true L["Remove a member from the team list."] = true L["Master"] = true +L["Set OffLine"] = true +L["Set On-Line"] = true +L["Master Can not be Set OffLine"] = true +--wip +L["WIP: This Button Does absolutely nothing at all, Unless you untick Use team List Offline Button in Core:communications Under Advanced. Report bugs to to me -EBONY"] = true +--L["WIP: This Button DOES NOTHING, absolutely nothing at all"] = true L["Set the master character."] = true L["I Am Master"] = true L["Set this character to be the master character."] = true @@ -41,14 +47,18 @@ L["Party Loot Control"] = true L["Automatically set the Loot Method to..."] = true L["Free For All"] = true L["Master Looter"] = true -L["Slaves Opt Out of Loot"] = true -L["Slave"] = true +L["Personal Loot"] = true +L["Minions Opt Out of Loot"] = true +L["Minion"] = true L["(Offline)"] = true -L["Enter name of character to add:"] = true +L["Enter character to add in name-server format:"] = true L["Are you sure you wish to remove %s from the team list?"] = true L["A is not in my team list. I can not set them to be my master."] = function( characterName ) return characterName.." is not in my team list. I can not set them to be my master." end +L["A is not in my team list. I can not set them Offline."] = function( characterName ) + return characterName.." is not in my team list. I can not set them Offline." +end L["Settings received from A."] = function( characterName ) return "Settings received from "..characterName.."." end @@ -61,4 +71,10 @@ L["Add members in the current party to the team."] = true L["Friends Are Not Strangers"] = true L["Remove All Members"] = true L["Remove all members from the team."] = true -L["Auto activate click-to-move on Slaves and deactivate on Master."] = true +L["Auto activate click-to-move on Minions and deactivate on Master."] = true +L["Set All Team Members OffLine"] = true +L["Set Team OffLine"] = true +L["Set All Team Members OnLine"] = true +L["Set Team OnLine"] = true +L["Set Offline"] = true +L["Sets a member offline"] = true \ No newline at end of file diff --git a/Jamba/Locales/Locales.xml b/Jamba/Locales/Locales.xml index 2ea325c..95b38f9 100644 --- a/Jamba/Locales/Locales.xml +++ b/Jamba/Locales/Locales.xml @@ -2,7 +2,6 @@ Jamba - Jafula's Awesome Multi-Boxer Assistant Copyright 2008 - 2015 Michael "Jafula" Miller License: The MIT License -http://jafula.com/jamba/ --> <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd" xmlns="http://www.blizzard.com/wow/ui/"> diff --git a/Jamba/startupmessage.html b/Jamba/startupmessage.html new file mode 100644 index 0000000..e08399f --- /dev/null +++ b/Jamba/startupmessage.html @@ -0,0 +1,39 @@ +<html><body> +<h1>Jamba Release Notes / News</h1> +<br/> +<h1>Whats New:</h1> +<br/> +<h2>Cross Realm Support Added</h2> +<p>* Jamba 4.0+ cross realm & connected realms character support added.</p> +<p>* Character names now must be in name-server format, .e.g. Ebony-Outland</p><br/> +<h3>Notes:</h3> +<p>CR = Connected Realms - EG You can trade/join guild ETC. Jamba will function as though your team is on the same realm!</p> +<p>CR = CrossRealm - Join a realm over CRZ tech. Note: Some modules in Jamba will not function or will not work correctly while in CRZ. This is due to limitations in Blizzard's API. You can talk over realms with addons, however YOU NEED TO BE IN PARTY WITH THE MEMBER FOR ANYTHING TO WORK!</p> +<br/> +<h2>Automated Offline System Added:</h2> +<br/> +<p>* Jamba will now automatically set minions offline if the minion is not online. Jamba will dectect when the minion comes online and sets the status to online. You can now have a full list of characters and not have to worry about online/offline. Easy switching!</p> +<br/> +<h2>Jamba-QuestWatcher:</h2> +<br/> +<p>* Supports Bonus Objectives.</p> +<br/> +<h2>Having Problems With Your Teams?</h2> +<br/> +<p>* Remember to do the following fixes on every character in your team!</p> +* +If your team list is full of empty lines, please reset the current profile. Warning this will require you to configure everything again. You can +reset the current profile with the following button: /jamba > Profiles > Core: Profiles > Reset Profile +<p>* Make sure to add characters into your team list with their name, followed by a dash and the server the character is on. e.g. Ebony-servername</p> +<br/> +<h2>ISBoxer Users</h2> +<br/> +<p>* Please make sure your ISBoxer version is ISBoxer 41.10.1115.1 or higher.</p> +<p>* When ISBoxer manages your Jamba Team for you, it will add the characters with the correct name format if you have filled out the server name in your ISBoxer character.</p> +<p>*Jamba will remove any spaces Isboxers trys to add. No realm can have a space in the name.</p> +<br/> +<h2>Need Help?</h2> +<br/> +<p>Please post in this thread on dual-boxing.com: http://www.dual-boxing.com/threads/52151-Addon-Jamba-4-0-An-assistant-for-Multiboxers-Release-for-WoW-6<br/> +</p> +</body></html> \ No newline at end of file