Skip to content

Commit

Permalink
Moved system menu mask back to individual profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
PringlesGang committed Sep 28, 2024
1 parent 21a6871 commit 83e1493
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 36 deletions.
6 changes: 6 additions & 0 deletions profiles/cc/hud/backlogmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ root.BacklogMenu = {
MinHoldTime = 0.5,
AdvanceFocusTimeInterval = 0.05,

MenuMask = "MenuMask",
BacklogMask = "BacklogMask",
HoverBounds = { X = 0, Y = 145, Width = 1920, Height = 821 },

Expand Down Expand Up @@ -61,6 +62,11 @@ root.Sprites["BacklogControls"] = {
Bounds = { X = 0, Y = 1153, Width = 1920, Height = 57 },
};

root.Sprites["MenuMask"] = {
Sheet = "MenuChip",
Bounds = { X = 154, Y = 140, Width = 1900, Height = 1061 },
};

root.Sprites["VoiceIcon"] = {
Sheet = "Backlog",
Bounds = { X = 1519, Y = 1216, Width = 43, Height = 43 },
Expand Down
6 changes: 6 additions & 0 deletions profiles/cclcc/hud/backlogmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ root.BacklogMenu = {
MinHoldTime = 0.5,
AdvanceFocusTimeInterval = 0.05,

MenuMask = "MenuMask",
BacklogMask = "BacklogMask",
HoverBounds = { X = 380, Y = 145, Width = 1230, Height = 820 },

Expand Down Expand Up @@ -61,6 +62,11 @@ root.Sprites["BacklogControls"] = {
Bounds = { X = 0, Y = 1151, Width = 1920, Height = 59 },
}

root.Sprites["MenuMask"] = {
Sheet = "MenuChip",
Bounds = { X = 154, Y = 140, Width = 1900, Height = 1061 },
};

root.Sprites["VoiceIcon"] = {
Sheet = "Backlog",
Bounds = { X = 1521, Y = 1218, Width = 38, Height = 38 },
Expand Down
6 changes: 0 additions & 6 deletions profiles/cclcc/hud/systemmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ root.SystemMenu = {
MenuEntriesSprites = {},
MenuEntriesHighlightedSprites = {},

MenuMask = "SystemMenuMask",
MenuButtonGuide = "SystemMenuButtonGuide",
};

Expand Down Expand Up @@ -103,11 +102,6 @@ for i=1, #root.SystemMenu.MenuEntriesSprites do
root.SystemMenu.MenuEntriesHighlightedSprites[#root.SystemMenu.MenuEntriesHighlightedSprites + 1] = name
end

root.Sprites["SystemMenuMask"] = {
Sheet = "MenuChip",
Bounds = { X = 154, Y = 140, Width = 1900, Height = 1061 },
};

root.Sprites["SystemMenuButtonGuide"] = {
Sheet = "MenuChip",
Bounds = {X = 0, Y = 1384, Width = 1920, Height = 59}
Expand Down
5 changes: 5 additions & 0 deletions profiles/cclcc/hud/tipsmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ root.Sprites["TipsGuide"] = {
Bounds = { X = 0, Y = 1152, Width = 1925, Height = 55 }
};

root.Sprites["TipsMask"] = {
Sheet = "MenuChip",
Bounds = { X = 154, Y = 140, Width = 1900, Height = 1061 },
};

-- Start of Tips Tab Name Sprites
root.Sprites["TipsHighlightedTabSprite"] = {
Sheet = "Tips",
Expand Down
26 changes: 3 additions & 23 deletions src/games/cc/backlogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
#include "../../profile/game.h"
#include "../../ui/backlogmenu.h"
#include "../../ui/widgets/cc/backlogentry.h"
#include "../../profile/ui/systemmenu.h"
#include "../../profile/ui/backlogmenu.h"
#include "../../profile/games/cc/backlogmenu.h"
#include "../../profile/games/cclcc/systemmenu.h"

namespace Impacto {
namespace UI {
Expand All @@ -25,22 +23,6 @@ void BacklogMenu::MenuButtonOnClick(Widgets::BacklogEntry* target) {
}
}

BacklogMenu::BacklogMenu() : UI::BacklogMenu::BacklogMenu() {
switch (Impacto::Profile::SystemMenu::Type) {
default:
MaskSprite = nullptr;
break;
case UI::SystemMenuType::CCLCC:
MaskSprite = &Profile::CCLCC::SystemMenu::MenuMask;
break;
/* Enable once CC system menu is properly seperated
case UI::SystemMenuType::CC:
MaskSprite = &Profile::CC::SystemMenu::MenuMask;
break;
*/
}
}

void BacklogMenu::Render() {
if (State == Hidden) return;

Expand All @@ -66,11 +48,9 @@ void BacklogMenu::Render() {
MainItems->Render();
MainScrollbar->Render();

if (MaskSprite != nullptr)
Renderer->DrawSprite(
*MaskSprite,
RectF(0.0f, 0.0f, Profile::DesignWidth, Profile::DesignHeight),
maskTint);
Renderer->DrawSprite(
MenuMaskSprite,
RectF(0.0f, 0.0f, Profile::DesignWidth, Profile::DesignHeight), maskTint);

Renderer->DrawSprite(BacklogControlsSprite, BacklogControlsPosition,
transition);
Expand Down
3 changes: 0 additions & 3 deletions src/games/cc/backlogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ namespace CC {

class BacklogMenu : public UI::BacklogMenu {
public:
BacklogMenu();

void Render();

Check warning on line 13 in src/games/cc/backlogmenu.h

View workflow job for this annotation

GitHub Actions / macos-arm64

'Render' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Check warning on line 13 in src/games/cc/backlogmenu.h

View workflow job for this annotation

GitHub Actions / macos-x64

'Render' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
void MenuButtonOnClick(Widgets::BacklogEntry* target);

Check warning on line 14 in src/games/cc/backlogmenu.h

View workflow job for this annotation

GitHub Actions / macos-arm64

'MenuButtonOnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Check warning on line 14 in src/games/cc/backlogmenu.h

View workflow job for this annotation

GitHub Actions / macos-x64

'MenuButtonOnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

private:
const Sprite* MaskSprite;
Widgets::CC::BacklogEntry* CreateBacklogEntry(
int id, uint8_t* str, int audioId, glm::vec2 pos,
const RectF& hoverBounds) const override;
Expand Down
3 changes: 1 addition & 2 deletions src/games/cclcc/tipsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "../../profile/ui/backlogmenu.h"
#include "../../profile/ui/tipsmenu.h"
#include "../../profile/games/cclcc/tipsmenu.h"
#include "../../profile/games/cclcc/systemmenu.h"
#include "../../io/memorystream.h"
#include "../../data/tipssystem.h"
#include "../../vm/interface/input.h"
Expand Down Expand Up @@ -281,7 +280,7 @@ void TipsMenu::Render() {
}

Renderer->DrawSprite(
Profile::CCLCC::SystemMenu::MenuMask,
TipsMaskSprite,
RectF(0.0f, 0.0f, Profile::DesignWidth, Profile::DesignHeight),
maskTint);
}
Expand Down
1 change: 1 addition & 0 deletions src/profile/games/cc/backlogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ void Configure() {
BacklogControlsSprite = EnsureGetMemberSprite("BacklogControlsSprite");
BacklogControlsPosition = EnsureGetMemberVec2("BacklogControlsPosition");

MenuMaskSprite = EnsureGetMemberSprite("MenuMask");
BacklogMaskSheet = EnsureGetMemberSpriteSheet("BacklogMask");

auto drawType = Game::DrawComponentType::_from_integral_unchecked(
Expand Down
1 change: 1 addition & 0 deletions src/profile/games/cc/backlogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ inline glm::vec2 BacklogHeaderPosition;
inline Sprite BacklogControlsSprite;
inline glm::vec2 BacklogControlsPosition;

inline Sprite MenuMaskSprite;
inline SpriteSheet BacklogMaskSheet;

} // namespace BacklogMenu
Expand Down
1 change: 0 additions & 1 deletion src/profile/games/cclcc/systemmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ void Configure() {
GetMemberVec2Array(MenuEntriesPositions, Profile::SystemMenu::MenuEntriesNum,
"MenuEntriesPositions");

MenuMask = EnsureGetMemberSprite("MenuMask");
MenuButtonGuide = EnsureGetMemberSprite("MenuButtonGuide");

auto drawType = Game::DrawComponentType::_from_integral_unchecked(
Expand Down
1 change: 0 additions & 1 deletion src/profile/games/cclcc/systemmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace CCLCC {
namespace SystemMenu {
constexpr int MenuEntriesNumMax = 16;

inline Sprite MenuMask;
inline Sprite MenuButtonGuide;
inline float TitleFadeInDuration;
inline float TitleFadeOutDuration;
Expand Down
1 change: 1 addition & 0 deletions src/profile/games/cclcc/tipsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace TipsMenu {
void Configure() {
TipsBookLayerSprite = EnsureGetMemberSprite("TipsBookLayerSprite");
TipsGuideSprite = EnsureGetMemberSprite("TipsGuideSprite");
TipsMaskSprite = EnsureGetMemberSprite("TipsMaskSprite");
TipsHighlightedSprite = EnsureGetMemberSprite("TipsHighlightedSprite");
TipsHighlightedTabSprite = EnsureGetMemberSprite("TipsHighlightedTabSprite");
TipsNewSprite = EnsureGetMemberSprite("TipsNewSprite");
Expand Down
1 change: 1 addition & 0 deletions src/profile/games/cclcc/tipsmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace TipsMenu {

inline Sprite TipsBookLayerSprite;
inline Sprite TipsGuideSprite;
inline Sprite TipsMaskSprite;
inline Sprite TipsHighlightedSprite;
inline Sprite TipsNewSprite;

Expand Down

0 comments on commit 83e1493

Please sign in to comment.