From e72746786875728d8629af56933de8917ad2dc7b Mon Sep 17 00:00:00 2001 From: caiohsr14 Date: Sun, 5 Feb 2017 00:44:46 -0300 Subject: [PATCH 1/2] fix because the add callback was in the wrong place --- .../WifeJudgmentSpotting.lua | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua index 75c21bd8b8..c5db133828 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua @@ -88,33 +88,6 @@ local function froot(loop) end end - ---[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - **Wife deviance tracker. Basically half the point of the theme.** -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - For every doot there is an equal and opposite scoot. -]] - -local t = Def.ActorFrame{ - Name = "WifePerch", - OnCommand=function() - SCREENMAN:GetTopScreen():AddInputCallback(froot) - end, - JudgmentMessageCommand=function(self, msg) - if msg.Offset ~= nil then - dvCur = msg.Offset - jdgCur = msg.Judgment - Broadcast(MESSAGEMAN, "SpottedOffset") - end - end, -} - --- Stuff you probably shouldn't turn off, music rate string display -t[#t+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,SCREEN_CENTER_X,SCREEN_BOTTOM-10;zoom,0.35;settext,getCurRateDisplayString())} - - - --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Main listener that moves and resizes things** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -352,6 +325,34 @@ local function input(event) return false end +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Wife deviance tracker. Basically half the point of the theme.** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + For every doot there is an equal and opposite scoot. +]] + +local t = Def.ActorFrame{ + Name = "WifePerch", + OnCommand=function() + SCREENMAN:GetTopScreen():AddInputCallback(froot) + SCREENMAN:GetTopScreen():AddInputCallback(input) + end, + JudgmentMessageCommand=function(self, msg) + if msg.Offset ~= nil then + dvCur = msg.Offset + jdgCur = msg.Judgment + Broadcast(MESSAGEMAN, "SpottedOffset") + end + end, +} + +-- Stuff you probably shouldn't turn off, music rate string display +t[#t+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,SCREEN_CENTER_X,SCREEN_BOTTOM-10;zoom,0.35;settext,getCurRateDisplayString())} + + + + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **LaneCover** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -558,9 +559,6 @@ local e = Def.ActorFrame{ currentbar = ((currentbar)%barcount) + 1 playcommand(ingots[currentbar],"UpdateErrorBar") -- Update the next bar in the queue end, - OnCommand=function(self) - SCREENMAN:GetTopScreen():AddInputCallback(input) - end, DootCommand=function(self) self:RemoveChild("DestroyMe") self:RemoveChild("DestroyMe2") @@ -771,7 +769,4 @@ t[#t+1] = LoadActor("npscalc") ditto ]] - - - return t \ No newline at end of file From 7d33efe587c75a683938aeabafc1ec2bec3007d6 Mon Sep 17 00:00:00 2001 From: caiohsr14 Date: Mon, 6 Feb 2017 17:40:51 -0300 Subject: [PATCH 2/2] added movable hotkeys for basically everything else, changed the boolean/added option in player options for the current percent, added a message that shows what you are currently moving and its values, fixed up a few things --- .../WifeJudgmentSpotting.lua | 1094 +++++++++++++---- .../ScreenGameplay overlay/npscalc.lua | 193 ++- .../ScreenGameplay underlay/ScreenFilter.lua | 57 +- .../Graphics/Player combo/default.lua | 12 +- .../Graphics/Player judgment/default.lua | 12 +- Themes/Til Death/Languages/en.ini | 2 + Themes/Til Death/Scripts/01 player_config.lua | 22 +- Themes/Til Death/Scripts/02 ThemePrefs.lua | 28 + Themes/Til Death/metrics.ini | 3 +- 9 files changed, 1174 insertions(+), 249 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua index c5db133828..1fa3cbdea2 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua @@ -55,6 +55,11 @@ 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 @@ -64,22 +69,46 @@ local errorBarHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).Gamep local errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth) local wscale = errorBarFrameWidth/180 ---differential tracker, mini progress bar things +--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) @@ -93,238 +122,517 @@ end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ]] +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 input(event) - 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 - -- 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 +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 - 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 + if event.DeviceInput.button == "DeviceButton_2" then + twoPressed = not (event.type == "InputEventType_Release") end - end - -- changes miniprogressbar and differential tracker x/y - if sevenPressed and event.type ~= "InputEventType_Release"then - if event.DeviceInput.button == "DeviceButton_up" then - miniProgressBarY = miniProgressBarY - 5 - targetTrackerY = targetTrackerY - 5 - if enabledMiniBar then - mb:y(miniProgressBarY) + 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 enabledTargetTracker then + 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 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY - changed = true - end - if event.DeviceInput.button == "DeviceButton_down" then - miniProgressBarY = miniProgressBarY + 5 - targetTrackerY = targetTrackerY + 5 - if enabledMiniBar then - mb:y(miniProgressBarY) - end - if enabledTargetTracker then + 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 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY - changed = true - end - if event.DeviceInput.button == "DeviceButton_left" then - miniProgressBarX = miniProgressBarX - 5 - targetTrackerX = targetTrackerX - 5 - if enabledMiniBar then - mb:x(miniProgressBarX) + 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 enabledTargetTracker then + 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 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX = targetTrackerX - changed = true end - if event.DeviceInput.button == "DeviceButton_right" then - miniProgressBarX = miniProgressBarX + 5 - targetTrackerX = targetTrackerX + 5 - if enabledMiniBar then - mb:x(miniProgressBarX) + -- 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 enabledTargetTracker then + if event.DeviceInput.button == "DeviceButton_down" then + targetTrackerZoom = targetTrackerZoom - 0.01 if targetTrackerMode == 0 then - dt.PercentDifferential:x(targetTrackerX) + dt.PercentDifferential:zoom(targetTrackerZoom) else - dt.PBDifferential:x(targetTrackerX) + 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 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX - 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 + -- 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 - end - -- changes full progress bar x/y - if eightPressed 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 + -- 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 - -- changes full progress bar width/height - if ninePressed 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 + 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.** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -336,7 +644,17 @@ local t = Def.ActorFrame{ Name = "WifePerch", OnCommand=function() SCREENMAN:GetTopScreen():AddInputCallback(froot) - SCREENMAN:GetTopScreen():AddInputCallback(input) + 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, JudgmentMessageCommand=function(self, msg) if msg.Offset ~= nil then @@ -376,32 +694,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{ + +-- 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) + +-- moved it for better manipulation +local d = Def.ActorFrame{ InitCommand = function(self) dt = self:GetChildren() end, - 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 targetTrackerMode == 0 then d[#d+1] = LoadFont("Common Normal")..{ Name = "PercentDifferential", - InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,0.4;halign,0;valign,1), + InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,targetTrackerZoom;halign,0;valign,1), JudgmentMessageCommand=function(self,msg) local tDiff = msg.WifeDifferential if tDiff >= 0 then @@ -415,7 +723,7 @@ if targetTrackerMode == 0 then else d[#d+1] = LoadFont("Common Normal")..{ Name = "PBDifferential", - InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,0.4;halign,0;valign,1), + InitCommand=cmd(xy,targetTrackerX,targetTrackerY;zoom,targetTrackerZoom;halign,0;valign,1), JudgmentMessageCommand=function(self,msg) local tDiff = msg.WifePBDifferential if tDiff then @@ -439,13 +747,40 @@ if targetTrackerMode == 0 then } 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)** @@ -468,6 +803,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]) @@ -498,7 +837,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 @@ -507,7 +846,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 @@ -590,7 +929,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 @@ -649,7 +988,7 @@ local p = Def.ActorFrame{ } } -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).FullProgressBar then +if enabledFullBar then t[#t+1] = p end @@ -683,7 +1022,7 @@ mb = Def.ActorFrame{ } } -if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).MiniProgressBar then +if enabledMiniBar then t[#t+1] = mb end @@ -769,4 +1108,325 @@ t[#t+1] = LoadActor("npscalc") ditto ]] +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Message boxes for moving things** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + offset window esque boxes so its more intuitive to use the moving feature +]] + +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, + }, +} + 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 206a300104..65853b6b13 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 -- Generally, a smaller window will adapt faster, but a larger window will have a more stable value. local maxWindow = themeConfig:get_data().NPSDisplay.MaxWindow/2 -- this will be the maximum size of the "window" in seconds. @@ -14,7 +179,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 @@ -60,17 +224,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, @@ -189,7 +342,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) @@ -229,7 +388,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) @@ -249,7 +408,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 bacd0537e4..ade7cdd007 100644 --- a/Themes/Til Death/Graphics/Player combo/default.lua +++ b/Themes/Til Death/Graphics/Player combo/default.lua @@ -1,4 +1,4 @@ -local twoPressed = false +local threePressed = false local fourPressed = false local changed = false local c @@ -8,13 +8,13 @@ local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.C local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt"); local function input(event) - if event.DeviceInput.button == "DeviceButton_2" then - twoPressed = not (event.type == "InputEventType_Release") + 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 twoPressed then + if event.type ~= "InputEventType_Release" and threePressed then if event.DeviceInput.button == "DeviceButton_up" then y = y - 5 c.Label:y(y) @@ -51,14 +51,14 @@ local function input(event) end if event.type ~= "InputEventType_Release" and fourPressed then if event.DeviceInput.button == "DeviceButton_up" then - zoom = zoom + 0.05 + 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.05 + 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 diff --git a/Themes/Til Death/Graphics/Player judgment/default.lua b/Themes/Til Death/Graphics/Player judgment/default.lua index 6ff243fd4a..25db715d24 100644 --- a/Themes/Til Death/Graphics/Player judgment/default.lua +++ b/Themes/Til Death/Graphics/Player judgment/default.lua @@ -1,6 +1,6 @@ -- Removed all the protiming junk, it's obsoleted local onePressed = false -local threePressed = false +local twoPressed = false local changed = false local c local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX @@ -29,8 +29,8 @@ local function input(event) if event.DeviceInput.button == "DeviceButton_1" then onePressed = not (event.type == "InputEventType_Release") end - if event.DeviceInput.button == "DeviceButton_3" then - threePressed = not (event.type == "InputEventType_Release") + 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 @@ -63,14 +63,14 @@ local function input(event) changed = false end end - if event.type ~= "InputEventType_Release" and threePressed then + if event.type ~= "InputEventType_Release" and twoPressed then if event.DeviceInput.button == "DeviceButton_up" then - zoom = zoom + 0.05 + 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.05 + zoom = zoom - 0.01 c.Judgment:zoom(zoom) playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom = zoom end diff --git a/Themes/Til Death/Languages/en.ini b/Themes/Til Death/Languages/en.ini index 224a0f55cf..6bda20e077 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 @@ -127,6 +128,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. diff --git a/Themes/Til Death/Scripts/01 player_config.lua b/Themes/Til Death/Scripts/01 player_config.lua index 334791f298..857b1c2248 100644 --- a/Themes/Til Death/Scripts/01 player_config.lua +++ b/Themes/Til Death/Scripts/01 player_config.lua @@ -3,6 +3,7 @@ local defaultConfig = { JudgeType = 1, AvgScoreType = 0, GhostScoreType = 1, + DisplayPercent = true, TargetTracker = true, TargetGoal = 93, TargetTrackerMode = 0, @@ -34,14 +35,31 @@ local defaultConfig = { MiniProgressBarY = SCREEN_CENTER_Y + 34, FullProgressBarX = SCREEN_CENTER_X, FullProgressBarY = 20, + JudgeCounterX = 0, + JudgeCounterY = 0, + DisplayPercentX = 0, + DisplayPercentY = 0, + NPSDisplayX = 5, + NPSDisplayY = SCREEN_BOTTOM - 170, + NPSGraphX = 0, + NPSGraphY = SCREEN_BOTTOM - 160, + NotefieldX = 0, + NotefieldY = 0, }, GameplaySizes = { JudgeZoom = 1.0, ComboZoom = 0.6, ErrorBarWidth = 240, ErrorBarHeight = 10, - FullProgressBarWidth = 1, - FullProgressBarHeight = 1, + TargetTrackerZoom = 0.4, + FullProgressBarWidth = 1.0, + FullProgressBarHeight = 1.0, + DisplayPercentZoom = 1, + NPSDisplayZoom = 0.4, + NPSGraphWidth = 1.0, + NPSGraphHeight = 1.0, + NotefieldWidth = 1.0, + NotefieldHeight = 1.0, }, } diff --git a/Themes/Til Death/Scripts/02 ThemePrefs.lua b/Themes/Til Death/Scripts/02 ThemePrefs.lua index 77a527d6f7..70c66f44bb 100644 --- a/Themes/Til Death/Scripts/02 ThemePrefs.lua +++ b/Themes/Til Death/Scripts/02 ThemePrefs.lua @@ -103,6 +103,34 @@ function JudgmentText() return t end +function DisplayPercent() + local t = { + Name = "DisplayPercent", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = false, + ExportOnChange = true, + Choices = { THEME:GetString('OptionNames','Off'),'On'}, + LoadSelections = function(self, list, pn) + local pref = playerConfig:get_data(pn_to_profile_slot(pn)).DisplayPercent + if pref then + list[2] = true + else + list[1] = true + end + end, + SaveSelections = function(self, list, pn) + local value + value = list[2] + playerConfig:get_data(pn_to_profile_slot(pn)).DisplayPercent = value + playerConfig:set_dirty(pn_to_profile_slot(pn)) + playerConfig:save(pn_to_profile_slot(pn)) + end + } + setmetatable( t, t ) + return t +end + function TargetTracker() local t = { Name = "TargetTracker", diff --git a/Themes/Til Death/metrics.ini b/Themes/Til Death/metrics.ini index aecf707dd4..b554321eba 100644 --- a/Themes/Til Death/metrics.ini +++ b/Themes/Til Death/metrics.ini @@ -379,10 +379,11 @@ StepsTypeSetCommand=%function(self,param) \ end; \ [ScreenPlayerOptions] -LineNames="1,Rate,8,4,RS,14,5,7,10,13,JT,TT,TG,TTM,JC,EB,PI,FBP,FB,MB,SF,LC,NPS,16,BG,Life,Judge,Background,Fail,Center,Score" +LineNames="1,Rate,8,4,RS,14,5,7,10,13,JT,DP,TT,TG,TTM,JC,EB,PI,FBP,FB,MB,SF,LC,NPS,16,BG,Life,Judge,Background,Fail,Center,Score" LineCenter="conf,Center1Player" LineRS="lua,ReceptorSize()" LineJT="lua,JudgmentText()" +LineDP="lua,DisplayPercent()" LineTT="lua,TargetTracker()" LineTG="lua,TargetGoal()" LineTTM="lua,TargetTrackerMode()"