From 630e753b8724a223ea384f7fd5afd657488b007a Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sun, 18 Dec 2016 02:54:38 -0500 Subject: [PATCH] fix broken netplay menu elements and add number of songs loaded/favorited to playerinfo --- .../WifeJudgmentSpotting.lua | 2 +- .../currentsort.lua | 2 +- .../ScreenNetSelectBase overlay/default.lua | 4 ++-- Themes/Til Death/BGAnimations/_PlayerInfo.lua | 22 ++++++++++++++++++- src/Profile.cpp | 2 ++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua index 07f793feff..ffb042d0b5 100644 --- a/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua +++ b/Themes/Til Death/BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua @@ -50,7 +50,7 @@ playeroptions:Mini( 2 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).Rece **Wife deviance tracker. Basically half the point of the theme.** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Logs deviance values and lets other dv reliant actors know whether or not to act. + For every doot there is an equal and opposite scoot. ]] local t = Def.ActorFrame{ diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/currentsort.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/currentsort.lua index bbcfe5ae90..b691abf01d 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/currentsort.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/currentsort.lua @@ -35,7 +35,7 @@ local sortTable = { t[#t+1] = Def.Quad{ Name="CurrentSort"; - InitCommand=cmd(xy,frameX,frameY;halign,1;zoomto,frameWidth,frameHeight;diffuse,getMainColor(1);); + InitCommand=cmd(xy,frameX,frameY;halign,1;zoomto,frameWidth,frameHeight;diffuse,getMainColor("positive")); }; t[#t+1] = LoadFont("Common Normal") .. { diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/default.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/default.lua index bb64a56c6f..ec3d275d0d 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectBase overlay/default.lua @@ -30,10 +30,10 @@ t[#t+1] = Def.Actor{ end; }; t[#t+1] = LoadActor("../_frame"); -t[#t+1] = LoadActor("../_avatar"); +t[#t+1] = LoadActor("../_PlayerInfo"); t[#t+1] = LoadActor("currentsort"); t[#t+1] = LoadFont("Common Large")..{ - InitCommand=cmd(xy,5,32;halign,0;valign,1;zoom,0.55;diffuse,getMainColor(1);settext,"Select Music:";); + InitCommand=cmd(xy,5,32;halign,0;valign,1;zoom,0.55;diffuse,getMainColor("positive");settext,"Select Music:"); } t[#t+1] = LoadActor("../_cursor"); diff --git a/Themes/Til Death/BGAnimations/_PlayerInfo.lua b/Themes/Til Death/BGAnimations/_PlayerInfo.lua index 74a6fdd578..b5f7e6967e 100644 --- a/Themes/Til Death/BGAnimations/_PlayerInfo.lua +++ b/Themes/Til Death/BGAnimations/_PlayerInfo.lua @@ -9,7 +9,8 @@ local profileName = "No Profile" local playCount = 0 local playTime = 0 local noteCount = 0 -local skillrating = 100 +local skillrating = 0 +local numfaves = 0 local AvatarX = 0 local AvatarY = SCREEN_HEIGHT-50 @@ -29,6 +30,7 @@ t[#t+1] = Def.Actor{ playTime = profile:GetTotalSessionSeconds() noteCount = profile:GetTotalTapsAndHolds() skillrating = profile:GetPlayerRating() + numfaves = profile:GetNumFaves() else profileName = "No Profile" playCount = 0 @@ -126,6 +128,24 @@ t[#t+1] = Def.ActorFrame{ PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), }; + LoadFont("Common Normal") .. { + InitCommand=cmd(xy,SCREEN_WIDTH-5,AvatarY+7;halign,1;zoom,0.6;diffuse,getMainColor('positive')), + BeginCommand=cmd(queuecommand,"Set"), + SetCommand=function(self) + self:settextf("Songs Loaded: %i", #SONGMAN:GetAllSongs()) + end, + PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), + PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), + }; + LoadFont("Common Normal") .. { + InitCommand=cmd(xy,SCREEN_WIDTH-5,AvatarY+25;halign,1;zoom,0.6;diffuse,getMainColor('positive')), + BeginCommand=cmd(queuecommand,"Set"), + SetCommand=function(self) + self:settextf("Favorited Songs: %i", numfaves) + end, + PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), + PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), + }; }; local function Update(self) diff --git a/src/Profile.cpp b/src/Profile.cpp index 06fbd89540..024e413bb0 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -2872,6 +2872,7 @@ class LunaProfile : public Luna static int GetTotalLifts( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iTotalLifts ); return 1; } DEFINE_METHOD(GetTotalDancePoints, m_iTotalDancePoints); static int GetUserTable( T* p, lua_State *L ) { p->m_UserTable.PushSelf(L); return 1; } + static int GetNumFaves(T* p, lua_State *L) { lua_pushnumber(L, p->FavoritedCharts.size()); return 1; } static int GetLastPlayedSong( T* p, lua_State *L ) { Song *pS = p->m_lastSong.ToSong(); @@ -2963,6 +2964,7 @@ class LunaProfile : public Luna ADD_METHOD( GetLastPlayedCourse ); ADD_METHOD( GetGUID ); ADD_METHOD( GetPlayerRating ); + ADD_METHOD( GetNumFaves ); } };