Skip to content

Commit

Permalink
fix til death filter buttons not functioning
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 5, 2021
1 parent daf0e6e commit 7b23352
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ end
local numbersafterthedecimal = 0

local hoverAlpha = 0.6
local instantSearch = themeConfig:get_data().global.InstantSearch

local function FilterInput(event)
if event.type ~= "InputEventType_Release" and ActiveSS > 0 and active then
Expand Down Expand Up @@ -178,6 +179,7 @@ local f = Def.ActorFrame {
self:settext(translated_info["ExplainBounds"])
end
},
--[[ -- hiding extra unnecessary information
LoadFont("Common Large") .. {
InitCommand = function(self)
self:xy(frameX, frameY + 80 -17):zoom(0.3):halign(0)
Expand All @@ -190,6 +192,7 @@ local f = Def.ActorFrame {
self:settext(translated_info["ExplainHighestDifficulty"])
end
},
]]
UIElements.TextToolTip(1, 1, "Common Large") ..{
InitCommand = function(self)
self:xy(frameX + frameWidth / 2, 175):zoom(textzoom):halign(0)
Expand Down Expand Up @@ -581,13 +584,25 @@ local function CreateFilterInputBox(i)
end

--reset button
f[#f + 1] = UIElements.QuadButton(1, 1) .. {
f[#f + 1] = UIElements.TextButton(1, 1, "Common Large") .. {
InitCommand = function(self)
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY * 2):zoomto(60, 20):halign(0.5):diffuse(getMainColor("frames")):diffusealpha(
0
)
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY * 2)
local txt = self:GetChild("Text")
local bg = self:GetChild("BG")
txt:zoom(0.35)
txt:settext(THEME:GetString("TabFilter", "Reset"))
txt:diffuse(getMainColor("positive"))
bg:zoomto(60, 20)
end,
MouseDownCommand = function(self, params)
RolloverUpdateCommand = function(self, params)
if params.update == "in" then
self:diffusealpha(hoverAlpha)
else
self:diffusealpha(1)
end
end,
ClickCommand = function(self, params)
if params.update ~= "OnMouseDown" then return end
if params.event == "DeviceButton_left mouse button" and active then
FILTERMAN:ResetAllFilters()
for i = 1, #ms.SkillSets + 2 do
Expand All @@ -603,21 +618,37 @@ f[#f + 1] = UIElements.QuadButton(1, 1) .. {
SCREENMAN:set_input_redirected(PLAYER_1, false)
whee:SongSearch("")
end
end
end,
}
f[#f + 1] = UIElements.TextToolTip(1, 1, "Common Large") .. {
--[[
-- apply button
f[#f + 1] = UIElements.TextButton(1, 1, "Common Large") .. {
InitCommand = function(self)
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY * 2):halign(0.5):zoom(0.35)
self:settext(THEME:GetString("TabFilter", "Reset"))
self:diffuse(getMainColor("positive"))
self:xy(frameX + frameWidth - 150, frameY + 250 + spacingY * -1)
local txt = self:GetChild("Text")
local bg = self:GetChild("BG")
txt:zoom(0.35)
txt:settext(THEME:GetString("TabFilter", "Apply"))
txt:diffuse(getMainColor("positive"))
bg:zoomto(60, 20)
end,
MouseOverCommand = function(self)
self:diffusealpha(hoverAlpha)
RolloverUpdateCommand = function(self, params)
if params.update == "in" then
self:diffusealpha(hoverAlpha)
else
self:diffusealpha(1)
end
end,
MouseOutCommand = function(self)
self:diffusealpha(1)
ClickCommand = function(self, params)
if params.update ~= "OnMouseDown" then return end
if params.event == "DeviceButton_left mouse button" and active then
MESSAGEMAN:Broadcast("NumericInputEnded")
SCREENMAN:set_input_redirected(PLAYER_1, false)
whee:SongSearch("")
end
end,
}
]]

for i = 1, (#ms.SkillSets + 2) do
f[#f + 1] = CreateFilterInputBox(i)
Expand Down
5 changes: 3 additions & 2 deletions Themes/Til Death/Languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,9 @@ Matches=Matches
CommonPackFilter=Common Packs Only
Length=Length
Reset=Reset
AND=AND
OR=OR
Apply=Apply
AND=ALL
OR=ANY
[TabGoals]
PriorityLong=Priority
Expand Down
5 changes: 3 additions & 2 deletions Themes/Til Death/Languages/zh.ini
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,9 @@ Matches=匹配
CommonPackFilter=只搜索共同的曲包
Length=時長
Reset=重置
AND=並且
OR=或者
Apply=确认
AND=全部
OR=任何
[TabGoals]
PriorityLong=優先度
Expand Down

0 comments on commit 7b23352

Please sign in to comment.