Skip to content

Add grade counter and nothing as new tip types for Rebirth's footer #1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion Themes/Rebirth/BGAnimations/footer.lua
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ t[#t+1] = LoadFont("Common Normal") .. {
end
}

t[#t+1] = LoadFont("Common Normal") .. {
quoteortip = LoadFont("Common Normal") .. {
Name = "QuoteOrTip",
InitCommand = function(self)
self:halign(0)
@@ -75,4 +75,44 @@ t[#t+1] = LoadFont("Common Normal") .. {
end
}

gradecounter = LoadFont("Common Normal") .. {
Name = "GradeCounter",
InitCommand = function(self)
local aaaaa = WHEELDATA:GetTotalClearsByGrade("Grade_Tier01")
local aaaa = WHEELDATA:GetTotalClearsByGrade("Grade_Tier02") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier03") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier04")
local aaa = WHEELDATA:GetTotalClearsByGrade("Grade_Tier05") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier06") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier07")
local aa = WHEELDATA:GetTotalClearsByGrade("Grade_Tier08") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier09") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier10")
local a = WHEELDATA:GetTotalClearsByGrade("Grade_Tier11") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier12") + WHEELDATA:GetTotalClearsByGrade("Grade_Tier13")
self:xy(actuals.Width * allowedPercentageForQuote / 2, -actuals.Height / 2)
self:zoom(textSize)
self:maxwidth(actuals.Width * allowedPercentageForQuote / textSize - textZoomFudge)
self:settextf("%d %s %d %s %d %s %d %s %d %s",
aaaaa, getGradeStrings("Grade_Tier01"),
aaaa, getGradeStrings("Grade_Tier04"),
aaa, getGradeStrings("Grade_Tier07"),
aa, getGradeStrings("Grade_Tier10"),
a, getGradeStrings("Grade_Tier13"))
registerActorToColorConfigElement(self, "main", "PrimaryText")
-- uh
local yea = 0
function attributive(when, gren) --
yea = yea + when
self:AddAttribute(yea, {Length = #getGradeStrings(gren), Diffuse = colorByGrade(gren)})
end
attributive(#tostring(aaaaa) + 1, "Grade_Tier01")
attributive(3 + #getGradeStrings("Grade_Tier01") + #tostring(aaaa) + 1, "Grade_Tier04")
attributive(3 + #getGradeStrings("Grade_Tier04") + #tostring(aaa) + 1, "Grade_Tier07")
attributive(3 + #getGradeStrings("Grade_Tier07") + #tostring(aa) + 1, "Grade_Tier10")
attributive(3 + #getGradeStrings("Grade_Tier10") + #tostring(a) + 1, "Grade_Tier13")
end,
}

tiptype = themeConfig:get_data().global.TipType

if tiptype == 3 then
t[#t+1] = gradecounter
elseif tiptype == 1 or tiptype == 2 then
t[#t+1] = quoteortip
end

return t
45 changes: 42 additions & 3 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/settings.lua
Original file line number Diff line number Diff line change
@@ -6197,9 +6197,48 @@ local function rightFrame()
DisplayName = translations["TipType"],
Type = "SingleChoice",
Explanation = translations["TipTypeExplanation"],
Choices = choiceSkeleton("Tips", "Quotes"),
Directions = optionDataToggleDirectionsFUNC("tipType", 1, 2),
ChoiceIndexGetter = optionDataToggleIndexGetterFUNC("tipType", 1),
Choices = {
{
Name = "Tips",
DisplayName = "Tips",
ChosenFunction = function()
optionData["tipType"].set(1)
end
},
{
Name = "Quotes",
DisplayName = "Quotes",
ChosenFunction = function()
optionData["tipType"].set(2)
end
},
{
Name = "GradeCounter",
DisplayName = "Grade Counter",
ChosenFunction = function()
optionData["tipType"].set(3)
end
},
{
Name = "Nothing",
DisplayName = "Nothing",
ChosenFunction = function()
optionData["tipType"].set(4)
end
}
},
ChoiceIndexGetter = function(self)
v = optionData["tipType"].get()
if v == 1 then
return 1
elseif v == 2 then
return 2
elseif v == 3 then
return 3
else
return 4
end
end,
},
{
Name = "Set BG Fit Mode",
2 changes: 1 addition & 1 deletion Themes/Rebirth/Scripts/01 theme_config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local defaultConfig = {
global = {
TipType = 1, -- 1 = tips, 2 = quotes ...
TipType = 1, -- 1 = tips, 2 = quotes, 3 = grade counter, 4 = nothing ...
ShowVisualizer = true,
FallbackToAverageColorBG = true, -- wheel bg only
StaticBackgrounds = false,
11 changes: 8 additions & 3 deletions Themes/Rebirth/Scripts/02 ThemePrefs.lua
Original file line number Diff line number Diff line change
@@ -782,16 +782,19 @@ function TipType()
Choices = {
THEME:GetString("OptionNames", "Off"),
THEME:GetString("OptionNames", "Tips"),
THEME:GetString("OptionNames", "RandomPhrases")
THEME:GetString("OptionNames", "RandomPhrases"),
THEME:GetString("OptionNames", "GradeCounter")
},
LoadSelections = function(self, list, pn)
local pref = themeConfig:get_data().global.TipType
if pref == 1 then
list[1] = true
elseif pref == 2 then
list[2] = true
else
elseif pref == 3 then
list[3] = true
else -- default to nothing
list[4] = true
end
end,
SaveSelections = function(self, list, pn)
@@ -800,8 +803,10 @@ function TipType()
value = 1
elseif list[2] == true then
value = 2
else
elseif list[3] == true then
value = 3
else -- default to nothing
value = 4
end
themeConfig:get_data().global.TipType = value
themeConfig:set_dirty()