diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua index d2fcc24e2c..d8d1f80b08 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua @@ -27,6 +27,8 @@ local dvCur local jdgCur -- Note: only for judgments with OFFSETS, might reorganize a bit later local tDiff local wifey +local curMeanSum = 0 +local curMeanCount = 0 local judgect local pbtarget local positive = getMainColor("positive") @@ -146,6 +148,7 @@ local enabledMiniBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).MiniP 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 enabledDisplayMean = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).DisplayMean local enabledJudgeCounter = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).JudgeCounter local leaderboardEnabled = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).leaderboardEnabled and DLMAN:IsLoggedIn() local isReplay = GAMESTATE:GetPlayerState():GetPlayerController() == "PlayerController_Replay" @@ -247,6 +250,10 @@ local t = jdgct = msg.Val if msg.Offset ~= nil then dvCur = msg.Offset + if not msg.HoldNoteScore and msg.Offset < 1000 then + curMeanSum = curMeanSum + msg.Offset + curMeanCount = curMeanCount + 1 + end else dvCur = nil end @@ -263,6 +270,8 @@ local t = jdgct = 0 dvCur = nil jdgCur = nil + curMeanSum = 0 + curMeanCount = 0 self:playcommand("SpottedOffset") end } @@ -426,6 +435,58 @@ if enabledDisplayPercent then t[#t + 1] = cp end +--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + **Display Mean** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Displays the current mean for the score. +]] +local dpm = Def.ActorFrame { + Name = "DisplayMean", + InitCommand = function(self) + if (allowedCustomization) then + Movable.DeviceButton_comma.element = self + Movable.DeviceButton_m.element = self + Movable.DeviceButton_comma.condition = enabledDisplayMean + Movable.DeviceButton_m.condition = enabledDisplayMean + Movable.DeviceButton_comma.Border = self:GetChild("Border") + Movable.DeviceButton_m.Border = self:GetChild("Border") + end + self:zoom(MovableValues.DisplayMeanZoom):x(MovableValues.DisplayMeanX):y(MovableValues.DisplayMeanY) + end, + Def.Quad { + InitCommand = function(self) + self:zoomto(60, 13):diffuse(color("0,0,0,0.4")):halign(1):valign(0) + end + }, + -- Displays your current mean score + LoadFont("Common Large") .. { + Name = "DisplayPercent", + InitCommand = function(self) + self:zoom(0.3):halign(1):valign(0) + end, + OnCommand = function(self) + if allowedCustomization then + self:settextf("%5.2fms", -10000) + setBorderAlignment(self:GetParent():GetChild("Border"), 1, 0) + setBorderToText(self:GetParent():GetChild("Border"), self) + end + self:settextf("%5.2fms", 0) + end, + SpottedOffsetCommand = function(self) + local mean = curMeanSum / curMeanCount + if curMeanCount == 0 then + mean = 0 + end + self:settextf("%5.2fms", mean) + end + }, + MovableBorder(100, 13, 1, 0, 0) +} + +if enabledDisplayMean then + t[#t + 1] = dpm +end + --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Player judgment counter (aka pa counter)** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Themes/Til Death/Languages/en.ini b/Themes/Til Death/Languages/en.ini index dc3ee13e8b..bff89cd803 100644 --- a/Themes/Til Death/Languages/en.ini +++ b/Themes/Til Death/Languages/en.ini @@ -90,6 +90,7 @@ JudgeType=Judge Count JudgmentText = Judgment Text ComboText = Combo Text DisplayPercent = Current Percent +DisplayMean = Current Mean TargetTracker = Goal Tracker TargetGoal = Tracker Goal TargetTrackerMode = Tracker mode @@ -137,6 +138,7 @@ JudgeType = Set Judgecount Type. JudgmentText = Show or hide text associated with judgments. ComboText = Show or hide text associated with your combo. DisplayPercent = Displays the current percent for your score. +DisplayMean = Displays the current mean 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. @@ -216,6 +218,8 @@ FullProgressBarSize=Full Progress Bar Size MiniProgressBarPosition=Mini Progress Bar Position DisplayPercentPosition=Display Percent Text Position DisplayPercentSize=Display Percent Text Size +DisplayMeanPosition=Display Mean Text Position +DisplayMeanSize=Display Mean Text Size NotefieldPosition=Notefield Position NotefieldSize=Notefield Size NPSDisplayPosition=NPS Display Text Position diff --git a/Themes/Til Death/Scripts/01 player_config.lua b/Themes/Til Death/Scripts/01 player_config.lua index 6d82bfad1f..dffeeccc4c 100644 --- a/Themes/Til Death/Scripts/01 player_config.lua +++ b/Themes/Til Death/Scripts/01 player_config.lua @@ -15,6 +15,8 @@ local defaultGameplayCoordinates = { JudgeCounterY = SCREEN_CENTER_Y, DisplayPercentX = SCREEN_CENTER_X - 170, DisplayPercentY = SCREEN_CENTER_Y - 60, + DisplayMeanX = SCREEN_CENTER_X - 170, + DisplayMeanY = SCREEN_CENTER_Y - 75, NPSDisplayX = 5, NPSDisplayY = SCREEN_BOTTOM - 175, NPSGraphX = 0, @@ -46,6 +48,7 @@ local defaultGameplaySizes = { FullProgressBarWidth = 1.0, FullProgressBarHeight = 1.0, DisplayPercentZoom = 1, + DisplayMeanZoom = 1, NPSDisplayZoom = 0.4, NPSGraphWidth = 1.0, NPSGraphHeight = 1.0, @@ -71,6 +74,7 @@ local defaultConfig = { AvgScoreType = 0, GhostScoreType = 1, DisplayPercent = true, + DisplayMean = false, TargetTracker = true, TargetGoal = 93, TargetTrackerMode = 0, diff --git a/Themes/Til Death/Scripts/02 CustomizeGameplay.lua b/Themes/Til Death/Scripts/02 CustomizeGameplay.lua index e4deafb73c..3f6f6c7f2b 100644 --- a/Themes/Til Death/Scripts/02 CustomizeGameplay.lua +++ b/Themes/Til Death/Scripts/02 CustomizeGameplay.lua @@ -29,6 +29,9 @@ local function loadValuesTable() MovableValues.DisplayPercentX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].DisplayPercentX MovableValues.DisplayPercentY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].DisplayPercentY MovableValues.DisplayPercentZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].DisplayPercentZoom + MovableValues.DisplayMeanX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].DisplayMeanX + MovableValues.DisplayMeanY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].DisplayMeanY + MovableValues.DisplayMeanZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].DisplayMeanZoom MovableValues.NotefieldX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].NotefieldX MovableValues.NotefieldY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].NotefieldY MovableValues.NotefieldWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].NotefieldWidth @@ -862,6 +865,45 @@ Movable = { inc = -1 }, }, + DeviceButton_m = { + name = "DisplayMean", + textHeader = "Current Mean Position:", + element = {}, + properties = {"X", "Y"}, + elementTree = "GameplayXYCoordinates", + DeviceButton_up = { + property = "Y", + inc = -5 + }, + DeviceButton_down = { + property = "Y", + inc = 5 + }, + DeviceButton_left = { + property = "X", + inc = -5 + }, + DeviceButton_right = { + property = "X", + inc = 5 + } + }, + DeviceButton_comma = { + name = "DisplayMean", + textHeader = "Current Mean Size:", + element = {}, + properties = {"Zoom"}, + elementTree = "GameplaySizes", + DeviceButton_up = { + property = "Zoom", + inc = 0.01 + }, + DeviceButton_down = { + property = "Zoom", + inc = -0.01 + } + } + } local function updatetext(button) diff --git a/Themes/Til Death/Scripts/02 OptionsMenu.lua b/Themes/Til Death/Scripts/02 OptionsMenu.lua index 1ca2e402c5..4f8a55aaca 100644 --- a/Themes/Til Death/Scripts/02 OptionsMenu.lua +++ b/Themes/Til Death/Scripts/02 OptionsMenu.lua @@ -1,7 +1,7 @@ function getPlayerOptionsList(itemSet) local Items = { ["Main"] = "Speed,RateList,NoteSk,RS,PRAC,CG,ScrollDir,Center,Persp,LC,BG,SF,Background,Judge,Life,Fail,Assist,Score", - ["Theme"] = "CBHL,JT,CT,DP,TT,TG,TTM,JC,EB,EBC,PI,FBP,FB,MB,LEADB,NPS", + ["Theme"] = "CBHL,JT,CT,DP,DM,TT,TG,TTM,JC,EB,EBC,PI,FBP,FB,MB,LEADB,NPS", ["Effect"] = "Persp,App,GHO,SHO,Acc,Hide,Effect1,Effect2,Scroll,Turn,Insert,R1,R2,Holds,Mines" } return Items[itemSet] .. ",NextScr" diff --git a/Themes/Til Death/Scripts/02 ThemePrefs.lua b/Themes/Til Death/Scripts/02 ThemePrefs.lua index ae2ae2a6ef..18257ac8ca 100644 --- a/Themes/Til Death/Scripts/02 ThemePrefs.lua +++ b/Themes/Til Death/Scripts/02 ThemePrefs.lua @@ -205,6 +205,34 @@ function DisplayPercent() return t end +function DisplayMean() + local t = { + Name = "DisplayMean", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = false, + ExportOnChange = true, + Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")}, + LoadSelections = function(self, list, pn) + local pref = playerConfig:get_data(pn_to_profile_slot(pn)).DisplayMean + 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)).DisplayMean = 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 c9f0a25192..0d882f9ccf 100644 --- a/Themes/Til Death/metrics.ini +++ b/Themes/Til Death/metrics.ini @@ -338,6 +338,7 @@ LineCBHL="lua,CBHighlight()" LineJT="lua,JudgmentText()" LineCT="lua,ComboText()" LineDP="lua,DisplayPercent()" +LineDM="lua,DisplayMean()" LineTT="lua,TargetTracker()" LineTG="lua,TargetGoal()" LineTTM="lua,TargetTrackerMode()"