diff --git a/scripts/language/DE.lua b/scripts/language/DE.lua index 363e5f8..dd00d84 100644 --- a/scripts/language/DE.lua +++ b/scripts/language/DE.lua @@ -2,43 +2,43 @@ local lang = { Challanges = { --righside - ch = "Idk", - ch1 = "Foltere dich selbst :)", + ch = "Analysieren Sie Ihre Fähigkeiten", + ch1 = "Finde heraus, wie gut du bist!\nDeine Fähigkeiten gehen an die Grenzen.", }, Multiplayer = { --righside - mp = "Warte, es gibt Mehrspieler???", - mp2 = "Ja, aber niemand ist jemals online", + mp = "Online matchmaking!", + mp2 = "Spiele gegen deine Freunde!\nUnterstützung für bis zu 8 Spieler.", }, Start = { --righside - st = "Starte scheisse idk", - st2 ="Spiel etwas bla bla bla\nMit Zeilenumbrüchen", + st = "Grundspiel!", + st2 ="Spielen Sie, was immer Sie mögen!\nJetzt mit Online Rangliste", --leftside st3 = "Start", - sc = "Drehen", + sc = "VOL zur Auswahl", desc = "Test description. Blah blah blah", }, Nautica = { --righside dls = "Mehr Lieder herunterladen", - dls2 = "ksm.dev", + dls2 = "Erhalte neue maps täglich von ksm.dev!\nUpdate Täglich", }, Settings = { --righside - se = "Dinge anpassen", - se1= "Einstellungen öffnen", + se = "Einstellungen öffnen!", + se1= "Optimiere deine Einstellung nach deinen Wünschen.", }, Exit = { --righside - ex = "Verlass dieses verfluchte Spiel", - ex2 = "Komm schon, drück den Knopf!\nDu weißt, dass du es tun willst", + ex = "Schließ das Spiel", + ex2 = "Schließ das Spiel und beende deine Sitzung.\nAuf Wiedersehen!", }, Result = { --leftside - re = "AUTOPLAY Active", - re1 = "AUTOPLAY is active.", - re2 = "Scores will not be saved", + re = "AUTOPLAY Aktiv", + re1 = "AUTOPLAY ist aktiv.", + re2 = "Spielstände werden nicht gespeichert", }, } diff --git a/scripts/multi/basepanel.lua b/scripts/multi/basepanel.lua new file mode 100644 index 0000000..d25d1ef --- /dev/null +++ b/scripts/multi/basepanel.lua @@ -0,0 +1,20 @@ +local bottomPanelX = 1; +local bottomPanelY = 1250; + +local m_base_panel = gfx.CreateSkinImage("multi/lobby/multi_base_panel.png", 1); +local m_anim = gfx.CreateSkinImage("multi/lobby/panel_laser.png", 1); + +local m_base_part = function() + local jw , jh = gfx.ImageSize(m_base_panel); + gfx.BeginPath(); + gfx.ImageRect(bottomPanelX, bottomPanelY, jw/1.17, jh/1.18, m_base_panel,1,0); + gfx.BeginPath(); + gfx.ImageRect(bottomPanelX, bottomPanelY, jw/1.17, jh/1.18, m_anim,1,0); + + gfx.LoadSkinFont('Digital-Serial-Bold.ttf') + gfx.FillColor(255,255,255) + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_LEFT) + gfx.FontSize(24) +end + +return m_base_part \ No newline at end of file diff --git a/scripts/multi/bpmpanel.lua b/scripts/multi/bpmpanel.lua new file mode 100644 index 0000000..d0e6379 --- /dev/null +++ b/scripts/multi/bpmpanel.lua @@ -0,0 +1,75 @@ +local bpmPanelX = 0; +local bpmPanelY = 1692; + +local m_bpm_panel = gfx.CreateSkinImage("multi/lobby/lane_speed_panel.png", 1); + +local Info = { + Bpm = { + HasBpm = "BPM", + NoBpm = "BPM ?", + }, + LN = { + HasLN = "LANE-SPEED", + NoLV = "LANE-SPEED ?", + } +} + +local m_bpm_part = function () + local jw , jh = gfx.ImageSize(m_bpm_panel); + gfx.BeginPath(); + gfx.ImageRect(bpmPanelX, bpmPanelY, jw/1.18, jh/1.18, m_bpm_panel,1,0); + + gfx.FontSize(32) + if selected_song == nil then + if host == user_id then + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(32) + gfx.Text(Info.Bpm.NoBpm,bpmPanelX+76, bpmPanelY + 96) + gfx.Text(Info.LN.NoLV,bpmPanelX+76, bpmPanelY + 140) + else + if missing_song then + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(32) + gfx.Text(Info.Bpm.NoBpm,bpmPanelX+76, bpmPanelY + 96) + gfx.Text(Info.LN.NoLV,bpmPanelX+76, bpmPanelY + 140) + else + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(32) + gfx.Text(Info.Bpm.NoBpm,bpmPanelX+76, bpmPanelY + 96) + gfx.Text(Info.LN.NoLV,bpmPanelX+76, bpmPanelY + 140) + end + end + end + if selected_song ~= nil then + gfx.FillColor(255,255,255) + gfx.FontSize(32); + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + + if selected_song.min_bpm ~= selected_song.max_bpm then + + gfx.Text(Info.Bpm.HasBpm,bpmPanelX+76, bpmPanelY + 96) + gfx.Text(string.format("%.0f - %.0f", + selected_song.min_bpm, selected_song.max_bpm), + bpmPanelX+ 76 + 75, bpmPanelY + 96) + + gfx.Text(Info.LN.HasLN,bpmPanelX+76, bpmPanelY + 140) + gfx.Text(string.format("%.2f = %.0f", + selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed), + bpmPanelX +76 + 175, bpmPanelY + 140) + else + + gfx.FontSize(32); + gfx.Text(Info.Bpm.HasBpm,bpmPanelX+76, bpmPanelY + 96) + gfx.Text(string.format("%.0f", + selected_song.min_bpm), + bpmPanelX+ 76 + 75, bpmPanelY + 96) + + gfx.Text(Info.LN.HasLN,bpmPanelX+76, bpmPanelY + 140) + gfx.Text(string.format("%.2f = %.0f", + selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed), + bpmPanelX + 76 + 175, bpmPanelY + 140) + end + end +end + +return m_bpm_part \ No newline at end of file diff --git a/scripts/multi/infopanel.lua b/scripts/multi/infopanel.lua new file mode 100644 index 0000000..e253f49 --- /dev/null +++ b/scripts/multi/infopanel.lua @@ -0,0 +1,41 @@ +local infPanelX = 475; +local infPanelY = 1590; + +local m_info_panel = gfx.CreateSkinImage("multi/lobby/button_panel.png", 1); + +local Info = { + BTs = { + BTA = "EXCESSIVE", + BTB = "MIRROR", + BTC = "ROTATE", + BTD = "LEAVE", + ST = "START", + FXS = "FX-L/FX-R TO SETTINGS", + }, + MEME = { + BTs = "SEX", + FXS = "START TO EXCEED SEX", + } +} + +local m_info_part = function () -- the info panel + local jw , jh = gfx.ImageSize(m_info_panel); + gfx.BeginPath(); + gfx.ImageRect(infPanelX, infPanelY, jw/1.18, jh/1.18, m_info_panel,1,0); + gfx.FontSize(24) + + draw_checkbox(Info.BTs.BTA,infPanelX+160, infPanelY+50, toggle_hard, hard_mode, not start_game_soon) + draw_checkbox(Info.BTs.BTB,infPanelX+187, infPanelY+87.5, toggle_mirror, mirror_mode, not start_game_soon) + draw_checkbox(Info.BTs.BTC,infPanelX+390, infPanelY+87.5, toggle_rotate, do_rotate, + (owner == user_id or host == user_id) and not start_game_soon) + + gfx.FillColor(255,255,255,100) + gfx.Text(Info.BTs.BTD,infPanelX+417.5, infPanelY+49) + gfx.Text(Info.BTs.ST,infPanelX*1.61, infPanelY+35) + gfx.FillColor(255,255,255) + gfx.FontSize(24) + gfx.Text(Info.BTs.FXS,infPanelX+290.5,infPanelY+269) +-- gfx.Text(Info.MEME.FXS,infPanelX+290.5,infPanelY+269) +end + +return m_info_part \ No newline at end of file diff --git a/scripts/multi/mainpanel.lua b/scripts/multi/mainpanel.lua new file mode 100644 index 0000000..57ef850 --- /dev/null +++ b/scripts/multi/mainpanel.lua @@ -0,0 +1,17 @@ +local roomNamePanelX = 429; +local roomNamePanelY = 1142; + +local m_panel = gfx.CreateSkinImage("multi/lobby/matching_panel.png", 1); + +local m_part = function() + local jw , jh = gfx.ImageSize(m_panel); + gfx.BeginPath(); + gfx.ImageRect(roomNamePanelX, roomNamePanelY, jw/1.175, jh/1.18, m_panel,1,0); + + gfx.FontSize(32); + gfx.LoadSkinFont('Digital-Serial-Bold.ttf') + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_MIDDLE) + gfx.Text(selected_room.name,roomNamePanelX+146, roomNamePanelY+37) +end + +return m_part \ No newline at end of file diff --git a/scripts/multi/owninfo.lua b/scripts/multi/owninfo.lua new file mode 100644 index 0000000..ae83984 --- /dev/null +++ b/scripts/multi/owninfo.lua @@ -0,0 +1,34 @@ +-- idk why this breaks with the difbar translate error at line 28 +local ownPanelX = 0; +local ownPanelY = 1310; + + msg = game.GetSkinSetting("MSG"); + normname = game.GetSkinSetting("username") + +local m_host_panel = gfx.CreateSkinImage("multi/lobby/user_panel.png", 1); + ready_bt = gfx.CreateSkinImage("multi/lobby/READY.png", 1); + +local m_own_info = function() + + gfx.BeginPath(); + gfx.FontSize(40) + gfx.ImageRect(ownPanelX, ownPanelY, 343/1.18, 361/1.18,m_host_panel,1,0) + gfx.Text(normname, ownPanelX+20, ownPanelY+78) + gfx.FontSize(22) + gfx.Text(msg,ownPanelX+20, ownPanelY+37) + gfx.Text(irText, ownPanelX+20, ownPanelY+288); + + +if showthing == true then + local jw , jh = gfx.ImageSize(ready_bt); + gfx.BeginPath(); + gfx.ImageRect(ownPanelX+150, ownPanelY+232, jw/1.18, jh/1.18, ready_bt,1,0); + elseif showthing == false then + local jw , jh = gfx.ImageSize(ready_bt); + gfx.BeginPath(); + gfx.ImageRect(x+ownPanelX, y+ownPanelY, jw/1.18, jh/1.18, ready_bt,0,0); + end + +end + +return m_own_info \ No newline at end of file diff --git a/scripts/multi/songinfo.lua b/scripts/multi/songinfo.lua new file mode 100644 index 0000000..5c90803 --- /dev/null +++ b/scripts/multi/songinfo.lua @@ -0,0 +1,96 @@ +local rightPanelX = 283; +local rightPanelY = 1187; + +local m_s_panel = gfx.CreateSkinImage("multi/lobby/song_panel.png", 1); + +local Info = { + Song = { + NoSong = "NO SONG", + MisSong = "MISSING SONG!!!!" + }, + Artist = { + NoArt = "NO ARTIST", + MisArt = "MISSING ARTIST!!!!" + }, + Effect = { + NoEfc = "NO EFFECTOR", + MisEfc = "MISSING EFFECTOR!!!!" + }, + Illustrator = { + NoIlt = "NO ILLUSTRATOR", + MisIlt = "MISSING ILLUSTRATOR!!!!" + }, + Bpm = { + HasBpm = "BPM", + NoBpm = "BPM ?", + }, +} + +local m_s_part = function () + local jw , jh = gfx.ImageSize(m_s_panel); + gfx.BeginPath(); + gfx.ImageRect(rightPanelX, rightPanelY, jw/1.175, jh/1.18, m_s_panel,1,0); + + gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT); + gfx.FillColor(255,255,255) + + gfx.FontSize(32) + if selected_song == nil then + if host == user_id then + gfx.Text(Info.Song.NoSong, rightPanelX+245, rightPanelY+50) + gfx.Text(Info.Artist.NoArt, rightPanelX+245, rightPanelY+88) + gfx.FontSize(24) + gfx.Text(Info.Effect.NoEfc, rightPanelX+463, rightPanelY+191) + gfx.Text(Info.Illustrator.NoIlt, rightPanelX+463, rightPanelY+219) + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(22) + gfx.Text(Info.Bpm.NoBpm,rightPanelX+497, rightPanelY+118) + else + if missing_song then + gfx.Text(Info.Song.MisSong, rightPanelX+245, rightPanelY+50) + gfx.Text(Info.Artist.MisArt, rightPanelX+245, rightPanelY+88) + gfx.FontSize(24) + gfx.Text(Info.Effect.MisEfc, rightPanelX+463, rightPanelY+191) + gfx.Text(Info.Illustrator.MisIlt, rightPanelX+463, rightPanelY+219) + end + --[[ + else + gfx.Text("HOST IS SELECTING SONG", rightPanelX+245, rightPanelY+50) + gfx.Text(" ", rightPanelX+245, rightPanelY+88) + gfx.FontSize(24) + gfx.Text(" ", rightPanelX+463, rightPanelY+191) + gfx.Text(" ", rightPanelX+463, rightPanelY+219) + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(22) + gfx.Text("BPM ?",rightPanelX+497, rightPanelY+118)]] + end + else + if selected_song.min_bpm ~= selected_song.max_bpm then + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(22); + gfx.Text(Info.Bpm.HasBpm,rightPanelX+497, rightPanelY+118) + gfx.FontSize(26); + gfx.Text(string.format("%.0f - %.0f", + selected_song.min_bpm, selected_song.max_bpm), + rightPanelX+497 + 77, rightPanelY+118) + else + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.FontSize(22); + gfx.Text(Info.Bpm.HasBpm,rightPanelX+497, rightPanelY+118) + gfx.Text(string.format("%.0f", + selected_song.min_bpm), + rightPanelX+497 + 77, rightPanelY+118) + end + gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT); + gfx.FontSize(32); + gfx.Text(selected_song.title, rightPanelX+245, rightPanelY+50) + gfx.Text(selected_song.artist, rightPanelX+245, rightPanelY+88) + gfx.FontSize(24) + gfx.Text(selected_song.effector, rightPanelX+463, rightPanelY+191) + gfx.Text(selected_song.illustrator, rightPanelX+463, rightPanelY+219) + draw_diffs(selected_song.all_difficulties, 395, 205, 300, 100, selected_song.diff_index+1) + gfx.Text("Dif pos: "..selected_song.diff_index,rightPanelX, rightPanelY) + end +end + +return m_s_part \ No newline at end of file diff --git a/scripts/multi/songjacket.lua b/scripts/multi/songjacket.lua new file mode 100644 index 0000000..fefa4a0 --- /dev/null +++ b/scripts/multi/songjacket.lua @@ -0,0 +1,37 @@ +local jacketPanelX = 333; +local jacketPanelY = 1284; + +local jacket = 0; +local m_jacket = gfx.CreateSkinImage("multi/lobby/multi_jacket.png", 1); +local placeholderJacket = gfx.CreateSkinImage("song_select/loading.png", 0) + +local songjacket = function() + + local jw , jh = gfx.ImageSize(m_jacket); + gfx.BeginPath(); + gfx.ImageRect(jacketPanelX, jacketPanelY, jw/1.18, jh/1.18, m_jacket,1,0); + + gfx.BeginPath() + gfx.ImageRect(jacketPanelX+12, jacketPanelY+19,jw/1.269,jh/1.35,jacket,1,0) + + if mouse_clipped(jacketPanelX+12, jacketPanelY+19,jw/1.269,jh/1.35) and host == user_id then + hovered = function() + missing_song = false + mpScreen.SelectSong() + end + end + + if selected_song == nil then + if jacket == 0 then + jacket = placeholderJacket + end + else + if selected_song.jacket == nil or selected_song.jacket == placeholderJacket then + selected_song.jacket = gfx.LoadImageJob(selected_song.jacketPath, placeholderJacket) + jacket = selected_song.jacket + end + end + +end + +return songjacket \ No newline at end of file diff --git a/scripts/multiplayerscreen.lua b/scripts/multiplayerscreen.lua index dce1e3a..689c51a 100644 --- a/scripts/multiplayerscreen.lua +++ b/scripts/multiplayerscreen.lua @@ -5,21 +5,17 @@ local Sound = require("common.sound") local Dim = require("common.dimensions") local Wallpaper = require("components.wallpaper") local Background = require('components.background'); -local difbar = require("components.diff_rectangle"); -local spinnybg = require('components.background'); -local msg = game.GetSkinSetting("MSG"); -local normname = game.GetSkinSetting("username") +local difbar = require("components.diff_rectangle"); --no clue but starting to separating breaks it local creww = game.GetSkinSetting("single_idol") -local m_jacket = gfx.CreateSkinImage("multi/lobby/multi_jacket.png", 1); -local m_base_panel = gfx.CreateSkinImage("multi/lobby/multi_base_panel.png", 1); -local m_anim = gfx.CreateSkinImage("multi/lobby/panel_laser.png", 1); -local m_panel = gfx.CreateSkinImage("multi/lobby/matching_panel.png", 1); -local m_s_panel = gfx.CreateSkinImage("multi/lobby/song_panel.png", 1); -local m_host_panel = gfx.CreateSkinImage("multi/lobby/user_panel.png", 1); -local m_bpm_panel = gfx.CreateSkinImage("multi/lobby/lane_speed_panel.png", 1); -local m_info_panel = gfx.CreateSkinImage("multi/lobby/button_panel.png", 1); +local songjacket = require("multi.songjacket") +local m_own_info = require("multi.owninfo") +local m_base_part = require("multi.basepanel") +local m_part = require("multi.mainpanel") +local m_s_part = require("multi.songinfo") +local m_bpm_part = require("multi.bpmpanel") +local m_info_part = require("multi.infopanel") local temppanels = gfx.CreateSkinImage("song_select/textboard.png", 1); --temp @@ -28,8 +24,6 @@ local headerMatchingImage = gfx.CreateSkinImage("titlescreen/entry.png", 1); local m_4pb_panels_bottom = gfx.CreateSkinImage("multi/lobby/opponent_bottom_panel.png", 1); local m_4pb_panels_top = gfx.CreateSkinImage("multi/lobby/opponent_top_panel.png", 1); -local ready_bt = gfx.CreateSkinImage("multi/lobby/READY.png", 1); - local bg = gfx.CreateSkinImage("multi/lobby/bg.png", 1); local bg_graid1 = gfx.CreateSkinImage("multi/lobby/gradient_bottom.png", 1); local bg_graid2 = gfx.CreateSkinImage("multi/lobby/gradient_top.png", 1); @@ -38,37 +32,13 @@ local idle = "/idle" local idolAnimation = gfx.LoadSkinAnimation('crew/anim/'..creww..idle, 1 / 30, 0, true); local idolAnimTransitionScale = 0; - -local desw,desh = game.GetResolution() - -local rightPanelX = 283; -local rightPanelY = 1187; - local leftPanelX = 575; local leftPanelY = 1472; -local bottomPanelX = 1; -local bottomPanelY = 1250; - -local jacketPanelX = 333; -local jacketPanelY = 1284; - -local ownPanelX = 0; -local ownPanelY = 1310; - -local roomNamePanelX = 429; -local roomNamePanelY = 1142; - -local bpmPanelX = 0; -local bpmPanelY = 1692; - -local infPanelX = 475 -local infPanelY = 1590 - local mposx = 0; local mposy = 0; local hovered = nil; -local buttonWidth = desw*(3/4); +local buttonWidth = Dim.design.width*(3/4); local buttonHeight = 75; local buttonBorder = 2; local portrait @@ -77,9 +47,7 @@ local jacket_size; local BAR_ALPHA = 191; local HEADER_HEIGHT = 100 -local desw, desh = game.GetResolution() -local desw = 1080 -local desh = 1920 +local desh = game.GetResolution() local scale; game.LoadSkinSample("click-02") @@ -89,9 +57,8 @@ game.LoadSkinSample("menu_click") local loading = true; local rooms = {}; local lobby_users = {}; -local selected_room = nil; +selected_room = nil; local user_id = nil; -local jacket = 0; local all_ready; local user_ready; local go; @@ -101,11 +68,10 @@ local start_game_soon = false; local host = nil; local owner = nil; local missing_song = false; -local placeholderJacket = gfx.CreateSkinImage("song_select/loading.png", 0) local did_exit = false; local irHeartbeatRequested = false; -local irText = '' +irText = '' local grades = { {["max"] = 6900000, ["image"] = gfx.CreateSkinImage("common/grades/D.png", 0)}, @@ -158,232 +124,11 @@ local drawIdol = function(deltaTime) idolAnimTransitionScale = 1; end - gfx.ImageRect(0, 0, desw,desh, idolAnimation, 1, 0); + gfx.ImageRect(0, 0, Dim.design.width,desh, idolAnimation, 1, 0); gfx.GlobalAlpha(1); end end -songjacket = function() -- self explanatory -- done - - local jw , jh = gfx.ImageSize(m_jacket); - gfx.BeginPath(); - gfx.ImageRect(jacketPanelX, jacketPanelY, jw/1.18, jh/1.18, m_jacket,1,0); - - - gfx.BeginPath() - gfx.ImageRect(jacketPanelX+12, jacketPanelY+19,jw/1.269,jh/1.35,jacket,1,0) - - if mouse_clipped(jacketPanelX+12, jacketPanelY+19,jw/1.269,jh/1.35) and host == user_id then - hovered = function() - missing_song = false - mpScreen.SelectSong() - end - end - - if selected_song == nil then - if jacket == 0 then - jacket = placeholderJacket - end - else - if selected_song.jacket == nil or selected_song.jacket == placeholderJacket then - selected_song.jacket = gfx.LoadImageJob(selected_song.jacketPath, placeholderJacket) - jacket = selected_song.jacket - end - end - -end - -m_own_info = function() -- bottom left -- done - - gfx.BeginPath(); - gfx.FontSize(40) - gfx.ImageRect(ownPanelX, ownPanelY, 343/1.18, 361/1.18,m_host_panel,1,0) - gfx.Text(normname, ownPanelX+20, ownPanelY+78) - gfx.FontSize(22) - gfx.Text(msg,ownPanelX+20, ownPanelY+37) - gfx.Text(irText, ownPanelX+20, ownPanelY+288); - - -if showthing == true then - local jw , jh = gfx.ImageSize(ready_bt); - gfx.BeginPath(); - gfx.ImageRect(ownPanelX+150, ownPanelY+232, jw/1.18, jh/1.18, ready_bt,1,0); - elseif showthing == false then - local jw , jh = gfx.ImageSize(ready_bt); - gfx.BeginPath(); - gfx.ImageRect(x+ownPanelX, y+ownPanelY, jw/1.18, jh/1.18, ready_bt,0,0); - end - -end - -m_base_part = function() -- just the images which slide up -- done - local jw , jh = gfx.ImageSize(m_base_panel); - gfx.BeginPath(); - gfx.ImageRect(bottomPanelX, bottomPanelY, jw/1.17, jh/1.18, m_base_panel,1,0); - gfx.BeginPath(); - gfx.ImageRect(bottomPanelX, bottomPanelY, jw/1.17, jh/1.18, m_anim,1,0); - - gfx.LoadSkinFont('Digital-Serial-Bold.ttf') - gfx.FillColor(255,255,255) - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_LEFT) - gfx.FontSize(24) -end - -m_part = function() -- room name part -- done - local jw , jh = gfx.ImageSize(m_panel); - gfx.BeginPath(); - gfx.ImageRect(roomNamePanelX, roomNamePanelY, jw/1.175, jh/1.18, m_panel,1,0); - - gfx.FontSize(32); - gfx.LoadSkinFont('Digital-Serial-Bold.ttf') - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_MIDDLE) - gfx.Text(selected_room.name,roomNamePanelX+146, roomNamePanelY+37) -end - -m_s_part = function () -- song info panel -- done - local jw , jh = gfx.ImageSize(m_s_panel); - gfx.BeginPath(); - gfx.ImageRect(rightPanelX, rightPanelY, jw/1.175, jh/1.18, m_s_panel,1,0); - - gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT); - gfx.FillColor(255,255,255) - - gfx.FontSize(32) - if selected_song == nil then - if host == user_id then - gfx.Text("NO SONG", rightPanelX+245, rightPanelY+50) - gfx.Text("NO ARIST", rightPanelX+245, rightPanelY+88) - gfx.FontSize(24) - gfx.Text("NO EFFECTOR", rightPanelX+463, rightPanelY+191) - gfx.Text("NO ILLUSTRATOR", rightPanelX+463, rightPanelY+219) - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(22) - gfx.Text("BPM ?",rightPanelX+497, rightPanelY+118) - else - if missing_song then - gfx.Text("MISSING SONG!!!!", rightPanelX+245, rightPanelY+50) - gfx.Text("MISSING ARIST!!!!", rightPanelX+245, rightPanelY+88) - gfx.FontSize(24) - gfx.Text("MISSING EFFECTOR!!!!", rightPanelX+463, rightPanelY+191) - gfx.Text("MISSING ILLUSTRATOR!!!!", rightPanelX+463, rightPanelY+219) - end - --[[ - else - gfx.Text("HOST IS SELECTING SONG", rightPanelX+245, rightPanelY+50) - gfx.Text(" ", rightPanelX+245, rightPanelY+88) - gfx.FontSize(24) - gfx.Text(" ", rightPanelX+463, rightPanelY+191) - gfx.Text(" ", rightPanelX+463, rightPanelY+219) - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(22) - gfx.Text("BPM ?",rightPanelX+497, rightPanelY+118)]] - end - else - if selected_song.min_bpm ~= selected_song.max_bpm then - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(22); - gfx.Text("BPM",rightPanelX+497, rightPanelY+118) - gfx.FontSize(26); - gfx.Text(string.format("%.0f - %.0f", - selected_song.min_bpm, selected_song.max_bpm), - rightPanelX+497 + 77, rightPanelY+118) - else - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(22); - gfx.Text("BPM",rightPanelX+497, rightPanelY+118) - gfx.Text(string.format("%.0f", - selected_song.min_bpm), - rightPanelX+497 + 77, rightPanelY+118) - end - gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT); - gfx.FontSize(32); - gfx.Text(selected_song.title, rightPanelX+245, rightPanelY+50) - gfx.Text(selected_song.artist, rightPanelX+245, rightPanelY+88) - gfx.FontSize(24) - gfx.Text(selected_song.effector, rightPanelX+463, rightPanelY+191) - gfx.Text(selected_song.illustrator, rightPanelX+463, rightPanelY+219) - draw_diffs(selected_song.all_difficulties, 395, 205, 300, 100, selected_song.diff_index+1) - end -end - -m_bpm_part = function () -- bpm and lane speed - local jw , jh = gfx.ImageSize(m_bpm_panel); - gfx.BeginPath(); - gfx.ImageRect(bpmPanelX, bpmPanelY, jw/1.18, jh/1.18, m_bpm_panel,1,0); - - gfx.FontSize(32) - if selected_song == nil then - if host == user_id then - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(32) - gfx.Text("BPM ?",bpmPanelX+76, bpmPanelY + 96) - gfx.Text("LANE-SPEED ?",bpmPanelX+76, bpmPanelY + 140) - else - if missing_song then - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(32) - gfx.Text("BPM ?",bpmPanelX+76, bpmPanelY + 96) - gfx.Text("LANE-SPEED ?",bpmPanelX+76, bpmPanelY + 140) - else - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - gfx.FontSize(32) - gfx.Text("BPM ?",bpmPanelX+76, bpmPanelY + 96) - gfx.Text("LANE-SPEED ?",bpmPanelX+76, bpmPanelY + 140) - end - end - end - if selected_song ~= nil then - gfx.FillColor(255,255,255) - gfx.FontSize(32); - gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) - - if selected_song.min_bpm ~= selected_song.max_bpm then - - gfx.Text("BPM",bpmPanelX+76, bpmPanelY + 96) - gfx.Text(string.format("%.0f - %.0f", - selected_song.min_bpm, selected_song.max_bpm), - bpmPanelX+ 76 + 75, bpmPanelY + 96) - - gfx.Text("LANE-SPEED",bpmPanelX+76, bpmPanelY + 140) - gfx.Text(string.format("%.2f = %.0f", - selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed), - bpmPanelX +76 + 175, bpmPanelY + 140) - else - - gfx.FontSize(32); - gfx.Text("BPM",bpmPanelX+76, bpmPanelY + 96) - gfx.Text(string.format("%.0f", - selected_song.min_bpm), - bpmPanelX+ 76 + 75, bpmPanelY + 96) - - gfx.Text("LANE-SPEED",bpmPanelX+76, bpmPanelY + 140) - gfx.Text(string.format("%.2f = %.0f", - selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed), - bpmPanelX + 76 + 175, bpmPanelY + 140) - end - end -end - -m_info_part = function () -- the info panel - local jw , jh = gfx.ImageSize(m_info_panel); - gfx.BeginPath(); - gfx.ImageRect(infPanelX, infPanelY, jw/1.18, jh/1.18, m_info_panel,1,0); - gfx.FontSize(24) - - draw_checkbox("EXCESSIVE",infPanelX+160, infPanelY+50, toggle_hard, hard_mode, not start_game_soon) - draw_checkbox("MIRROR",infPanelX+187, infPanelY+87.5, toggle_mirror, mirror_mode, not start_game_soon) - draw_checkbox("ROTATE",infPanelX+390, infPanelY+87.5, toggle_rotate, do_rotate, - (owner == user_id or host == user_id) and not start_game_soon) - - gfx.FillColor(255,255,255,100) - gfx.Text("LEAVE",infPanelX+417.5, infPanelY+49) - gfx.Text("START",infPanelX*1.61, infPanelY+35) - gfx.FillColor(255,255,255) - gfx.FontSize(24) - gfx.Text("FX-L/FX-R TO SETTINGS",infPanelX+290.5,infPanelY+269) --- gfx.Text("START TO EXCEED SEX",infPanelX+290.5,infPanelY+269) -end - user_setup = function () -- (semi new) user layering local distance = 350 for i, user in ipairs(lobby_users) do @@ -417,13 +162,13 @@ user_setup = function () -- (semi new) user layering end function drawHeader() - gfx.BeginPath(); - gfx.FillColor(0, 0, 0, BAR_ALPHA); - gfx.Rect(0, 0, desw, HEADER_HEIGHT); - gfx.Fill(); + gfx.BeginPath() + gfx.FillColor(0, 0, 0, BAR_ALPHA) + gfx.Rect(0, 0, Dim.design.width, HEADER_HEIGHT) + gfx.Fill() gfx.ClosePath() - gfx.ImageRect(desw/2 - 200, HEADER_HEIGHT/2 - 20, 400, 40, headerMatchingImage, 1, 0) + gfx.ImageRect(Dim.design.width / 2 - 200, HEADER_HEIGHT / 2 - 20, 400, 40, headerMatchingImage, 1, 0) end mouse_clipped = function(x,y,w,h) @@ -432,7 +177,7 @@ end; -- look into this when people are online draw_room = function(name, x, y, selected, hoverindex) - local buttonWidth = desw/2; + local buttonWidth = Dim.design.width/2; local rx = x - (buttonWidth / 2); local ty = y - (buttonHeight / 2); local roomButtonBorder = buttonBorder; @@ -560,17 +305,17 @@ function render_loading() gfx.Save() gfx.ResetTransform() gfx.BeginPath() - gfx.MoveTo(desw, desh) - gfx.LineTo(desw - 350, desh) - gfx.LineTo(desw - 300, desh - 50) - gfx.LineTo(desw, desh - 50) + gfx.MoveTo(Dim.design.width, desh) + gfx.LineTo(Dim.design.width - 350, desh) + gfx.LineTo(Dim.design.width - 300, desh - 50) + gfx.LineTo(Dim.design.width, desh - 50) gfx.ClosePath() gfx.FillColor(33,33,33) gfx.Fill() gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("LOADING...", desw - 20, desh - 3) + gfx.Text("LOADING...", Dim.design.width - 20, desh - 3) gfx.Restore() end @@ -609,7 +354,6 @@ draw_diffs = function(diffs, x, y, w, h, selectedDiff) draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, false) end end - --after selected for i = math.min(selectedDiff + 2, diffCount), selectedDiff + 1,-1 do local diff = diffs[i] @@ -618,6 +362,7 @@ draw_diffs = function(diffs, x, y, w, h, selectedDiff) draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, false) end end + local diff = diffs[selectedDiff] local xpos = x + ((w/2 - diffWidth/2) + (doffset)*(-0.8*diffWidth)) draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, true) @@ -672,7 +417,7 @@ function draw_rooms(y, h) if room.password then status = status..'

' end - draw_room(room.name .. ': '.. status, desw/2, ypos, i == selected_room_index, function() + draw_room(room.name .. ': '.. status, Dim.design.width/2, ypos, i == selected_room_index, function() join_room(room) end) end @@ -722,12 +467,11 @@ end function render_lobby(deltaTime) local jw , jh = gfx.ImageSize(bg); gfx.BeginPath(); - gfx.ImageRect(0, 0, desw, desh, bg,1,0); + gfx.ImageRect(0, 0, Dim.design.width, desh, bg,1,0); drawIdol(deltaTime) gfx.BeginPath(); - gfx.ImageRect(0, 0, desw, desh, bg_graid1,1,0); - gfx.ImageRect(0, 0, desw, desh, bg_graid2,1,0); - drawHeader() + gfx.ImageRect(0, 0, Dim.design.width, desh, bg_graid1,1,0); + gfx.ImageRect(0, 0, Dim.design.width, desh, bg_graid2,1,0); gfx.BeginPath(); m_base_part() @@ -750,25 +494,11 @@ function render_room_list(deltaTime) -- Draw cover for rooms out of view gfx.BeginPath() - gfx.FillColor(20, 20, 20) - gfx.Rect(0, 0, desw, 145) - gfx.Rect(0, desh-170, desw, 170) - gfx.Fill() - - gfx.BeginPath() - gfx.FillColor(60, 60, 60) - gfx.Rect(0, 145, desw, 2) - gfx.Rect(0, desh-170-2, desw, 2) - gfx.Fill() - - gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("- - - - - - - - - - - Multiplayer Rooms - - - - - - - - - - -", desw/2, 100) - if not loading then - draw_button("Create new room", desw/2, desh-40-buttonHeight, desw*(3/4), new_room); + draw_button("Create new room", Dim.design.width/2, desh-40-buttonHeight, Dim.design.width*(3/4), new_room); end @@ -780,73 +510,73 @@ function render_password_screen(deltaTime) gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("Joining "..selected_room.name.."...", desw/2, desh/4) + gfx.Text("Joining "..selected_room.name.."...", Dim.design.width/2, desh/4) gfx.FillColor(50,50,50) gfx.BeginPath() - gfx.Rect(0, desh/2-10, desw, 40) + gfx.Rect(0, desh/2-10, Dim.design.width, 40) gfx.Fill(); gfx.FillColor(255,255,255) - gfx.Text("Please enter room password:", desw/2, desh/2-40) - gfx.Text(string.rep("*",#textInput.text), desw/2, desh/2+40) + gfx.Text("Please enter room password:", Dim.design.width/2, desh/2-40) + gfx.Text(string.rep("*",#textInput.text), Dim.design.width/2, desh/2+40) if passwordError then gfx.FillColor(255,50,50) gfx.FontSize(60 + math.floor(passwordErrorOffset*20)) - gfx.Text("Invalid password", desw/2, desh/2+80) + gfx.Text("Invalid password", Dim.design.width/2, desh/2+80) end - draw_button("Join", desw/2, desh*3/4, desw/2, mpScreen.JoinWithPassword); + draw_button("Join", Dim.design.width/2, desh*3/4, Dim.design.width/2, mpScreen.JoinWithPassword); end function render_new_room_password(delta_time) gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("Create New Room", desw/2, desh/4) + gfx.Text("Create New Room", Dim.design.width/2, desh/4) gfx.FillColor(50,50,50) gfx.BeginPath() - gfx.Rect(0, desh/2-10, desw, 40) + gfx.Rect(0, desh/2-10, Dim.design.width, 40) gfx.Fill(); gfx.FillColor(255,255,255) - gfx.Text("Enter room password:", desw/2, desh/2-40) - gfx.Text(string.rep("*",#textInput.text), desw/2, desh/2+40) - draw_button("Create Room", desw/2, desh*3/4, desw/2, mpScreen.NewRoomStep); + gfx.Text("Enter room password:", Dim.design.width/2, desh/2-40) + gfx.Text(string.rep("*",#textInput.text), Dim.design.width/2, desh/2+40) + draw_button("Create Room", Dim.design.width/2, desh*3/4, Dim.design.width/2, mpScreen.NewRoomStep); end ---here + function render_new_room_name(deltaTime) gfx.BeginPath(); gfx.LoadSkinFont("segoeui.ttf") gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("Create New Room", desw/2, desh/4) + gfx.Text("Create New Room", Dim.design.width/2, desh/4) - gfx.Rect(0, desh/2-10, desw, 60) + gfx.Rect(0, desh/2-10, Dim.design.width, 60) - gfx.Text("Please enter room name:", desw/2, desh/2-40) - gfx.Text(textInput.text, desw/2, desh/2+40) - draw_button("Next", desw/2, desh*3/4, desw/2, mpScreen.NewRoomStep); + gfx.Text("Please enter room name:", Dim.design.width/2, desh/2-40) + gfx.Text(textInput.text, Dim.design.width/2, desh/2+40) + draw_button("Next", Dim.design.width/2, desh*3/4, Dim.design.width/2, mpScreen.NewRoomStep); end function render_set_username(deltaTime) gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM) gfx.FontSize(70) - gfx.Text("First things first...", desw/2, desh/4) + gfx.Text("First things first...", Dim.design.width/2, desh/4) gfx.FillColor(50,50,50) gfx.BeginPath() - gfx.Rect(0, desh/2-10, desw, 60) + gfx.Rect(0, desh/2-10, Dim.design.width, 60) gfx.Fill(); gfx.FillColor(255,255,255) - gfx.Text("Enter a display name:", desw/2, desh/2-40) - gfx.Text(textInput.text, desw/2, desh/2+40) - draw_button("Join Multiplayer", desw/2, desh*3/4, desw/2, function() + gfx.Text("Enter a display name:", Dim.design.width/2, desh/2-40) + gfx.Text(textInput.text, Dim.design.width/2, desh/2+40) + draw_button("Join Multiplayer", Dim.design.width/2, desh*3/4, Dim.design.width/2, function() loading = true; mpScreen.SaveUsername() end); @@ -860,7 +590,6 @@ render = function(deltaTime) Dim.transformToScreenSpace() - buttonWidth = desw*(3/4); mposx,mposy = game.GetMousePos(); Sound.stopMusic(); @@ -876,7 +605,6 @@ render = function(deltaTime) gfx.LoadSkinFont(normal_font); do_sounds(deltaTime); - -- Room Listing View if screenState == "inRoom" then render_lobby(deltaTime); @@ -898,7 +626,7 @@ render = function(deltaTime) end render_loading(); render_info(); - + drawHeader() end -- Ready up to play