„Modul:ServiceAward” változatai közötti eltérés

[ellenőrzött változat][ellenőrzött változat]
Tartalom törölve Tartalom hozzáadva
Remove debug username from output
Add prototype service award userbox
3. sor:
levels = {
 
{ 1, "1. szintű", 30, 600, "DYK 100 Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 2, "2. szintű", 60, 1200, "DYK 200 Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 3, "3. szintű", 115, 2300, "DYK 25 Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 4, "4. szintű", 210, 4200, "DYK 50 Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 5, "5. szintű", 360, 7200, "DYK Medal Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 6, "6. szintű", 585, 11700, "Veteran Editor Ribbon.png", "#B7B7B7", "#E8E8E8" },
{ 7, "7. szintű", 910, 18200, "Veteran Editor Ribbon 2.png", "#B7B7B7", "#E8E8E8" },
{ 8, "8. szintű", 1370, 27400, "Veteran Editor Ribbon 3.png", "#B7B7B7", "#E8E8E8" },
{ 9, "9. szintű", 2010, 40200, "Veteran Editor Ribbon 4.png", "#B7B7B7", "#E8E8E8" },
{ 10, "10. szintű", 2880, 57600, "Senior Editor.png", "#B7B7B7", "#E8E8E8" },
{ 11, "11. szintű", 4030, 80600, "Master editor.png", "#B7B7B7", "#E8E8E8" },
{ 12, "12. szintű", 5500, 110000, "Master editor 2.png", "#B7B7B7", "#E8E8E8" },
}
 
1 804. sor:
local RANKS_NEEDED_ACTIVE_DAYS_INDEX = 3;
local RANKS_NEEDED_TOTAL_EDITS_INDEX = 4;
local RANKS_IMAGE_INDEX = 5;
local RANKS_ID_COLOR_INDEX = 6;
local RANKS_BACKGROUND_COLOR_INDEX = 7;
 
local USER_STATISTICS_RANK_INDEX = 1;
1 809 ⟶ 1 812 sor:
local USER_STATISTICS_TOTAL_EDITS_INDEX = 3;
local USER_STATISTICS_NEXT_RANK_INDEX = 4;
 
 
local p = {}
1 887 ⟶ 1 891 sor:
title = "Szolgálati érdemérem/Előrehaladás/Keret",
args = templateParams,
}
 
return ret
end
 
function p.serviceAwardUserBox(frame)
local args = frame.args
local userName = args.userName
if not(userName) then
return "Nem adtál meg szerkesztőnevet!"
end
 
local ret = ""
local templateParams = {}
 
local userBoxBorderColor = args.userBoxBorderColor
local userBoxIdColor = args.userBoxIdColor
local userBoxBackgroundColor = args.userBoxBackgroundColor
local userBoxTextColor = args.userBoxTextColor
if userBoxTextColor == nil then
userBoxTextColor = "#eee"
end
local userBoxBorderWidth = args.userBoxBorderWidth
if userBoxBorderWidth == nil then
userBoxBorderWidth = "1px"
end
local userBoxIdContent = "◯"
local userBoxTextContent = "Ez a felhasználó még nem rendelkezik elegendő szerkesztéssel ahhoz, hogy Szolgálati Érdemérmet kapjon."
local userData = statistics[userName]
if userData then
local currentRank = nil
if not(userData[USER_STATISTICS_RANK_INDEX] == -1) then
currentRank = levels[userData[USER_STATISTICS_RANK_INDEX]]
userBoxIdContent = "[[Kép:" .. currentRank[RANKS_IMAGE_INDEX] .. "|50px]]"
userBoxTextContent = "Ez a felhasználó " .. currentRank[RANKS_RANK_NAME_INDEX]
userBoxBorderColor = currentRank[RANKS_ID_COLOR_INDEX]
userBoxIdColor = currentRank[RANKS_ID_COLOR_INDEX]
userBoxBackgroundColor = currentRank[RANKS_BACKGROUND_COLOR_INDEX]
end
end
ret = ret .. frame:expandTemplate{
title = "Userbox",
args = {
userBoxBorderColor,
userBoxIdColor,
userBoxTextColor,
userBoxIdContent,
userBoxTextContent,
"left",
userBoxTextColor,
"8pt",
"14pt",
"userBoxBorderWidth"
},
}