Skip to content

Commit

Permalink
Remove basic garbage from notefield board lua
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Apr 17, 2020
1 parent c05baa5 commit 08480f2
Showing 1 changed file with 9 additions and 34 deletions.
43 changes: 9 additions & 34 deletions Themes/Til Death/Graphics/Notefield board.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ local allowedCustomization = playerConfig:get_data(pn_to_profile_slot(PLAYER_1))
local padding = 20 -- 10px on each side
local arrowWidth = 64 -- until noteskin metrics are implemented...

local filterColor = color("0,0,0,0")
local filterAlphas = {
PlayerNumber_P1 = 1,
PlayerNumber_P2 = 1,
Default = 1
}

--moving notefield shenanigans
local rPressed = false
local tPressed = false
Expand Down Expand Up @@ -46,18 +39,12 @@ end

local style = GAMESTATE:GetCurrentStyle()
local cols = style:ColumnsPerPlayer()

local center1P = ((cols >= 6) or PREFSMAN:GetPreference("Center1Player"))

local styleType = ToEnumShortString(style:GetStyleType())
local filterWidth = (arrowWidth * cols) + padding

local judgeThreshold = Enum.Reverse(TapNoteScore)[ComboContinue()]
local enabled = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CBHighlight

local alpha = 0.4


local function laneHighlight()
local pn = PLAYER_1
local r = Def.ActorFrame {
Expand Down Expand Up @@ -88,7 +75,7 @@ local function laneHighlight()
else
thewidth = noteFieldWidth - 1
end
self:xy((-(arrowWidth * (cols / 2) * getNoteFieldScale(pn)) + ((i - 1) * arrowWidth * getNoteFieldScale(pn)) +(getNoteFieldScale(pn) * arrowWidth / 2)) + (i-(cols/2)-(1/2))*colWidth*(thewidth),-receptor)
self:xy((-(arrowWidth * (cols / 2) * getNoteFieldScale(pn)) + ((i - 1) * arrowWidth * getNoteFieldScale(pn)) + (getNoteFieldScale(pn) * arrowWidth / 2)) + (i-(cols/2)-(1/2))*colWidth*(thewidth),-receptor)
self:fadebottom(0.6):fadetop(0.6)
self:visible(false)
end,
Expand Down Expand Up @@ -128,38 +115,26 @@ local t =
end
}

local player = GAMESTATE:GetMasterPlayerNumber()
local pNum = (player == PLAYER_1) and 1 or 2

filterAlphas[player] = playerConfig:get_data(pn_to_profile_slot(player)).ScreenFilter
if filterAlphas[player] == nil then
filterAlphas[player] = 0
else
filterAlphas[player] = tonumber(filterAlphas[player])
end

local pos
-- [ScreenGameplay] PlayerP#Player*Side(s)X
if center1P then
pos = SCREEN_CENTER_X
local filterColor = color("0,0,0,0")
local filterAlphas = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ScreenFilter
if filterAlphas == nil then
filterAlphas = 0
else
local metricName = string.format("PlayerP%i%sX", pNum, styleType)
pos = THEME:GetMetric("ScreenGameplay", metricName)
filterAlphas = tonumber(filterAlphas)
end

t[#t + 1] =
Def.Quad {
Name = "SinglePlayerFilter",
InitCommand = function(self)
self:zoomto(filterWidth * getNoteFieldScale(player) * noteFieldWidth, SCREEN_HEIGHT * 2)
self:zoomto(filterWidth * getNoteFieldScale(PLAYER_1) * noteFieldWidth, SCREEN_HEIGHT * 2)
self:diffusecolor(filterColor)
self:diffusealpha(filterAlphas[player])
self:diffusealpha(filterAlphas)
filter = self
end,
UpdateCommand = function(self)
local player = GAMESTATE:GetMasterPlayerNumber()
noteFieldWidth = MovableValues.NotefieldWidth
self:zoomto(filterWidth * getNoteFieldScale(player) * noteFieldWidth, SCREEN_HEIGHT * 2)
self:zoomto(filterWidth * getNoteFieldScale(PLAYER_1) * noteFieldWidth, SCREEN_HEIGHT * 2)
end
}

Expand Down

0 comments on commit 08480f2

Please sign in to comment.