diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua index bbea440e6c..6bb8580390 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua @@ -39,7 +39,6 @@ local playcommand = Actor.queuecommand local settext = BitmapText.settext local Broadcast = MessageManager.Broadcast - -- Screenwide params --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- isCentered = PREFSMAN:GetPreference("Center1Player") @@ -51,6 +50,65 @@ if not isCentered then end --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- +-- Those are the X and Y for things that are going to be able to be moved with the listener +local eb -- Errorbar children +local dt -- Differential tracker children +local mb -- Minibar actor frame +local fb -- Fullbar actor frame +local dp -- Display percent actor frame + +local screen -- the screen after it is loaded +local messageBox -- the message box from when you try to move something +local judgeCounter -- pa counter actor frame + +--error bar things +local errorBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX +local errorBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY +local errorBarWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth -- felt like this is necessary in order to do stuff +local errorBarHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight +local errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth) +local wscale = errorBarFrameWidth/180 + +--percent display things +local displayPercentX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX +local displayPercentY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY +local displayPercentZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom + +--pa counter things +local judgeCounterX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX +local judgeCounterY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY + +--differential tracker things +local targetTrackerMode = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTrackerMode +local targetTrackerX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX +local targetTrackerY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY +local targetTrackerZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom + +--mini progress bar things +local miniProgressBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX +local miniProgressBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY + +--full progress bar things +local fullProgressBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX +local fullProgressBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY +local fullProgressBarWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth +local fullProgressBarHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight + +--receptor/notefield things +local noteField +local noteColumns +local noteFieldX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX +local noteFieldY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY +local noteFieldWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth +local noteFieldHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight + +--guess checking if things are enabled before changing them is good for not having a log full of errors +local enabledErrorBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ErrorBar +local enabledMiniBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).MiniProgressBar +local enabledFullBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).FullProgressBar +local enabledTargetTracker = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTracker +local enabledDisplayPercent = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).DisplayPercent +local enabledJudgeCounter = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).JudgeCounter -- restart button local function froot(loop) @@ -59,6 +117,521 @@ local function froot(loop) end end +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Main listener that moves and resizes things** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +]] +local onePressed = false +local twoPressed = false +local threePressed = false +local fourPressed = false +local fivePressed = false +local sixPressed = false +local sevenPressed = false +local eightPressed = false +local ninePressed = false +local zeroPressed = false +local qPressed = false +local wPressed = false +local ePressed = false +local rPressed = false +local tPressed = false +local yPressed = false +local uPressed = false +local iPressed = false +local oPressed = false +local pPressed = false +local changed = false + +local function firstHalfInput(event) + if getAutoplay() ~= 0 then + -- this is starting to not look pretty, might rework on this piece of code to make it look smaller / lol i had to split in two functions because it told me there were more than 60 values + if event.DeviceInput.button == "DeviceButton_1" then + onePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_2" then + twoPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_3" then + threePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_4" then + fourPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_5" then + fivePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_6" then + sixPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_7" then + sevenPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_8" then + eightPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_9" then + ninePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_0" then + zeroPressed = not (event.type == "InputEventType_Release") + end + messageBox:GetChild("judgmentPosText"):visible(onePressed):playcommand("Update") + messageBox:GetChild("judgmentSizeText"):visible(twoPressed):playcommand("Update") + messageBox:GetChild("comboPosText"):visible(threePressed):playcommand("Update") + messageBox:GetChild("comboSizeText"):visible(fourPressed):playcommand("Update") + messageBox:GetChild("errorBarPosText"):visible(fivePressed):playcommand("Update") + messageBox:GetChild("errorBarSizeText"):visible(sixPressed):playcommand("Update") + messageBox:GetChild("targetTrackerPosText"):visible(sevenPressed):playcommand("Update") + messageBox:GetChild("targetTrackerSizeText"):visible(eightPressed):playcommand("Update") + messageBox:GetChild("fullProgressBarPosText"):visible(ninePressed):playcommand("Update") + messageBox:GetChild("fullProgressBarSizeText"):visible(zeroPressed):playcommand("Update") + -- changes errorbar x/y + if fivePressed and enabledErrorBar and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + errorBarY = errorBarY - 5 + eb.Center:y(errorBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY = errorBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + errorBarY = errorBarY + 5 + eb.Center:y(errorBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY = errorBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + errorBarX = errorBarX - 5 + eb.Center:x(errorBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX = errorBarX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + errorBarX = errorBarX + 5 + eb.Center:x(errorBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX = errorBarX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes errorbar size + if sixPressed and enabledErrorBar and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + errorBarHeight = errorBarHeight + 1 + eb.Center:zoomtoheight(errorBarHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight = errorBarHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + errorBarHeight = errorBarHeight - 1 + eb.Center:zoomtoheight(errorBarHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight = errorBarHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + errorBarWidth = errorBarWidth - 10 + errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth) + wscale = errorBarFrameWidth/180 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth = errorBarWidth + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + errorBarWidth = errorBarWidth + 10 + errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth) + wscale = errorBarFrameWidth/180 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth = errorBarWidth + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes differential tracker x/y + if sevenPressed and enabledTargetTracker and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + targetTrackerY = targetTrackerY - 5 + if targetTrackerMode == 0 then + dt.PercentDifferential:y(targetTrackerY) + else + dt.PBDifferential:y(targetTrackerY) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + targetTrackerY = targetTrackerY + 5 + if targetTrackerMode == 0 then + dt.PercentDifferential:y(targetTrackerY) + else + dt.PBDifferential:y(targetTrackerY) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + targetTrackerX = targetTrackerX - 5 + if targetTrackerMode == 0 then + dt.PercentDifferential:x(targetTrackerX) + else + dt.PBDifferential:x(targetTrackerX) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX = targetTrackerX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + targetTrackerX = targetTrackerX + 5 + if targetTrackerMode == 0 then + dt.PercentDifferential:x(targetTrackerX) + else + dt.PBDifferential:x(targetTrackerX) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX = targetTrackerX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes differential tracker size + if eightPressed and enabledTargetTracker and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + targetTrackerZoom = targetTrackerZoom + 0.01 + if targetTrackerMode == 0 then + dt.PercentDifferential:zoom(targetTrackerZoom) + else + dt.PBDifferential:zoom(targetTrackerZoom) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom = targetTrackerZoom + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + targetTrackerZoom = targetTrackerZoom - 0.01 + if targetTrackerMode == 0 then + dt.PercentDifferential:zoom(targetTrackerZoom) + else + dt.PBDifferential:zoom(targetTrackerZoom) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom = targetTrackerZoom + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes full progress bar x/y + if ninePressed and enabledFullBar and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + fullProgressBarY = fullProgressBarY - 3 + fb:y(fullProgressBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY = fullProgressBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + fullProgressBarY = fullProgressBarY + 3 + fb:y(fullProgressBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY = fullProgressBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + fullProgressBarX = fullProgressBarX - 5 + fb:x(fullProgressBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX = fullProgressBarX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + fullProgressBarX = fullProgressBarX + 5 + fb:x(fullProgressBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX = fullProgressBarX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes full progress bar width/height + if zeroPressed and enabledFullBar and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + fullProgressBarHeight = fullProgressBarHeight + 0.1 + fb:zoomtoheight(fullProgressBarHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight = fullProgressBarHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + fullProgressBarHeight = fullProgressBarHeight - 0.1 + fb:zoomtoheight(fullProgressBarHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight = fullProgressBarHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + fullProgressBarWidth = fullProgressBarWidth - 0.01 + fb:zoomtowidth(fullProgressBarWidth) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth = fullProgressBarWidth + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + fullProgressBarWidth = fullProgressBarWidth + 0.01 + fb:zoomtowidth(fullProgressBarWidth) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth = fullProgressBarWidth + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + + end + return false +end + +local function secondHalfInput(event) + if getAutoplay() ~= 0 then + if event.DeviceInput.button == "DeviceButton_q" then + qPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_w" then + wPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_e" then + ePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_r" then + rPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_t" then + tPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_y" then + yPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_u" then + uPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_i" then + iPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_o" then + oPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_p" then + pPressed = not (event.type == "InputEventType_Release") + end + messageBox:GetChild("miniProgressBarPosText"):visible(qPressed):playcommand("Update") + messageBox:GetChild("displayPercentPosText"):visible(wPressed):playcommand("Update") + messageBox:GetChild("displayPercentSizeText"):visible(ePressed):playcommand("Update") + messageBox:GetChild("noteFieldPosText"):visible(rPressed):playcommand("Update") + messageBox:GetChild("noteFieldSizeText"):visible(tPressed):playcommand("Update") + messageBox:GetChild("npsDisplayPosText"):visible(yPressed):playcommand("Update") + messageBox:GetChild("npsDisplaySizeText"):visible(uPressed):playcommand("Update") + messageBox:GetChild("npsGraphPosText"):visible(iPressed):playcommand("Update") + messageBox:GetChild("npsGraphSizeText"):visible(oPressed):playcommand("Update") + messageBox:GetChild("judgeCounterPosText"):visible(pPressed):playcommand("Update") + -- changes mini progress bar x/y + if qPressed and enabledMiniBar and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + miniProgressBarY = miniProgressBarY - 5 + mb:y(miniProgressBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + miniProgressBarY = miniProgressBarY + 5 + mb:y(miniProgressBarY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + miniProgressBarX = miniProgressBarX - 5 + mb:x(miniProgressBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + miniProgressBarX = miniProgressBarX + 5 + mb:x(miniProgressBarX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes display percent x/y + if wPressed and enabledDisplayPercent and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + displayPercentY = displayPercentY - 5 + dp:addy(-5) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY = displayPercentY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + displayPercentY = displayPercentY + 5 + dp:addy(5) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY = displayPercentY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + displayPercentX = displayPercentX - 5 + dp:addx(-5) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX = displayPercentX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + displayPercentX = displayPercentX + 5 + dp:addx(5) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX = displayPercentX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes display percent size + if ePressed and enabledDisplayPercent and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + displayPercentZoom = displayPercentZoom + 0.01 + dp:zoom(displayPercentZoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom = displayPercentZoom + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + displayPercentZoom = displayPercentZoom - 0.01 + dp:zoom(displayPercentZoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom = displayPercentZoom + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes the noteField/receptor x/y + if rPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + noteFieldY = noteFieldY - 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY = noteFieldY + noteField:addy(-3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + noteFieldY = noteFieldY + 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY = noteFieldY + noteField:addy(3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + noteFieldX = noteFieldX - 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX = noteFieldX + noteField:addx(-3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + noteFieldX = noteFieldX + 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX = noteFieldX + noteField:addx(3) + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes the noteField/receptor width/height + if tPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + noteFieldHeight = noteFieldHeight + 0.01 + for i, actor in ipairs(noteColumns) do + actor:zoomtoheight(noteFieldHeight) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight = noteFieldHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + noteFieldHeight = noteFieldHeight - 0.01 + for i, actor in ipairs(noteColumns) do + actor:zoomtoheight(noteFieldHeight) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight = noteFieldHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + noteFieldWidth = noteFieldWidth - 0.01 + for i, actor in ipairs(noteColumns) do + actor:zoomtowidth(noteFieldWidth) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth = noteFieldWidth + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + noteFieldWidth = noteFieldWidth + 0.01 + for i, actor in ipairs(noteColumns) do + actor:zoomtowidth(noteFieldWidth) + end + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth = noteFieldWidth + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + -- changes pa counter x/y + if pPressed and enabledJudgeCounter and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + judgeCounterY = judgeCounterY - 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY = judgeCounterY + judgeCounter:addy(-3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + judgeCounterY = judgeCounterY + 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY = judgeCounterY + judgeCounter:addy(3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + judgeCounterX = judgeCounterX - 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX = judgeCounterX + judgeCounter:addx(-3) + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + judgeCounterX = judgeCounterX + 3 + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX = judgeCounterX + judgeCounter:addx(3) + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + end + return false +end + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Wife deviance tracker. Basically half the point of the theme.** @@ -71,6 +644,19 @@ local t = Def.ActorFrame{ Name = "WifePerch", OnCommand=function() SCREENMAN:GetTopScreen():AddInputCallback(froot) + if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then + SCREENMAN:GetTopScreen():AddInputCallback(firstHalfInput) + SCREENMAN:GetTopScreen():AddInputCallback(secondHalfInput) + screen = SCREENMAN:GetTopScreen() + noteField = screen:GetChild("PlayerP1"):GetChild("NoteField") + noteField:addx(noteFieldX) + noteField:addy(noteFieldY) + noteColumns = noteField:get_column_actors() + for i, actor in ipairs(noteColumns) do + actor:zoomtowidth(noteFieldWidth) + actor:zoomtoheight(noteFieldHeight) + end + end end, JudgmentMessageCommand=function(self, msg) if msg.Offset ~= nil then @@ -86,6 +672,7 @@ t[#t+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,SCREEN_CENTER_X,SCREEN_ + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **LaneCover** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,6 +684,7 @@ on screen so you can adjust the time arrows display on screen without modifying t[#t+1] = LoadActor("lanecover") + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Player Target Differential: Ghost target rewrite, average score gone for now** @@ -108,29 +696,22 @@ t[#t+1] = LoadActor("lanecover") -- Mostly clientside now. We set our desired target goal and listen to the results rather than calculating ourselves. local target = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetGoal GAMESTATE:GetPlayerState(PLAYER_1):SetTargetGoal(target/100) - -d = Def.ActorFrame{ - Def.Quad{InitCommand=cmd(xy,60 + mpOffset,(SCREEN_HEIGHT*0.62)-90;zoomto,60,16;diffuse,color("0,0,0,0.4");horizalign,left;vertalign,top)}, - -- Displays your current percentage score - LoadFont("Common Large")..{ - Name = "DisplayPercent", - InitCommand=cmd(xy,115 + mpOffset,220;zoom,0.3;halign,1;valign,1), - OnCommand=function(self) - self:settextf("%05.2f%%", 0) - end, - JudgmentMessageCommand=function(self,msg) - self:settextf("%05.2f%%", Floor(msg.WifePercent*100)/100) - end - }, -} -- We can save space by wrapping the personal best and set percent trackers into one function, however -- this would make the actor needlessly cumbersome and unnecessarily punish those who don't use the -- personal best tracker (although everything is efficient enough now it probably wouldn't matter) -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTrackerMode == 0 then - d[#d+1] = LoadFont("Common Normal")..{ - Name = "Set Percent Differential", - InitCommand=cmd(xy,CenterX+26,SCREEN_CENTER_Y+30;zoom,0.4;halign,0;valign,1), + +-- moved it for better manipulation +local d = Def.ActorFrame{ + InitCommand = function(self) + dt = self:GetChildren() + end, +} + +if targetTrackerMode == 0 then + d[#d+1] = LoadFont("Common Normal")..{ + Name = "PercentDifferential", + InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,targetTrackerZoom;halign,0;valign,1), JudgmentMessageCommand=function(self,msg) local tDiff = msg.WifeDifferential if tDiff >= 0 then @@ -142,9 +723,9 @@ if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTrackerMode == 0 th end } else - d[#d+1] = LoadFont("Common Normal")..{ - Name = "PB Differential", - InitCommand=cmd(xy,CenterX+26,SCREEN_CENTER_Y+30;zoom,0.4;halign,0;valign,1), + d[#d+1] = LoadFont("Common Normal")..{ + Name = "PBDifferential", + InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,targetTrackerZoom;halign,0;valign,1), JudgmentMessageCommand=function(self,msg) local tDiff = msg.WifePBDifferential if tDiff then @@ -168,13 +749,40 @@ if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTrackerMode == 0 th } end - - -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTracker then +if enabledTargetTracker then t[#t+1] = d end +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Display Percent** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Displays the current percent for the score. +]] + +local cp = Def.ActorFrame{ + InitCommand = function(self) + dp = self + self:zoom(displayPercentZoom):addx(displayPercentX):addy(displayPercentY) + end, + Def.Quad{ + InitCommand=cmd(xy,60 + mpOffset,(SCREEN_HEIGHT*0.62)-90;;zoomto, 60, 13;diffuse,color("0,0,0,0.4");horizalign,left;vertalign,top) + }, + -- Displays your current percentage score + LoadFont("Common Large")..{ + Name = "DisplayPercent", + InitCommand=cmd(xy,115 + mpOffset,220;zoom,0.3;halign,1;valign,1), + OnCommand=function(self) + self:settextf("%05.2f%%", 0) + end, + JudgmentMessageCommand=function(self,msg) + self:settextf("%05.2f%%", Floor(msg.WifePercent*100)/100) + end + }, +} +if enabledDisplayPercent then + t[#t+1] = cp +end --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Player judgment counter (aka pa counter)** @@ -197,6 +805,10 @@ local gradeFontSize = 0.45 local jdgCounts = {} -- Child references for the judge counter local j = Def.ActorFrame{ + InitCommand=function(self) + judgeCounter = self + self:addx(judgeCounterX):addy(judgeCounterY) + end, OnCommand=function(self) for i=1,#jdgT do jdgCounts[jdgT[i]] = self:GetChild(jdgT[i]) @@ -227,7 +839,7 @@ local j = Def.ActorFrame{ -- Background -j[#j+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+16;zoomto,frameWidth,frameHeight+16;diffuse,color("0,0,0,0.4");horizalign,left;vertalign,top)} +j[#j+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+13;zoomto,frameWidth,frameHeight+18;diffuse,color("0,0,0,0.4");horizalign,left;vertalign,top)} -- Build judgeboard for i=1,#jdgT do @@ -236,7 +848,7 @@ for i=1,#jdgT do end -- Now add the completed judgment table to the primary actor frame t if enabled -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).JudgeCounter then +if enabledJudgeCounter then t[#t+1] = j end @@ -252,15 +864,9 @@ end -- User Parameters --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- local barcount = 30 -- Number of bars. Older bars will refresh if judgments/barDuration exceeds this value. You don't need more than 40. -local frameX = CenterX -- X Positon (Center of the bar) -local frameY = SCREEN_CENTER_Y + 53 -- Y Positon (Center of the bar) -local frameHeight = 10 -- Height of the bar -local frameWidth = capWideScale(get43size(240),240) -- Width of the bar local barWidth = 2 -- Width of the ticks. local barDuration = 0.75 -- Time duration in seconds before the ticks fade out. Doesn't need to be higher than 1. Maybe if you have 300 bars I guess. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- - -local wscale = frameWidth/180 -- so we aren't calculating it over and over again local currentbar = 1 -- so we know which error bar we need to update local ingots = {} -- references to the error bars @@ -269,12 +875,14 @@ local ingots = {} -- references to the error bars function smeltErrorBar(index) return Def.Quad{ Name = index, - InitCommand=cmd(xy,frameX,frameY;zoomto,barWidth,frameHeight;diffusealpha,0), + InitCommand=cmd(xy,errorBarX,errorBarY;zoomto,barWidth,errorBarHeight;diffusealpha,0), UpdateErrorBarCommand=function(self) -- probably a more efficient way to achieve this effect, should test stuff later finishtweening(self) -- note: it really looks like shit without the fade out diffusealpha(self,1) diffuse(self,jcT[jdgCur]) - x(self,frameX+dvCur*wscale) + x(self,errorBarX+dvCur*wscale) + self:y(errorBarY) -- i dont know why man it doenst work the other way ( y(self,errorBarY) ) + self:zoomtoheight(errorBarHeight) linear(self,barDuration) diffusealpha(self,0) end @@ -283,6 +891,7 @@ end local e = Def.ActorFrame{ InitCommand = function(self) + eb = self:GetChildren() for i=1,barcount do -- basically the equivalent of using GetChildren() if it returned unnamed children numerically indexed ingots[#ingots+1] = self:GetChild(i) end @@ -296,18 +905,19 @@ local e = Def.ActorFrame{ self:RemoveChild("DestroyMe2") end, - -- Centerpiece - Def.Quad{InitCommand=cmd(diffuse,getMainColor('highlight');xy,frameX,frameY;zoomto,2,frameHeight)}, - + Def.Quad { + Name = "Center", + InitCommand=cmd(diffuse,getMainColor('highlight');xy,errorBarX,errorBarY;zoomto,2,errorBarHeight) + }, -- Indicates which side is which (early/late) These should be destroyed after the song starts. LoadFont("Common Normal") .. { Name = "DestroyMe", - InitCommand=cmd(xy,frameX+frameWidth/4,frameY;zoom,0.35), + InitCommand=cmd(xy,errorBarX+errorBarFrameWidth/4,errorBarY;zoom,0.35), BeginCommand=cmd(settext,"Late";diffusealpha,0;smooth,0.5;diffusealpha,0.5;sleep,1.5;smooth,0.5;diffusealpha,0), }, LoadFont("Common Normal") .. { Name = "DestroyMe2", - InitCommand=cmd(xy,frameX-frameWidth/4,frameY;zoom,0.35), + InitCommand=cmd(xy,errorBarX-errorBarFrameWidth/4,errorBarY;zoom,0.35), BeginCommand=cmd(settext,"Early";diffusealpha,0;smooth,0.5;diffusealpha,0.5;sleep,1.5;smooth,0.5;diffusealpha,0;queuecommand,"Doot"), DootCommand=function(self) self:GetParent():queuecommand("Doot") @@ -321,7 +931,7 @@ for i=1,barcount do end -- Add the completed errorbar frame to the primary actor frame t if enabled -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ErrorBar then +if enabledErrorBar then t[#t+1] = e end @@ -347,16 +957,17 @@ separate entities. So you can have both, or one or the other, or neither. -- User params --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- -local posoffset = themeConfig:get_data().global.ProgressBar * (SCREEN_BOTTOM - 50) -local frameX = CenterX -local frameY = SCREEN_BOTTOM-30 - posoffset local width = SCREEN_WIDTH/2-100 local height = 10 local alpha = 0.7 --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- -p = Def.ActorFrame{ - InitCommand=cmd(xy,frameX,frameY), +local p = Def.ActorFrame{ + InitCommand = function(self) + self:xy(fullProgressBarX,fullProgressBarY) + self:zoomto(fullProgressBarWidth,fullProgressBarHeight) + fb = self + end, Def.Quad{InitCommand=cmd(zoomto,width,height;diffuse,color("#666666");diffusealpha,alpha)}, -- background Def.SongMeterDisplay{ InitCommand=function(self) @@ -379,7 +990,7 @@ p = Def.ActorFrame{ } } -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).FullProgressBar then +if enabledFullBar then t[#t+1] = p end @@ -393,14 +1004,15 @@ end separate entities. So you can have both, or one or the other, or neither. ]] -local frameX = CenterX + 44 -local frameY = SCREEN_CENTER_Y + 34 local width = 34 local height = 4 local alpha = 0.3 -p = Def.ActorFrame{ - InitCommand=cmd(xy,frameX,frameY), +mb = Def.ActorFrame{ + InitCommand = function(self) + self:xy(miniProgressBarX,miniProgressBarY) + mb = self + end, Def.Quad{InitCommand=cmd(zoomto,width,height;diffuse,color("#666666");diffusealpha,alpha)}, -- background Def.Quad{InitCommand=cmd(x,1+width/2;zoomto,1,height;diffuse,color("#555555"))}, -- ending indicator Def.SongMeterDisplay{ @@ -412,8 +1024,8 @@ p = Def.ActorFrame{ } } -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).MiniProgressBar then - t[#t+1] = p +if enabledMiniBar then + t[#t+1] = mb end @@ -457,9 +1069,18 @@ t[#t+1] = Def.ActorFrame{ **Combo Display** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - moving here eventually ]] +local x = 0 +local y = 60 + +--This just initializes the initial point or not idk not needed to mess with this any more +function ComboTransformCommand( self, params ) + self:x( x ) + self:y( y ) +end + + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -489,6 +1110,360 @@ t[#t+1] = LoadActor("npscalc") ditto ]] - +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Message boxes for moving things** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + offset window esque boxes so its more intuitive to use the moving feature +]] +if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then +t[#t+1] = Def.ActorFrame{ + InitCommand=function(self) + messageBox = self + end, + Def.BitmapText{ + Name= "errorBarPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Error Bar Position:", + "X: " .. errorBarX, + "Y: " .. errorBarY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "errorBarSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Error Bar Size:", + "Width: " .. errorBarWidth, + "Height: " .. errorBarHeight, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "targetTrackerPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Goal Tracker Position:", + "X: " .. targetTrackerX, + "Y: " .. targetTrackerY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "targetTrackerSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Goal Tracker Size:", + "Zoom: " .. targetTrackerZoom, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "fullProgressBarPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Full Progress Bar Position:", + "X: " .. fullProgressBarX, + "Y: " .. fullProgressBarY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "fullProgressBarSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Full Progress Bar Size:", + "Width: " .. fullProgressBarWidth, + "Height: " .. fullProgressBarHeight, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "miniProgressBarPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Mini Progress Bar Position:", + "X: " .. miniProgressBarX, + "Y: " .. miniProgressBarY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "displayPercentPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Current Percent Position:", + "X: " .. displayPercentX, + "Y: " .. displayPercentY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "displayPercentSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Current Percent Size:", + "Zoom: " .. displayPercentZoom, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "noteFieldPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Notefield Position:", + "X: " .. noteFieldX, + "Y: " .. noteFieldY, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "noteFieldSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Notefield Size:", + "Width: " .. noteFieldWidth, + "Height: " .. noteFieldHeight, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "judgeCounterPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local text= { + "Judge Counter Position:", + "X: " .. judgeCounterX, + "Y: " .. judgeCounterY, + } + self:settext(table.concat(text, "\n")) + end, + }, + -- had to throw this here because it was getting x/y fucked up + Def.BitmapText{ + Name= "judgmentPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX + local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeY + local text= { + "Judgment Label Position:", + "X: " .. x, + "Y: " .. y, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "judgmentSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom + local text= { + "Judgment Label Size:", + "Zoom: " .. zoom, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "comboPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboX + local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboY + local text= { + "Combo Position:", + "X: " .. x, + "Y: " .. y, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "comboSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ComboZoom + local text= { + "Combo Size:", + "Zoom: " .. zoom, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "npsDisplayPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayX + local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayY + local text= { + "NPS Display Position:", + "X: " .. x, + "Y: " .. y, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "npsDisplaySizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSDisplayZoom + local text= { + "NPS Display Size:", + "Zoom: " .. zoom, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "npsGraphPosText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphX + local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphY + local text= { + "NPS Graph Position:", + "X: " .. x, + "Y: " .. y, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "npsGraphSizeText", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :shadowlength(2):xy(10, 20):zoom(.5):visible(false) + end, + UpdateCommand=function(self) + local width = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphWidth + local height = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphHeight + local text= { + "NPS Display Size:", + "Width: " .. width, + "Height: " .. height, + } + self:settext(table.concat(text, "\n")) + end, + }, + Def.BitmapText{ + Name= "Instructions", Font= "Common Normal", + InitCommand= function(self) + self:horizalign(left):vertalign(top) + :xy(SCREEN_WIDTH - 240, 110):zoom(.5):visible(true) + end, + OnCommand=function(self) + local text= { + "Hold the following and press the arrow", + "keys to alter the associated element\n", + "1: Judgement Text Position", + "2: Judgement Text Size", + "3: Combo Text Position", + "4: Combo Text Size", + "5: Error Bar Text Position", + "6: Error Bar Text Size", + "7: Target Tracker Text Position", + "8: Target Tracker Text Size", + "9: Full Progress Bar Position", + "0: Full Progress Bar Size", + "q: Mini Progress Bar Position", + "w: Display Percent Text Position", + "e: Display Percent Text Size", + "r: Notefield Position", + "t: Notefield Size", + "y: NPS Display Text Position", + "u: NPS Display Text Size", + "i: NPS Graph Position", + "o: NPS Graph Size", + "p: Judge Counter Position", + } + self:settext(table.concat(text, "\n")) + end + }, +} +end return t \ No newline at end of file diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/npscalc.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/npscalc.lua index 5e313fe4d3..6281e8a0db 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/npscalc.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/npscalc.lua @@ -1,5 +1,170 @@ -- A moving average NPS calculator +-- movable stuff + +--still kept this here because idk man +local enabled = { + NPSDisplay = { + PlayerNumber_P1 = GAMESTATE:IsPlayerEnabled(PLAYER_1) and playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).NPSDisplay, + PlayerNumber_P2 = GAMESTATE:IsPlayerEnabled(PLAYER_2) and playerConfig:get_data(pn_to_profile_slot(PLAYER_2)).NPSDisplay + }, + NPSGraph = { + PlayerNumber_P1 = GAMESTATE:IsPlayerEnabled(PLAYER_1) and playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).NPSGraph, + PlayerNumber_P2 = GAMESTATE:IsPlayerEnabled(PLAYER_2) and playerConfig:get_data(pn_to_profile_slot(PLAYER_2)).NPSGraph + } +} + +local npsGraphActor +local npsDisplayActor +local npsGraphX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphX +local npsGraphY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphY +local npsGraphWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphWidth +local npsGraphHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphHeight +local npsDisplayX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayX +local npsDisplayY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayY +local npsDisplayZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSDisplayZoom + +local yPressed = false +local uPressed = false +local iPressed = false +local oPressed = false + +local function displayInput(event) + if getAutoplay() ~= 0 then + if event.DeviceInput.button == "DeviceButton_y" then + yPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_u" then + uPressed = not (event.type == "InputEventType_Release") + end + if yPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + npsDisplayY = npsDisplayY - 5 + npsDisplayActor:y(npsDisplayY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayY = npsDisplayY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + npsDisplayY = npsDisplayY + 5 + npsDisplayActor:y(npsDisplayY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayY = npsDisplayY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + npsDisplayX = npsDisplayX - 5 + npsDisplayActor:x(npsDisplayX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayX = npsDisplayX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + npsDisplayX = npsDisplayX + 5 + npsDisplayActor:x(npsDisplayX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayX = npsDisplayX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + if uPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + npsDisplayZoom = npsDisplayZoom + 0.01 + npsDisplayActor:zoom(npsDisplayZoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSDisplayZoom = npsDisplayZoom + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + npsDisplayZoom = npsDisplayZoom - 0.01 + npsDisplayActor:zoom(npsDisplayZoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSDisplayZoom = npsDisplayZoom + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + end + return false +end + +local function graphInput(event) + if getAutoplay() ~= 0 then + if event.DeviceInput.button == "DeviceButton_i" then + iPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_o" then + oPressed = not (event.type == "InputEventType_Release") + end + if iPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + npsGraphY = npsGraphY - 5 + npsGraphActor:y(npsGraphY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphY = npsGraphY + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + npsGraphY = npsGraphY + 5 + npsGraphActor:y(npsGraphY) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphY = npsGraphY + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + npsGraphX = npsGraphX - 5 + npsGraphActor:x(npsGraphX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphX = npsGraphX + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + npsGraphX = npsGraphX + 5 + npsGraphActor:x(npsGraphX) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphX = npsGraphX + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + if oPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_up" then + npsGraphHeight = npsGraphHeight + 0.01 + npsGraphActor:zoomtoheight(npsGraphHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphHeight = npsGraphHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + npsGraphHeight = npsGraphHeight - 0.01 + npsGraphActor:zoomtoheight(npsGraphHeight) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphHeight = npsGraphHeight + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + npsGraphWidth = npsGraphWidth - 0.01 + npsGraphActor:zoomtowidth(npsGraphWidth) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphWidth = npsGraphWidth + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + npsGraphWidth = npsGraphWidth + 0.01 + npsGraphActor:zoomtowidth(npsGraphWidth) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphWidth = npsGraphWidth + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + end + return false +end + local debug = false local countNotesSeparately = GAMESTATE:CountNotesSeparately(); -- Generally, a smaller window will adapt faster, but a larger window will have a more stable value. @@ -15,7 +180,6 @@ if not isCentered then mpOffset = SCREEN_CENTER_X + 60 end - --Graph related stuff local initialPeak = 10 -- Initial height of the NPS graph. local graphWidth = 140 @@ -61,17 +225,6 @@ local judgeColor = { -- Colors of each Judgment types } -local enabled = { - NPSDisplay = { - PlayerNumber_P1 = GAMESTATE:IsPlayerEnabled(PLAYER_1) and playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).NPSDisplay, - PlayerNumber_P2 = GAMESTATE:IsPlayerEnabled(PLAYER_2) and playerConfig:get_data(pn_to_profile_slot(PLAYER_2)).NPSDisplay - }, - NPSGraph = { - PlayerNumber_P1 = GAMESTATE:IsPlayerEnabled(PLAYER_1) and playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).NPSGraph, - PlayerNumber_P2 = GAMESTATE:IsPlayerEnabled(PLAYER_2) and playerConfig:get_data(pn_to_profile_slot(PLAYER_2)).NPSGraph - } -} - local npsWindow = { PlayerNumber_P1 = maxWindow, PlayerNumber_P2 = maxWindow, @@ -194,7 +347,13 @@ end local function npsDisplay(pn) local t = Def.ActorFrame{ - Name = "npsDisplay"..pn; + Name = "npsDisplay"..pn, + InitCommand = function(self) + npsDisplayActor = self:GetChild("Text") + end, + OnCommand=function(self) + SCREENMAN:GetTopScreen():AddInputCallback(displayInput) + end, -- Whenever a MessageCommand is broadcasted, -- a table contanining parameters can also be passed along. JudgmentMessageCommand=function(self,params) @@ -234,7 +393,7 @@ local function npsDisplay(pn) if enabled.NPSDisplay[pn] then t[#t+1] = LoadFont("Common Normal")..{ Name="Text"; -- sets the name of this actor as "Text". this is a child of the actor "t". - InitCommand=cmd(x,textPos[pn].X;y,textPos[pn].Y;halign,0;zoom,0.40;halign,0;valign,0;shadowlength,1;settext,"0.0 NPS"); + InitCommand=cmd(x,npsDisplayX;y,npsDisplayY;halign,0;zoom,npsDisplayZoom;halign,0;valign,0;shadowlength,1;settext,"0.0 NPS"); BeginCommand=function(self) if pn == PLAYER_2 then self:x(SCREEN_WIDTH-5) @@ -254,7 +413,11 @@ end; local function npsGraph(pn) local t = Def.ActorFrame{ InitCommand=function(self) - self:xy(graphPos[pn].X,graphPos[pn].Y) + self:xy(npsGraphX,npsGraphY):zoomtoheight(npsGraphHeight):zoomtowidth(npsGraphWidth) + npsGraphActor = self + end, + OnCommand=function(self) + SCREENMAN:GetTopScreen():AddInputCallback(graphInput) end } local verts= { diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay underlay/ScreenFilter.lua b/Themes/Til Death/BGAnimations/ScreenGameplay underlay/ScreenFilter.lua index ab34fa8b0c..870e9ed82f 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay underlay/ScreenFilter.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay underlay/ScreenFilter.lua @@ -11,7 +11,48 @@ local filterAlphas = { Default = 1, } -local t = Def.ActorFrame{}; +--moving notefield shenanigans +local rPressed = false +local tPressed = false +local noteFieldWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth +local notefieldX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX +local filter + +local function input(event) + if getAutoplay() ~= 0 then + if event.DeviceInput.button == "DeviceButton_r" then + rPressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_t" then + tPressed = not (event.type == "InputEventType_Release") + end + if rPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_left" then + filter:addx(-3) + end + if event.DeviceInput.button == "DeviceButton_right" then + filter:addx(3) + end + end + if tPressed and event.type ~= "InputEventType_Release" then + if event.DeviceInput.button == "DeviceButton_left" then + noteFieldWidth = noteFieldWidth - 0.01 + filter:playcommand("Update") + end + if event.DeviceInput.button == "DeviceButton_right" then + noteFieldWidth = noteFieldWidth + 0.01 + filter:playcommand("Update") + end + end + end + return false +end + +local t = Def.ActorFrame{ + OnCommand=function() + SCREENMAN:GetTopScreen():AddInputCallback(input) + end +}; local style = GAMESTATE:GetCurrentStyle() local cols = style:ColumnsPerPlayer() @@ -43,7 +84,19 @@ if numPlayers == 1 then end t[#t+1] = Def.Quad{ Name="SinglePlayerFilter"; - InitCommand=cmd(x,pos;CenterY;zoomto,filterWidth*getNoteFieldScale(player),SCREEN_HEIGHT;diffusecolor,filterColor;diffusealpha,filterAlphas[player]); + InitCommand=function(self) + self:x(pos) + self:CenterY() + self:zoomto(filterWidth*getNoteFieldScale(player)*noteFieldWidth,SCREEN_HEIGHT) + self:diffusecolor(filterColor) + self:diffusealpha(filterAlphas[player]) + self:addx(notefieldX) + filter = self + end, + UpdateCommand=function(self) + local player = GAMESTATE:GetMasterPlayerNumber() + self:zoomto(filterWidth*getNoteFieldScale(player)*noteFieldWidth,SCREEN_HEIGHT) + end, }; else -- two players... a bit more complex. diff --git a/Themes/Til Death/Graphics/Player combo/default.lua b/Themes/Til Death/Graphics/Player combo/default.lua index 2213dbd7da..b316900318 100644 --- a/Themes/Til Death/Graphics/Player combo/default.lua +++ b/Themes/Til Death/Graphics/Player combo/default.lua @@ -1,23 +1,96 @@ +local threePressed = false +local fourPressed = false +local changed = false local c - +local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboX +local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboY +local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ComboZoom local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt"); +local function input(event) + if event.DeviceInput.button == "DeviceButton_3" then + threePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_4" then + fourPressed = not (event.type == "InputEventType_Release") + end + if event.type ~= "InputEventType_Release" and threePressed then + if event.DeviceInput.button == "DeviceButton_up" then + y = y - 5 + c.Label:y(y) + c.Number:y(y) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboY = y + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + y = y + 5 + c.Label:y(y) + c.Number:y(y) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboY = y + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + x = x - 5 + c.Label:x(x) + c.Number:x(x-4) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboX = x + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + x = x + 5 + c.Label:x(x) + c.Number:x(x-4) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboX = x + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + if event.type ~= "InputEventType_Release" and fourPressed then + if event.DeviceInput.button == "DeviceButton_up" then + zoom = zoom + 0.01 + c.Label:zoom(zoom) + c.Number:zoom(zoom - 0.1) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ComboZoom = zoom + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + zoom = zoom - 0.01 + c.Label:zoom(zoom) + c.Number:zoom(zoom - 0.1) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ComboZoom = zoom + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + return false +end + local t = Def.ActorFrame { InitCommand=cmd(vertalign,bottom), LoadFont( "Combo", "numbers" ) .. { Name="Number", - OnCommand = THEME:GetMetric("Combo", "NumberOnCommand") + InitCommand=cmd(xy,x-4,y;zoom,zoom - 0.1;halign,1;valign,1;skewx,-0.125;visible,false), }, LoadFont("Common Normal") .. { Name="Label", - OnCommand = THEME:GetMetric("Combo", "LabelOnCommand") + InitCommand=cmd(xy,x,y;zoom,zoom;diffusebottomedge,color("0.75,0.75,0.75,1");halign,0;valign,1;visible,false), }, InitCommand = function(self) c = self:GetChildren() - c.Number:visible(false) - c.Label:visible(false) end, - + OnCommand=function(self) + if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then + SCREENMAN:GetTopScreen():AddInputCallback(input) + end + end, ComboCommand=function(self, param) local iCombo = param.Combo if not iCombo or iCombo < ShowComboAt then @@ -27,8 +100,6 @@ local t = Def.ActorFrame { end c.Label:settext("COMBO") - c.Label:visible(false) - c.Number:visible(true) c.Label:visible(true) c.Number:settext(iCombo) diff --git a/Themes/Til Death/Graphics/Player judgment/default.lua b/Themes/Til Death/Graphics/Player judgment/default.lua index a21bdb038d..9042e0679b 100644 --- a/Themes/Til Death/Graphics/Player judgment/default.lua +++ b/Themes/Til Death/Graphics/Player judgment/default.lua @@ -1,6 +1,11 @@ -- Removed all the protiming junk, it's obsoleted +local onePressed = false +local twoPressed = false +local changed = false local c -local player = Var "Player" +local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX +local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeY +local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom local JudgeCmds = { TapNoteScore_W1 = THEME:GetMetric( "Judgment", "JudgmentW1Command" ), @@ -20,17 +25,79 @@ local TNSFrames = { TapNoteScore_Miss = 5; } +local function input(event) + if event.DeviceInput.button == "DeviceButton_1" then + onePressed = not (event.type == "InputEventType_Release") + end + if event.DeviceInput.button == "DeviceButton_2" then + twoPressed = not (event.type == "InputEventType_Release") + end + if event.type ~= "InputEventType_Release" and onePressed then + if event.DeviceInput.button == "DeviceButton_up" then + y = y - 5 + c.Judgment:y(y) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeY = y + changed = true + end + if event.DeviceInput.button == "DeviceButton_down" then + y = y + 5 + c.Judgment:y(y) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeY = y + changed = true + end + if event.DeviceInput.button == "DeviceButton_left" then + x = x - 5 + c.Judgment:x(x) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX = x + changed = true + end + if event.DeviceInput.button == "DeviceButton_right" then + x = x + 5 + c.Judgment:x(x) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX = x + changed = true + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + if event.type ~= "InputEventType_Release" and twoPressed then + if event.DeviceInput.button == "DeviceButton_up" then + zoom = zoom + 0.01 + c.Judgment:zoom(zoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom = zoom + end + if event.DeviceInput.button == "DeviceButton_down" then + zoom = zoom - 0.01 + c.Judgment:zoom(zoom) + playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom = zoom + end + if changed then + playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1)) + playerConfig:save(pn_to_profile_slot(PLAYER_1)) + changed = false + end + end + return false +end + local t = Def.ActorFrame { LoadActor(THEME:GetPathG("Judgment","Normal")) .. { Name="Judgment", - InitCommand=cmd(pause;visible,false), - OnCommand=THEME:GetMetric("Judgment","JudgmentOnCommand"), + InitCommand=cmd(pause;visible,false;xy,x,y;zoom,zoom), ResetCommand=cmd(finishtweening;stopeffect;visible,false), }, InitCommand = function(self) c = self:GetChildren() end, + OnCommand=function(self) + if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then + SCREENMAN:GetTopScreen():AddInputCallback(input) + end + end, JudgmentMessageCommand=function(self, param) if param.HoldNoteScore then return end diff --git a/Themes/Til Death/Languages/en.ini b/Themes/Til Death/Languages/en.ini index 224a0f55cf..2b4a5f4996 100644 --- a/Themes/Til Death/Languages/en.ini +++ b/Themes/Til Death/Languages/en.ini @@ -90,6 +90,7 @@ Suddenoffset=Suddenoffset ReceptorSize = Receptor Size JudgeType=Judge Count JudgmentText = Judgment Text +DisplayPercent = Current Percent TargetTracker = Goal Tracker TargetGoal = Tracker Goal TargetTrackerMode = Tracker mode @@ -103,6 +104,7 @@ BackgroundType = Background Type AvgScoreType = Avg. Scoretype GhostScoreType=Ghost Scoretype GhostTarget=Ghost Target +CustomizeGameplay= Customize Gameplay PaceMaker=Pacemaker Graph LaneCover=Lane Cover @@ -127,6 +129,7 @@ ReceptorSize=Receptor Size ReceptorSize = Scale the size of the receptors and notes. This will also indirectly scale your scrolling speed. JudgeType = Set Judgecount Type. JudgmentText = Show or hide text associated with judgments. +DisplayPercent = Displays the current percent for your score. TargetTracker = Enable Goal Tracker. Displays the differential between your current score and 93% of the maximum score obtainable, or pits you against your personal best. TargetGoal = Set the percentage goal for the target tracker. TargetTrackerMode = Toggle tracker mode between a set percentage and your personal best. If no PB is available it will default to your set target goal. @@ -144,6 +147,7 @@ PaceMaker=Enable Pacemaker Graph. The target graph will be the same as your ghos LaneCover=Enable lane cover which will cover a portion of the notefield. The height can be adjusted by holding down