Skip to content

Commit

Permalink
Add BPM & Rate Text to CustomizeGameplay
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 13, 2019
1 parent 5e60a9f commit 7f1d23a
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,28 @@ end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]
t[#t + 1] =
Def.ActorFrame {
Name = "MusicRate",
InitCommand = function(self)
if (allowedCustomization) then
Movable.DeviceButton_v.element = self
Movable.DeviceButton_b.element = self
Movable.DeviceButton_v.condition = true
Movable.DeviceButton_b.condition = true
Movable.DeviceButton_v.Border = self:GetChild("Border")
Movable.DeviceButton_b.Border = self:GetChild("Border")
end
self:xy(MovableValues.MusicRateX, MovableValues.MusicRateY):zoom(MovableValues.MusicRateZoom)
end,
LoadFont("Common Normal") ..
{
InitCommand = function(self)
self:xy(SCREEN_CENTER_X, SCREEN_BOTTOM - 10):zoom(0.35):settext(getCurRateDisplayString())
self:zoom(0.35):settext(getCurRateDisplayString())
end,
OnCommand = function(self)
if allowedCustomization then
setBorderToText(self:GetParent():GetChild("Border"), self)
end
end,
SetRateCommand = function(self)
self:settext(getCurRateDisplayString())
Expand All @@ -850,7 +868,9 @@ t[#t + 1] =
CurrentRateChangedMessageCommand = function(self)
self:playcommand("SetRate")
end
}
},
MovableBorder(100, 13, 1, 0, 0)
}

--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**BPM Display**
Expand All @@ -870,7 +890,17 @@ end

t[#t + 1] =
Def.ActorFrame {
Name = "BPMText",
InitCommand = function(self)
if (allowedCustomization) then
Movable.DeviceButton_x.element = self
Movable.DeviceButton_c.element = self
Movable.DeviceButton_x.condition = true
Movable.DeviceButton_c.condition = true
Movable.DeviceButton_x.Border = self:GetChild("Border")
Movable.DeviceButton_c.Border = self:GetChild("Border")
end
self:x(MovableValues.BPMTextX):y(MovableValues.BPMTextY):zoom(MovableValues.BPMTextZoom)
BPM = self:GetChild("BPM")
if #GAMESTATE:GetCurrentSong():GetTimingData():GetBPMs() > 1 then -- dont bother updating for single bpm files
self:SetUpdateFunction(UpdateBPM)
Expand All @@ -883,7 +913,12 @@ t[#t + 1] =
{
Name = "BPM",
InitCommand = function(self)
self:x(SCREEN_CENTER_X):y(SCREEN_BOTTOM - 20):halign(0.5):zoom(0.40)
self:halign(0.5):zoom(0.40)
end,
OnCommand = function(self)
if allowedCustomization then
setBorderToText(self:GetParent():GetChild("Border"), self)
end
end
},
DoneLoadingNextSongMessageCommand = function(self)
Expand All @@ -901,7 +936,8 @@ t[#t + 1] =
end,
PracticeModeReloadMessageCommand = function(self)
self:playcommand("CurrentRateChanged")
end
end,
MovableBorder(40, 13, 1, 0, 0)
}

--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ return Def.ActorFrame {
"h: Replay Buttons Spacing",
"j: Lifebar Position",
"k: Lifebar Size",
"l: Lifebar Rotation"
"l: Lifebar Rotation",
"x: BPM Text Position",
"c: BPM Text Size",
"v: Music Rate Text Position",
"b: Music Rate Text Size"
}
if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).LaneCover ~= 0 then
local selectStr = THEME:GetString("GameButton", "Select")
Expand Down
10 changes: 8 additions & 2 deletions Themes/Til Death/Scripts/01 player_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ local defaultGameplayCoordinates = {
LifeP1Y = 10,
LifeP1Rotation = 0,
PracticeCDGraphX = 10,
PracticeCDGraphY = 85
PracticeCDGraphY = 85,
BPMTextX = SCREEN_CENTER_X,
BPMTextY = SCREEN_BOTTOM - 20,
MusicRateX = SCREEN_CENTER_X,
MusicRateY = SCREEN_BOTTOM - 10
}

local defaultGameplaySizes = {
Expand All @@ -55,7 +59,9 @@ local defaultGameplaySizes = {
LifeP1Width = 1.0,
LifeP1Height = 1.0,
PracticeCDGraphWidth = 0.8,
PracticeCDGraphHeight = 1
PracticeCDGraphHeight = 1,
MusicRateZoom = 1.0,
BPMTextZoom = 1.0
}

local defaultConfig = {
Expand Down
83 changes: 83 additions & 0 deletions Themes/Til Death/Scripts/02 CustomizeGameplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ local function loadValuesTable()
MovableValues.PracticeCDGraphY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].PracticeCDGraphY
MovableValues.PracticeCDGraphHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].PracticeCDGraphHeight
MovableValues.PracticeCDGraphWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].PracticeCDGraphWidth
MovableValues.BPMTextX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].BPMTextX
MovableValues.BPMTextY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].BPMTextY
MovableValues.BPMTextZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].BPMTextZoom
MovableValues.MusicRateX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].MusicRateX
MovableValues.MusicRateY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates[keymode].MusicRateY
MovableValues.MusicRateZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes[keymode].MusicRateZoom

end

function setMovableKeymode(key)
Expand Down Expand Up @@ -758,6 +765,82 @@ Movable = {
inc = 0.01
}
},]]
DeviceButton_x = {
name = "BPMText",
textHeader = "BPM Text 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_c = {
name = "BPMText",
textHeader = "BPM Text Size:",
element = {},
properties = {"Zoom"},
elementTree = "GameplaySizes",
DeviceButton_up = {
property = "Zoom",
inc = 0.01
},
DeviceButton_down = {
property = "Zoom",
inc = -0.01
}
},
DeviceButton_v = {
name = "MusicRate",
textHeader = "Music Rate 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_b = {
name = "MusicRate",
textHeader = "Music Rate Size:",
element = {},
properties = {"Zoom"},
elementTree = "GameplaySizes",
DeviceButton_up = {
property = "Zoom",
inc = 0.01
},
DeviceButton_down = {
property = "Zoom",
inc = -0.01
}
},
}

local function updatetext(button)
Expand Down

0 comments on commit 7f1d23a

Please sign in to comment.