2 Star 0 Fork 0

mirrors_kylepixel/wow-ui-source

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
petitionframe.lua 2.21 KB
Copy Edit Raw Blame History
dubcat authored 6 years ago . 1.13.2.30172
function PetitionFrame_Update(self)
if ( CanSignPetition() ) then
PetitionFrameSignButton:Enable();
else
PetitionFrameSignButton:Disable();
end
local petitionType, title, bodyText, maxSignatures, originatorName, isOriginator, minSignatures = GetPetitionInfo();
if ( isOriginator ) then
PetitionFrameRequestButton:Show();
PetitionFrameSignButton:Hide();
if ( petitionType == "guild" ) then
PetitionFrameInstructions:SetText(GUILD_PETITION_LEADER_INSTRUCTIONS);
elseif ( petitionType == "arena" ) then
PetitionFrameInstructions:SetText(ARENA_PETITION_LEADER_INSTRUCTIONS);
end
PetitionFrameRenameButton:Show();
else
PetitionFrameRequestButton:Hide();
PetitionFrameSignButton:Show();
if ( petitionType == "guild" ) then
PetitionFrameInstructions:SetText(GUILD_PETITION_MEMBER_INSTRUCTIONS);
elseif ( petitionType == "arena" ) then
PetitionFrameInstructions:SetText(ARENA_PETITION_MEMBER_INSTRUCTIONS);
end
PetitionFrameRenameButton:Hide();
end
if ( petitionType == "guild" ) then
PetitionFrameNpcNameText:SetFormattedText(GUILD_CHARTER_TEMPLATE, title);
PetitionFrameCharterTitle:SetText(GUILD_NAME);
PetitionFrameCharterName:SetText(title);
PetitionFrameMasterTitle:SetText(GUILD_RANK0_DESC);
PetitionFrameMasterName:SetText(originatorName);
PetitionFrameRenameButton:SetText(RENAME_GUILD);
else
PetitionFrameNpcNameText:SetText("Petition");
end
local memberText;
local numNames = GetNumPetitionNames();
if ( self.minSignatures ) then
for i=1, self.minSignatures, 1 do
memberText = _G["PetitionFrameMemberName"..i];
memberText:Hide();
end
end
for i=1, minSignatures do
memberText = _G["PetitionFrameMemberName"..i];
if ( i <= numNames ) then
memberText:SetText(GetPetitionNameInfo(i));
else
memberText:SetText(NOT_YET_SIGNED);
end
if ( i == minSignatures ) then
PetitionFrameInstructions:SetPoint( "TOPLEFT", memberText:GetName(), "BOTTOMLEFT", 0, -10);
end
memberText:Show();
end
self.minSignatures = minSignatures;
self.petitionType = petitionType;
if ( numNames >= maxSignatures ) then
PetitionFrameRequestButton:Disable();
else
PetitionFrameRequestButton:Enable();
end
end
function PetitionFrameSignButton_OnClick(self)
SignPetition();
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_kylepixel/wow-ui-source.git
git@gitee.com:mirrors_kylepixel/wow-ui-source.git
mirrors_kylepixel
wow-ui-source
wow-ui-source
master

Search