[TC 3.3.5a] Adding back the keybinding tooltip to a custom MainMenuMicroButton edit menu

User Tag List

Results 1 to 1 of 1
  1. #1
    Kobiesan's Avatar Member
    Reputation
    1
    Join Date
    Mar 2017
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [TC 3.3.5a] Adding back the keybinding tooltip to a custom MainMenuMicroButton edit

    I recently made a FrameXML edit and patch that opens up the achievement frame at level 1. Only problem is that when you hover over the achievements button it will only say 'Achievements' and not 'Achievement (your keybinding for achievements)' does anyone know how to solve this? Here is my new MainMenuMicroButton.lua

    Code:
    function LoadMicroButtonTextures(self, name)
    	self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
    	self:RegisterEvent("UPDATE_BINDINGS");
    	local prefix = "Interface\\Buttons\\UI-MicroButton-";
    	self:SetNormalTexture(prefix..name.."-Up");
    	self:SetPushedTexture(prefix..name.."-Down");
    	self:SetDisabledTexture(prefix..name.."-Disabled");
    	self:SetHighlightTexture("Interface\\Buttons\\UI-MicroButton-Hilight");
    end
    
    function MicroButtonTooltipText(text, action)
    	if ( GetBindingKey(action) ) then
    		return text.." "..NORMAL_FONT_COLOR_CODE.."("..GetBindingText(GetBindingKey(action), "KEY_")..")"..FONT_COLOR_CODE_CLOSE;
    	else
    		return text;
    	end
    	
    end
    
    function UpdateMicroButtons()
    	if ( CharacterFrame:IsShown() ) then
    		CharacterMicroButton:SetButtonState("PUSHED", 1);
    		CharacterMicroButton_SetPushed();
    	else
    		CharacterMicroButton:SetButtonState("NORMAL");
    		CharacterMicroButton_SetNormal();
    	end
    	
    	if ( SpellBookFrame:IsShown() ) then
    		SpellbookMicroButton:SetButtonState("PUSHED", 1);
    	else
    		SpellbookMicroButton:SetButtonState("NORMAL");
    	end
    
    	if ( PlayerTalentFrame and PlayerTalentFrame:IsShown() ) then
    		TalentMicroButton:SetButtonState("PUSHED", 1);
    	else
    		TalentMicroButton:SetButtonState("NORMAL");
    	end
    
    	if ( QuestLogFrame:IsShown() ) then
    		QuestLogMicroButton:SetButtonState("PUSHED", 1);
    	else
    		QuestLogMicroButton:SetButtonState("NORMAL");
    	end
    	
    	if ( ( GameMenuFrame:IsShown() ) 
    		or ( OptionsFrame:IsShown()) 
    		or ( AudioOptionsFrame:IsShown()) 
    		or ( InterfaceOptionsFrame and InterfaceOptionsFrame:IsShown()) 
    		or ( KeyBindingFrame and KeyBindingFrame:IsShown()) 
    		or ( MacroFrame and MacroFrame:IsShown()) ) then
    		MainMenuMicroButton:SetButtonState("PUSHED", 1);
    	else
    		MainMenuMicroButton:SetButtonState("NORMAL");
    	end
    
    	if ( PVPFrame:IsShown() ) then
    		PVPMicroButton:SetButtonState("PUSHED", 1);
    	else
    		PVPMicroButton:SetButtonState("NORMAL");
    	end
    	
    	if ( FriendsFrame:IsShown() ) then
    		SocialsMicroButton:SetButtonState("PUSHED", 1);
    	else
    		SocialsMicroButton:SetButtonState("NORMAL");
    	end
    
    	if ( LFGParentFrame:IsShown() ) then
    		LFGMicroButton:SetButtonState("PUSHED", 1);
    	else
    		LFGMicroButton:SetButtonState("NORMAL");
    	end
    
    	if ( HelpFrame:IsShown() ) then
    		HelpMicroButton:SetButtonState("PUSHED", 1);
    	else
    		HelpMicroButton:SetButtonState("NORMAL");
    	end
    	
    	if ( AchievementFrame and AchievementFrame:IsShown() ) then
    		AchievementMicroButton:SetButtonState("PUSHED", 1);
    	else
    		AchievementMicroButton:SetButtonState("NORMAL");
    	end
    	-- Keyring microbutton
    	if ( IsBagOpen(KEYRING_CONTAINER) ) then
    		KeyRingButton:SetButtonState("PUSHED", 1);
    	else
    		KeyRingButton:SetButtonState("NORMAL");
    	end
    end
    
    function HasCompletedAnyAchievement() return true
    end
    
    function CanShowAchievementUI() return true
    end
    
    function AchievementMicroButton_Update()
    	AchievementMicroButton:Show();
    	AchievementMicroButton:Enable();
    	AchievementMicroButton:SetButtonState("NORMAL");
    	QuestLogMicroButton:SetPoint("BOTTOMLEFT", AchievementMicroButton, "BOTTOMRIGHT", -3, 0);
    end
    
    function CharacterMicroButton_OnLoad(self)
    	SetPortraitTexture(MicroButtonPortrait, "player");
    	self:SetNormalTexture("Interface\\Buttons\\UI-MicroButtonCharacter-Up");
    	self:SetPushedTexture("Interface\\Buttons\\UI-MicroButtonCharacter-Down");
    	self:SetHighlightTexture("Interface\\Buttons\\UI-MicroButton-Hilight");
    	self:RegisterEvent("UNIT_PORTRAIT_UPDATE");
    	self:RegisterEvent("UPDATE_BINDINGS");
    	self:RegisterForClicks("LeftButtonDown", "RightButtonDown", "LeftButtonUp", "RightButtonUp");
    	self.tooltipText = MicroButtonTooltipText(CHARACTER_BUTTON, "TOGGLECHARACTER0");
    	self.newbieText = NEWBIE_TOOLTIP_CHARACTER;
    end
    
    function CharacterMicroButton_OnEvent(self, event, ...)
    	if ( event == "UNIT_PORTRAIT_UPDATE" ) then
    		local unit = ...;
    		if ( unit == "player" ) then
    			SetPortraitTexture(MicroButtonPortrait, unit);
    		end
    		return;
    	elseif ( event == "UPDATE_BINDINGS" ) then
    		self.tooltipText = MicroButtonTooltipText(CHARACTER_BUTTON, "TOGGLECHARACTER0");
    	end
    end
    
    function CharacterMicroButton_SetPushed()
    	MicroButtonPortrait:SetTexCoord(0.2666, 0.8666, 0, 0.8333);
    	MicroButtonPortrait:SetAlpha(0.5);
    end
    
    function CharacterMicroButton_SetNormal()
    	MicroButtonPortrait:SetTexCoord(0.2, 0.8, 0.0666, 0.9);
    	MicroButtonPortrait:SetAlpha(1.0);
    end
    
    --Talent button specific functions
    function TalentMicroButton_OnEvent(self, event, ...)
    	if ( event == "PLAYER_LEVEL_UP" ) then
    		UpdateTalentButton();
    		if ( not CharacterFrame:IsShown() ) then
    			SetButtonPulse(self, 60, 1);
    		end
    	elseif ( event == "UNIT_LEVEL" or event == "PLAYER_ENTERING_WORLD" ) then
    		UpdateTalentButton();
    	elseif ( event == "UPDATE_BINDINGS" ) then
    		self.tooltipText =  MicroButtonTooltipText(TALENTS_BUTTON, "TOGGLETALENTS");
    	end
    end
    
    function UpdateTalentButton()
    	if ( UnitLevel("player") < 1 ) then
    		TalentMicroButton:Hide();
    		AchievementMicroButton:SetPoint("BOTTOMLEFT", "TalentMicroButton", "BOTTOMLEFT", 0, 0);
    	else	
    		TalentMicroButton:Show();
    		AchievementMicroButton:SetPoint("BOTTOMLEFT", "TalentMicroButton", "BOTTOMRIGHT", -2, 0);
    	end
    end
    
    UpdateMicroButtons()

    [TC 3.3.5a] Adding back the keybinding tooltip to a custom MainMenuMicroButton edit

Similar Threads

  1. How to: Bring back the old Chain Lightning Sound
    By Lwys in forum World of Warcraft Guides
    Replies: 3
    Last Post: 05-11-2008, 03:28 AM
  2. Bringing Back The Righteous Orb Scam! 50-500g Per Hour!
    By joshman408 in forum WoW Scam Prevention
    Replies: 33
    Last Post: 03-27-2008, 04:01 PM
  3. Bringing Back the Righteous Orb Scam
    By joshman408 in forum World of Warcraft Guides
    Replies: 1
    Last Post: 01-20-2008, 09:23 PM
  4. Replies: 36
    Last Post: 05-05-2006, 01:11 AM
All times are GMT -5. The time now is 07:04 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search