diff --git a/assets/data/stages/test.lua b/assets/data/stages/test.lua index 1c76f1d6..02ba156d 100644 --- a/assets/data/stages/test.lua +++ b/assets/data/stages/test.lua @@ -18,7 +18,9 @@ function create() bg.velocity:set(20, 20) add(bg) - local ground = ActorSprite(270, 460, 300, paths.getImage('menus/menuDesat')) + local ground = ActorSprite(270, 460, 300, paths.getImage('menus/menuBG')) + ground.color = Color.BLACK + ground.alpha = 1 / 3 ground:updateHitbox() ground.fov, ground.scale.x, ground.scale.y = 40, 2, 2 ground.rotation.x = -90 diff --git a/assets/images/menus/menuBG.png b/assets/images/menus/menuBG.png index 35458e80..77dc3020 100644 Binary files a/assets/images/menus/menuBG.png and b/assets/images/menus/menuBG.png differ diff --git a/assets/images/menus/menuBGBlue.png b/assets/images/menus/menuBGBlue.png deleted file mode 100644 index b4a8f1ba..00000000 Binary files a/assets/images/menus/menuBGBlue.png and /dev/null differ diff --git a/assets/images/menus/menuBGMagenta.png b/assets/images/menus/menuBGMagenta.png deleted file mode 100644 index 0a295e5d..00000000 Binary files a/assets/images/menus/menuBGMagenta.png and /dev/null differ diff --git a/assets/images/menus/menuDesat.png b/assets/images/menus/menuDesat.png deleted file mode 100644 index 9f440340..00000000 Binary files a/assets/images/menus/menuDesat.png and /dev/null differ diff --git a/funkin/init.lua b/funkin/init.lua index 3c77e5fa..29e0953a 100644 --- a/funkin/init.lua +++ b/funkin/init.lua @@ -355,11 +355,11 @@ function funkin.throwError(msg) interactTxt = interactTxt .. "\nPress ESC to quit" interactTxt = interactTxt .. "\nPress Ctrl+R to restart" - local menuDesat, funkinLogo, fnfFont18, fnfFont20 + local menuBG, funkinLogo, fnfFont18, fnfFont20 local bgMusic, missSfx function firstPass() - menuDesat = paths.getImage("menus/menuDesat") + menuBG = paths.getImage("menus/menuBG") funkinLogo = paths.getImage("menus/splashscreen/FNFLOVE_logo") fnfFont18 = paths.getFont("phantommuff.ttf", 18) or love.graphics.setNewFont(18) fnfFont20 = paths.getFont("phantommuff.ttf", 35) or love.graphics.setNewFont(35) @@ -378,21 +378,23 @@ function funkin.throwError(msg) local dontDraw = false local __error__, __align__, focused = "[ ERROR ]", "left" local scale1, scale2, gameW, gameH, hgameW, hgameH, retval - local menuDesatW, menuDesatH, funkinLogoW, funkinLogoH + local menuBGW, menuBGH, funkinLogoW, funkinLogoH local function draw(force) if not force and dontDraw then return end - love.graphics.clear(0, 0, 0) + love.graphics.clear(87 / 255, 38 / 255, 65 / 255) hgameW, hgameH = gameW / 2, gameH / 2 - menuDesatW, menuDesatH = menuDesat:getWidth(), menuDesat:getHeight() + menuBGW, menuBGH = menuBG:getWidth(), menuBG:getHeight() funkinLogoW, funkinLogoH = funkinLogo:getWidth(), funkinLogo:getHeight() - scale1 = math.max(gameW / menuDesatW, gameH / menuDesatH) + scale1 = math.max(gameW / menuBGW, gameH / menuBGH) scale2 = math.max(math.min(gameW, 1600) / funkinLogoW, math.min(gameH, 900) / funkinLogoH) * 0.525 - love.graphics.setColor(0.2, 0.2, 0.2) - love.graphics.draw(menuDesat, hgameW, hgameH, 0, scale1, scale1, menuDesatW / 2, menuDesatH / 2) + love.graphics.setColor(23 / 255, 40 / 255, 56 / 255) + love.graphics.draw(menuBG, hgameW, hgameH, 0, scale1, scale1, menuBGW / 2, menuBGH / 2) + + love.graphics.setColor(0.4, 0.4, 0.4) love.graphics.draw(funkinLogo, (hgameW * 2) - (scale2 * funkinLogoW / 1.8) - 64, hgameH, 0, scale2, scale2, funkinLogoW / 2, funkinLogoH / 2) love.graphics.setColor(1, 1, 1) diff --git a/funkin/states/credits.lua b/funkin/states/credits.lua index 747b960c..0c8bcf73 100644 --- a/funkin/states/credits.lua +++ b/funkin/states/credits.lua @@ -276,7 +276,9 @@ function CreditsState:enter() game.camera:follow(self.camFollow, nil, 8) game.camera:snapToTarget() - self.bg = Sprite(0, 0, paths.getImage("menus/menuDesat")) + game.camera.bgColor = Color.fromString("#E1E1E1") + self.bg = Sprite(0, 0, paths.getImage("menus/menuBG")) + self.bg.color = Color.fromString("#8C8C8C") self:add(util.responsiveBG(self.bg)) self.bd = BackDrop(128) @@ -306,7 +308,8 @@ function CreditsState:enter() self:changeSelection() local colorBG = Color.fromString(self.userList:getSelected().color or "#DF7B29") - self.bg.color = colorBG + game.camera.bgColor = Color.multiply(colorBG, Color.fromString("#E1E1E1")) + self.bg.color = Color.multiply(colorBG, Color.fromString("#8C8C8C")) self.bd.color = Color.saturate(self.bg.color, 0.4) self.throttles = {} @@ -377,8 +380,9 @@ function CreditsState:update(dt) end local colorBG = Color.fromString(self.userList:getSelected().color or "#DF7B29") - self.bg.color = Color.lerpDelta(self.bg.color, colorBG, 3, dt) - self.bd.color = Color.saturate(self.bg.color, 0.4) + game.camera.bgColor = Color.lerpDelta(game.camera.bgColor, Color.multiply(colorBG, Color.fromString("#E1E1E1")), 3, dt) + self.bg.color = Color.lerpDelta(self.bg.color, Color.multiply(colorBG, Color.fromString("#8C8C8C")), 3, dt) + self.bd.color = Color.lerpDelta(self.bd.color, Color.saturate(colorBG, 0.4), 3, dt) end function CreditsState:changeSelection(n) diff --git a/funkin/states/freeplay.lua b/funkin/states/freeplay.lua index 27e03eb2..845593f4 100644 --- a/funkin/states/freeplay.lua +++ b/funkin/states/freeplay.lua @@ -24,7 +24,9 @@ function FreeplayState:enter() self.persistentUpdate = true self.persistentDraw = true - self.bg = Sprite(0, 0, paths.getImage('menus/menuDesat')) + game.camera.bgColor = Color.fromString("#E1E1E1") + self.bg = Sprite(0, 0, paths.getImage('menus/menuBG')) + self.bg.color = Color.fromString("#8C8C8C") self:add(util.responsiveBG(self.bg)) self.songs = MenuList(paths.getSound('scrollMenu'), true) @@ -66,7 +68,7 @@ function FreeplayState:enter() self.songs.curSelected = math.min(#self.songs.members, self.songs.curSelected) self:changeDiff(0) self.songs:changeSelection() - self.bg.color = self.songs:getSelected().bgColor + self.bg.color = Color.multiply(self.songs:getSelected().bgColor, Color.fromString("#8C8C8C")) end FreeplayState.super.enter(self) @@ -119,7 +121,8 @@ function FreeplayState:update(dt) if #self.songs.members > 0 then local colorBG = self.songs:getSelected().bgColor - self.bg.color = Color.lerpDelta(self.bg.color, colorBG, 3, dt) + game.camera.bgColor = Color.lerpDelta(game.camera.bgColor, Color.multiply(colorBG, Color.fromString("#E1E1E1")), 3, dt) + self.bg.color = Color.lerpDelta(self.bg.color, Color.multiply(colorBG, Color.fromString("#8C8C8C")), 3, dt) end FreeplayState.super.update(self, dt) diff --git a/funkin/states/mainmenu.lua b/funkin/states/mainmenu.lua index 7478b940..364fe3fa 100644 --- a/funkin/states/mainmenu.lua +++ b/funkin/states/mainmenu.lua @@ -22,22 +22,26 @@ function MainMenuState:enter() self.menuItems = {'storymode', 'freeplay', 'credits', 'options', 'donate'} + self.menuColors = { + normal = {Color.fromString("#FDE871"), Color.fromString("#DC7828")}, + flash = {Color.fromString("#FD719B"), Color.fromString("#DC28A7")} + } + game.camera.target = {x = 0, y = 0} self.camFollow = {x = 0, y = 0} game.camera:follow(self.camFollow, nil, 10) + game.camera.bgColor = self.menuColors.normal[1] local yScroll = math.max(0.25 - (0.05 * (#self.menuItems - 4)), 0.1) self.menuBg = Sprite() self.menuBg:loadTexture(paths.getImage('menus/menuBG')) + self.menuBg.color = self.menuColors.normal[2] self.menuBg.scrollFactor:set(0, yScroll) self.menuBg:setGraphicSize(math.floor(self.menuBg.width * 1.175)) self.menuBg:updateHitbox() self.menuBg:screenCenter() self:add(self.menuBg) - self.menuYellow = paths.getImage('menus/menuBG') - self.menuMagenta = paths.getImage('menus/menuBGMagenta') - self.menuList = MenuList(paths.getSound("scrollMenu"), true, "centered", function(self, obj) for _, spr in ipairs(self.members) do spr.yAdd = 50 + (self.curSelected) * (80 - game.height * 0.005) @@ -166,16 +170,21 @@ function MainMenuState:enterSelection(choice) util.playSfx(paths.getSound('confirmMenu')) local flicker = Flicker(self.menuBg, switch[1] and 1.1 or 1, 0.15, true) - if not flash then self.menuBg:loadTexture(self.menuMagenta) end + if not flash then + game.camera.bgColor = self.menuColors.flash[1] + self.menuBg.color = self.menuColors.flash[2] + end local magenta = false flicker.onFlicker = function() if not self.menuBg.exists or not flash then return end magenta = not magenta - self.menuBg:loadTexture(magenta and self.menuMagenta or self.menuYellow) + game.camera.bgColor = magenta and self.menuColors.flash[1] or self.menuColors.normal[1] + self.menuBg.color = magenta and self.menuColors.flash[2] or self.menuColors.normal[2] end flicker.completionCallback = function() if not self.menuBg.exists then return end - self.menuBg:loadTexture(self.menuYellow) + game.camera.bgColor = self.menuColors.normal[1] + self.menuBg.color = self.menuColors.normal[2] end local selectedItem = self.menuList.members[self.menuList.curSelected] diff --git a/funkin/states/mods.lua b/funkin/states/mods.lua index 946d3c85..a4be0f46 100644 --- a/funkin/states/mods.lua +++ b/funkin/states/mods.lua @@ -14,7 +14,9 @@ function ModsState:enter() Discord.changePresence({details = "In the Menus", state = "Mods Menu"}) end - self.bg = Sprite(0, 0, paths.getImage("menus/menuDesat")) + game.camera.bgColor = Color.fromString("#E1E1E1") + self.bg = Sprite(0, 0, paths.getImage("menus/menuBG")) + self.bg.color = Color.fromString("#8C8C8C") self:add(util.responsiveBG(self.bg)) self.bd = BackDrop(128) @@ -125,8 +127,9 @@ local colorBlack, colorRed = Color.BLACK, Color.RED function ModsState:update(dt) ModsState.super.update(self, dt) - self.bg.color = Color.lerpDelta(self.bg.color, self.curColor, 3, dt) - self.bd.color = Color.saturate(self.bg.color, 0.4) + game.camera.bgColor = Color.lerpDelta(game.camera.bgColor, Color.multiply(self.curColor, Color.fromString("#E1E1E1")), 3, dt) + self.bg.color = Color.lerpDelta(self.bg.color, Color.multiply(self.curColor, Color.fromString("#8C8C8C")), 3, dt) + self.bd.color = Color.lerpDelta(self.bd.color, Color.saturate(self.curColor, 0.4), 3, dt) if controls:pressed("back") and not self.leaving then if Mods.currentMod ~= self.initialMod then diff --git a/loxel/util/color.lua b/loxel/util/color.lua index db87494b..cb21725a 100644 --- a/loxel/util/color.lua +++ b/loxel/util/color.lua @@ -174,6 +174,12 @@ function Color.lerpDelta(x, y, i, delta) 1) end +function Color.multiply(rgb, rgb2) + local r1, g1, b1 = Color.get(rgb) + local r2, g2, b2 = Color.get(rgb2) + return {r1 * r2, g1 * g2, b1 * b2} +end + function Color.vec4(tbl, ...) local args = {...} local fill = {tbl.r or tbl[1], tbl.g or tbl[2], tbl.b or tbl[3], tbl.a or tbl[4] or 1}