Skip to content
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

Right click to close elements on rebirth #1276

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ local function helpMenu()
local right = gameButton == "MenuRight" or gameButton == "Right"
local left = gameButton == "MenuLeft" or gameButton == "Left"
local enter = gameButton == "Start"
local back = key == "DeviceButton_escape"
local back = key == "DeviceButton_escape" or key == "DeviceButton_right mouse button"

if up or left then
moveCursor(-1)
Expand Down Expand Up @@ -813,7 +813,7 @@ local t = Def.ActorFrame {
end,
},
},

}

return t
24 changes: 12 additions & 12 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/assetsettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ local function assetList()
if event.type ~= "InputEventType_Release" then
local btn = event.DeviceInput.button
local gbtn = event.button
if btn == "DeviceButton_escape" then
if btn == "DeviceButton_escape" or btn == "DeviceButton_right mouse button" then
-- shortcut to exit back to general
-- or back to settings screen
if prevScreen == "Settings" then
Expand All @@ -426,7 +426,7 @@ local function assetList()
local enter = gbtn == "Start"
local pageup = gbtn == "EffectUp"
local pagedown = gbtn == "EffectDown"

-- if ctrl is pressed with a number, let the general tab input handler deal with this
if char ~= nil and tonumber(char) and INPUTFILTER:IsControlPressed() then
return
Expand All @@ -452,7 +452,7 @@ local function assetList()
end
end
end

end)
end,
UpdateItemListCommand = function(self)
Expand Down Expand Up @@ -570,7 +570,7 @@ local function assetList()
if name == curPath then
curIndex = i
end

if curType == 3 then
assetWidth = judgmentWidth
else
Expand All @@ -589,7 +589,7 @@ local function assetList()
self:GetChild("Border"):zoomto(assetHeight+4,assetWidth+4)
self:GetChild("Border"):diffuse(COLORS:getColor("assetSettings", "HoveredItem")):diffusealpha(0)
end

self:y(((math.floor((i-1)/maxColumns)+1)*assetYSpacing)-10+50)
self:finishtweening()
self:tween(0.5,"TweenType_Bezier",{0,0,0,0.5,0,1,1,1})
Expand All @@ -609,7 +609,7 @@ local function assetList()
end
end
}

t[#t+1] = Def.Quad {
Name = "SelectedAssetIndicator",
InitCommand = function(self)
Expand All @@ -635,7 +635,7 @@ local function assetList()
self:queuecommand("Set")
end
}

t[#t+1] = Def.Quad {
Name = "Border",
InitCommand = function(self)
Expand Down Expand Up @@ -670,7 +670,7 @@ local function assetList()
end
end,
}

t[#t+1] = UIElements.SpriteButton(1, 1, nil) .. {
Name = "Image",
InitCommand = function(self)
Expand Down Expand Up @@ -749,7 +749,7 @@ local function assetList()
end
end,
}

t[#t+1] = Def.Sound {
Name = "Sound",
LoadAssetCommand = function(self)
Expand All @@ -760,15 +760,15 @@ local function assetList()
else
self:load("")
end

end,
CursorMovedMessageCommand = function(self, params)
if params.index == i and curType == 1 and params.prevIndex ~= i then
self:play()
end
end
}

return t
end

Expand Down Expand Up @@ -938,4 +938,4 @@ end

t[#t+1] = assetList()

return t
return t
18 changes: 9 additions & 9 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/downloads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ local function downloadsList()
if pack ~= nil then
self:diffusealpha(1)
end
end
end
end,

LoadFont("Common Normal") .. {
Expand Down Expand Up @@ -833,7 +833,7 @@ local function downloadsList()
if event.type ~= "InputEventType_Release" then
local btn = event.DeviceInput.button
local gbtn = event.button
if btn == "DeviceButton_escape" then
if btn == "DeviceButton_escape" or btn == "DeviceButton_right mouse button" then
-- shortcut to exit back to general
MESSAGEMAN:Broadcast("GeneralTabSet")
else
Expand All @@ -844,7 +844,7 @@ local function downloadsList()
local down = gbtn == "MenuDown" or gbtn == "Down"
local ctrl = INPUTFILTER:IsControlPressed()
local copypasta = btn == "DeviceButton_v" and ctrl

-- if ctrl is pressed with a number, let the general tab input handler deal with this
if char ~= nil and tonumber(char) and INPUTFILTER:IsControlPressed() then
return
Expand Down Expand Up @@ -882,7 +882,7 @@ local function downloadsList()
end
end
end

end)
end,
UpdateSearchCommand = function(self)
Expand Down Expand Up @@ -960,7 +960,7 @@ local function downloadsList()
local bg = self:GetChild("BG")
local width = actuals.MSDColumnLeftGap - actuals.NameColumnLeftGap - actuals.MSDWidth / 2
self:xy(actuals.NameColumnLeftGap, actuals.HeaderLineUpperGap + actuals.TopLipHeight)

txt:halign(0):valign(0)
bg:halign(0):valign(0)
txt:zoom(nameHeaderSize)
Expand Down Expand Up @@ -991,7 +991,7 @@ local function downloadsList()
local bg = self:GetChild("BG")
local width = actuals.MSDWidth
self:xy(actuals.MSDColumnLeftGap, actuals.HeaderLineUpperGap + actuals.TopLipHeight)

txt:valign(0)
bg:valign(0)
txt:zoom(msdHeaderSize)
Expand Down Expand Up @@ -1022,7 +1022,7 @@ local function downloadsList()
local bg = self:GetChild("BG")
local width = actuals.SizeColumnLeftGap - actuals.MSDColumnLeftGap - actuals.MSDWidth / 2
self:xy(actuals.SizeHeaderLeftGap, actuals.HeaderLineUpperGap + actuals.TopLipHeight)

txt:valign(0)
bg:valign(0)
txt:zoom(sizeHeaderSize)
Expand Down Expand Up @@ -1083,7 +1083,7 @@ local function downloadsList()
end
},
}

for i = 1, itemCount do
t[#t+1] = listItem(i)
end
Expand All @@ -1095,4 +1095,4 @@ end

t[#t+1] = downloadsList()

return t
return t
16 changes: 8 additions & 8 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/searchfilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ local function upperSection()
local foundtitle = ""
local foundsubtitle = ""
local foundgroup = ""

if artistpos ~= nil or authorpos ~= nil or
titlepos ~= nil or subtitlepos ~= nil or
mapperpos ~= nil or charterpos ~= nil or
stepperpos ~= nil or grouppos ~= nil or
packpos ~= nil then

if artistpos ~= nil then
local strend = input:find("[;]", artistpos+1)
if strend == nil then strend = #input else strend = strend-1 end
Expand Down Expand Up @@ -251,7 +251,7 @@ local function upperSection()
end

-- you know what im just going to update all the other entry fields based on this one

end,
-- "Title Search"
function(input)
Expand Down Expand Up @@ -436,7 +436,7 @@ local function upperSection()
end
if searchentry.Group ~= "" then
finalstr = finalstr .. "group="..searchentry.Group..";"
end
end
end
self:GetChild("RowFrame_1"):GetChild("RowInput"):settext(finalstr)
end
Expand Down Expand Up @@ -468,7 +468,7 @@ local function upperSection()
changeFocus(1)
elseif event.type == "InputEventType_FirstPress" and (btn == "DeviceButton_tab" and shift) or btn == "DeviceButton_up" then
changeFocus(-1)
elseif btn == "DeviceButton_escape" then
elseif btn == "DeviceButton_escape" or btn == "DeviceButton_right mouse button" then
-- shortcut to escape out of search without searching
MESSAGEMAN:Broadcast("GeneralTabSet")
else
Expand Down Expand Up @@ -1066,8 +1066,8 @@ local function lowerSection()
else
return
end
minrate = clamp(clamp(minrate + increment, 0.7, FILTERMAN:GetMaxFilterRate()), 0.7, 3)

minrate = clamp(clamp(minrate + increment, 0.7, FILTERMAN:GetMaxFilterRate()), 0.7, 3)
FILTERMAN:SetMinFilterRate(minrate)
self:playcommand("UpdateText")
end,
Expand Down Expand Up @@ -1218,4 +1218,4 @@ t[#t+1] = Def.Quad {
t[#t+1] = upperSection()
t[#t+1] = lowerSection()

return t
return t
7 changes: 4 additions & 3 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ local function leftFrame()
local left = gameButton == "MenuLeft" or gameButton == "Left"
local enter = gameButton == "Start"
local ctrl = INPUTFILTER:IsBeingPressed("left ctrl") or INPUTFILTER:IsBeingPressed("right ctrl")
local back = key == "DeviceButton_escape"
local back = key == "DeviceButton_escape" or key == "DeviceButton_right mouse button"
local rightclick = key == "DeviceButton_right mouse button"
local leftclick = key == "DeviceButton_left mouse button"

Expand Down Expand Up @@ -2048,14 +2048,15 @@ local function leftFrame()
local rightclick = key == "DeviceButton_right mouse button"
local leftclick = key == "DeviceButton_left mouse button"

if back then
if back or rightclick then
if selectionstate == "editing" then
-- pressing back while editing moves back to element seletion
switchSelectionState("element")
else
-- shortcut to exit back to settings
-- press twice to exit back to general
MESSAGEMAN:Broadcast("PlayerInfoFrameTabSet", {tab = "Settings"})
-- goUpOneLayer()
end
elseif selectionstate == "editing" then
-- editing a color, typing only on the color
Expand Down Expand Up @@ -6797,7 +6798,7 @@ local function rightFrame()
local enter = gameButton == "Start"
local ctrl = INPUTFILTER:IsBeingPressed("left ctrl") or INPUTFILTER:IsBeingPressed("right ctrl")
local previewbutton = key == "DeviceButton_space"
local back = key == "DeviceButton_escape"
local back = key == "DeviceButton_escape" or key == "DeviceButton_right mouse button"

if up then
cursorUp(1)
Expand Down