Skip to content

Commit

Permalink
Add HighestDifficultyOnly filter option into Til Death
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebandit21 committed Aug 14, 2020
1 parent a01090e commit d1428d6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ end
local translated_info = {
Mode = THEME:GetString("TabFilter", "Mode"),
HighestOnly = THEME:GetString("TabFilter", "HighestOnly"),
HighestDifficultyOnly = THEME:GetString("TabFilter", "HighestDifficultyOnly"),
On = THEME:GetString("OptionNames", "On"),
Off = THEME:GetString("OptionNames", "Off"),
Matches = THEME:GetString("TabFilter", "Matches"),
Expand All @@ -74,6 +75,7 @@ local translated_info = {
ExplainGrey = THEME:GetString("TabFilter", "ExplainGrey"),
ExplainBounds = THEME:GetString("TabFilter", "ExplainBounds"),
ExplainHighest = THEME:GetString("TabFilter", "ExplainHighest"),
ExplainHighestDifficulty = THEME:GetString("TabFilter", "ExplainHighestDifficulty"),
MaxRate = THEME:GetString("TabFilter", "MaxRate"),
Title = THEME:GetString("TabFilter", "Title"),
MinRate = THEME:GetString("TabFilter", "MinRate")
Expand Down Expand Up @@ -161,6 +163,13 @@ local f =
self:settext(translated_info["ExplainHighest"])
end
},
LoadFont("Common Large") ..
{
InitCommand = function(self)
self:xy(frameX, frameY + 100):zoom(0.3):halign(0)
self:settext(translated_info["ExplainHighestDifficulty"])
end
},
LoadFont("Common Large") ..
{
InitCommand = function(self)
Expand Down Expand Up @@ -286,7 +295,7 @@ local f =
},
Def.Quad {
InitCommand = function(self)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 3):zoomto(160, 18):halign(0):diffusealpha(0)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 3):zoomto(180, 18):halign(0):diffusealpha(0)
end,
MouseLeftClickMessageCommand = function(self)
if isOver(self) and active then
Expand All @@ -299,7 +308,43 @@ local f =
LoadFont("Common Large") ..
{
InitCommand = function(self)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 4):zoom(textzoom):halign(0):settext("")
self:xy(frameX + frameWidth / 2, 175 + spacingY * 4):zoom(textzoom):halign(0)
end,
SetCommand = function(self)
if FILTERMAN:GetHighestDifficultyOnly() then
self:settextf("%s: %s", translated_info["HighestDifficultyOnly"], translated_info["On"])
else
self:settextf("%s: %s", translated_info["HighestDifficultyOnly"], translated_info["Off"])
end
if FILTERMAN:GetFilterMode() then
self:diffuse(color("#666666"))
else
self:diffuse(color("#FFFFFF"))
end
end,
FilterModeChangedMessageCommand = function(self)
self:queuecommand("Set")
end,
ResetFilterMessageCommand = function(self)
self:queuecommand("Set")
end
},
Def.Quad {
InitCommand = function(self)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 4):zoomto(180, 18):halign(0):diffusealpha(0)
end,
MouseLeftClickMessageCommand = function(self)
if isOver(self) and active then
FILTERMAN:ToggleHighestDifficultyOnly()
MESSAGEMAN:Broadcast("FilterModeChanged")
whee:SongSearch("")
end
end
},
LoadFont("Common Large") ..
{
InitCommand = function(self)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 6):zoom(textzoom):halign(0):settext("")
end,
FilterResultsMessageCommand = function(self, msg)
self:settextf("%s: %i/%i", translated_info["Matches"], msg.Matches, msg.Total)
Expand All @@ -308,7 +353,7 @@ local f =
LoadFont("Common Large") ..
{
BeginCommand = function(self)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 5):zoom(textzoom):halign(0):maxwidth(300)
self:xy(frameX + frameWidth / 2, 175 + spacingY * 7):zoom(textzoom):halign(0):maxwidth(300)
self.packlistFiltering = FILTERMAN:GetFilteringCommonPacks()
self.enabled = SCREENMAN:GetTopScreen():GetName() == "ScreenNetSelectMusic"
if not self.enabled then
Expand Down Expand Up @@ -466,7 +511,7 @@ end
f[#f + 1] =
Def.Quad {
InitCommand = function(self)
self:xy(frameX + frameWidth - 150, frameY + 250):zoomto(60, 20):halign(0.5):diffuse(getMainColor("frames")):diffusealpha(
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY):zoomto(60, 20):halign(0.5):diffuse(getMainColor("frames")):diffusealpha(
0
)
end,
Expand All @@ -491,7 +536,7 @@ f[#f + 1] =
LoadFont("Common Large") ..
{
InitCommand = function(self)
self:xy(frameX + frameWidth - 150, frameY + 250):halign(0.5):zoom(0.35)
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY):halign(0.5):zoom(0.35)
self:settext(THEME:GetString("TabFilter", "Reset"))
end
}
Expand Down
6 changes: 4 additions & 2 deletions Themes/Til Death/Languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,13 @@ ExplainStartInput=Left click on the filter value to set it.
ExplainCancelInput=Right click/Start/Back to cancel input.
ExplainGrey=Greyed out values are inactive.
ExplainBounds=Using both bounds creates a range.
ExplainHighest='Highest Only' applies only to Mode: Or
ExplainHighest='Highest Skill Only' applies only to Mode: Or
ExplainHighestDifficulty='Highest Diff Only' applies only to Mode: Or
MaxRate=Max Rate
MinRate=Min Rate
Mode=Mode
HighestOnly=Highest Only
HighestOnly=Highest Skill Only
HighestDifficultyOnly=Highest Diff Only
Matches=Matches
CommonPackFilter=Common Packs Only
Length=Length
Expand Down

0 comments on commit d1428d6

Please sign in to comment.