Skip to content

Commit

Permalink
Converted two profile settings to use vec2-arrays and RectF-arrays in…
Browse files Browse the repository at this point in the history
…stead
  • Loading branch information
PringlesGang committed Dec 27, 2024
1 parent 9335802 commit fc8a5f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
21 changes: 12 additions & 9 deletions profiles/cclcc/hud/optionsmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ root.OptionsMenu = {
PagePanelSprite = "OptionsPagePanel",
PagePanelPosition = { X = -114, Y = 0 },
PagePanelSprites = {},
PagePanelIconOffsets = {
{ X = 259, Y = 73 },
{ X = 235, Y = 333 },
{ X = 261, Y = 585 },
{ X = 238, Y = 831 }
},
PagePanelHoverBounds = {
{ X = 168, Y = 79, Width = 150, Height = 183 },
{ X = 147, Y = 343, Width = 154, Height = 177 },
{ X = 169, Y = 591, Width = 146, Height = 181 },
{ X = 149, Y = 837, Width = 150, Height = 179 },
},
PoleAnimation = "OptionsPoleAnimation",
-- TODO: Replace this once array fetching is implemented
PagePanelIconOffsets0 = { X = 259, Y = 73 },
PagePanelIconOffsets1 = { X = 235, Y = 333 },
PagePanelIconOffsets2 = { X = 261, Y = 585 },
PagePanelIconOffsets3 = { X = 238, Y = 831 },
PagePanelHoverBounds0 = { X = 168, Y = 79, Width = 150, Height = 183 },
PagePanelHoverBounds1 = { X = 147, Y = 343, Width = 154, Height = 177 },
PagePanelHoverBounds2 = { X = 169, Y = 591, Width = 146, Height = 181 },
PagePanelHoverBounds3 = { X = 149, Y = 837, Width = 150, Height = 179 },

SliderTrackSprite = "OptionsSliderTrack",
SliderTrackOffset = { X = 766, Y = 0 },
Expand Down
10 changes: 2 additions & 8 deletions src/profile/games/cclcc/optionsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ void Configure() {
PagePanelPosition = EnsureGetMemberVec2("PagePanelPosition");
GetMemberSpriteArray(PagePanelSprites, PagePanelSpriteCount,
"PagePanelSprites");
GetMemberVec2Array(PagePanelIconOffsets, PageCount, "PagePanelIconOffsets");
GetMemberRectFArray(PagePanelHoverBounds, PageCount, "PagePanelHoverBounds");
PoleAnimation = EnsureGetMemberAnimation("PoleAnimation");

// TODO: Replace this once array fetching is implemented
for (int i = 0; i < PageCount; i++) {
PagePanelIconOffsets[i] = EnsureGetMemberVec2(
("PagePanelIconOffsets" + std::to_string(i)).c_str());
PagePanelHoverBounds[i] = EnsureGetMemberRectF(
("PagePanelHoverBounds" + std::to_string(i)).c_str());
}

SliderTrackSprite = EnsureGetMemberSprite("SliderTrackSprite");
SliderTrackOffset = EnsureGetMemberVec2("SliderTrackOffset");
VoiceSliderTrackSprite = EnsureGetMemberSprite("VoiceSliderTrackSprite");
Expand Down

0 comments on commit fc8a5f8

Please sign in to comment.