This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TC 3.3.5a] Opening up the achievements tab at level 1  (Read 1533 times)

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
[TC 3.3.5a] Opening up the achievements tab at level 1
« on: March 08, 2017, 12:43:11 am »
Hi, I'm trying to figure out how to make it so you can look at your achievements tab at level 1. I've looked in player.cpp for a level restriction but haven't found anything. I've looked in a few other places as well. I want to open it for my whole server so I don't want to edit FrameXMLs but I would like to know where that is located within FrameXML as well.

Well, I found something sorta helpful. In FrameXML > MainMenuBarMicroButtons.lua in the middle there is this...

Code: [Select]
function AchievementMicroButton_Update()
if ( not CanShowAchievementUI() ) then
AchievementMicroButton:Hide();
QuestLogMicroButton:SetPoint("BOTTOMLEFT", AchievementMicroButton, "BOTTOMLEFT", 0, 0);
else
AchievementMicroButton:Show();
QuestLogMicroButton:SetPoint("BOTTOMLEFT", AchievementMicroButton, "BOTTOMRIGHT", -3, 0);
end
end

So I changed it to this...

Code: [Select]
function AchievementMicroButton_Update()
AchievementMicroButton:Show();
QuestLogMicroButton:SetPoint("BOTTOMLEFT", AchievementMicroButton, "BOTTOMRIGHT", -3, 0);
end

But when I load into the game it says my interface files are corrupt. Any ideas? Also, where is CanShowAchievementUI pulling from?

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #1 on: March 08, 2017, 08:55:16 am »
"it says my interface files are corrupt"
Sec, do you have modified WoW.exe with removed GlueXML check? If not, you'll get this error whenever you edit anythig in UI.
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #2 on: March 08, 2017, 05:49:43 pm »
"it says my interface files are corrupt"
Sec, do you have modified WoW.exe with removed GlueXML check? If not, you'll get this error whenever you edit anythig in UI.

Ahh, was using the wrong wow.exe. I have one with the check removed and one with it. It opened up the color on the achievements tab now but it can't be opened.

Mr. DK

  • Moderators
  • Model Change Addict
  • *****
  • Posts: 224
    • View Profile
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #3 on: March 08, 2017, 05:53:32 pm »
If I remember correct. There is a define somewhere in the interface that sets the level when you can use this.
I am Thor! Supreme commander of the Asgard Fleet!

Rochet2

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
    • http://rochet2.github.io/
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #4 on: March 08, 2017, 05:56:43 pm »
This enables the use of the window:
Code: [Select]
/run AchievementMicroButton.minLevel = 1; function CanShowAchievementUI() return true end; function HasCompletedAnyAchievement() return true end; UpdateMicroButtons()
use from chat.

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #5 on: March 08, 2017, 07:51:49 pm »
This enables the use of the window:
Code: [Select]
/run AchievementMicroButton.minLevel = 1; function CanShowAchievementUI() return true end; function HasCompletedAnyAchievement() return true end; UpdateMicroButtons()
use from chat.

I don't want to make my players type that when they play I'd rather make a patch.

Mr. DK

  • Moderators
  • Model Change Addict
  • *****
  • Posts: 224
    • View Profile
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #6 on: March 08, 2017, 07:56:58 pm »
AchievementMicroButton.minLevel = 1

Find this entry. It should be a variable at the top of the file and change it to 1
I am Thor! Supreme commander of the Asgard Fleet!

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
Re: [TC 3.3.5a] Opening up the achievements tab at level 1
« Reply #7 on: March 09, 2017, 01:14:31 am »
AchievementMicroButton.minLevel = 1

Find this entry. It should be a variable at the top of the file and change it to 1

That's not in MainMenuBarMicroButtons
Code: [Select]
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 AchievementMicroButton_Update()
AchievementMicroButton:Show();
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

Where is AchievementMicroButton.minlevel coming from?

Update:
Got it to work using this code however whatever your keybinding is for achievements doesn't show up next to the achievement micro button. How is that fixed?
Code: [Select]
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()
« Last Edit: March 09, 2017, 01:47:55 am by Kobiesan »