-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44d2382
commit 1429654
Showing
6 changed files
with
124 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "optionsvoiceslider.h" | ||
|
||
#include "../../../profile/games/cclcc/optionsmenu.h" | ||
#include "../../../renderer/renderer.h" | ||
#include "../../../vm/interface/input.h" | ||
|
||
using namespace Impacto::Profile::CCLCC::OptionsMenu; | ||
using namespace Impacto::Vm::Interface; | ||
|
||
namespace Impacto { | ||
namespace UI { | ||
namespace Widgets { | ||
namespace CCLCC { | ||
|
||
OptionsVoiceSlider::OptionsVoiceSlider(const Sprite& box, const Sprite& label, | ||
const Sprite& portrait, | ||
const Sprite& mutedPortrait, | ||
glm::vec2 pos, glm::vec4 highlightTint, | ||
float sliderSpeed) | ||
: OptionsSlider(box, label, pos, highlightTint, sliderSpeed), | ||
Portrait(portrait), | ||
MutedPortrait(mutedPortrait) {} | ||
|
||
void OptionsVoiceSlider::Render() { | ||
HighlightTint.a = Tint.a; | ||
|
||
Renderer->DrawSprite(Muted ? MutedPortrait : Portrait, Bounds.GetPos(), Tint); | ||
Renderer->DrawSprite(LabelSprite, Bounds.GetPos() + NametagOffset, | ||
Selected ? Tint : glm::vec4(0.0f, 0.0f, 0.0f, Tint.a)); | ||
|
||
RectF highlightBounds( | ||
Bounds.X + VoiceSliderOffset.x, Bounds.Y + VoiceSliderOffset.y, | ||
Progress * BoxSprite.ScaledWidth(), BoxSprite.ScaledHeight()); | ||
Renderer->DrawRect(highlightBounds, HighlightTint); | ||
Renderer->DrawSprite(BoxSprite, Bounds.GetPos() + VoiceSliderOffset, Tint); | ||
} | ||
|
||
void OptionsVoiceSlider::UpdateInput() { | ||
OptionsEntry::UpdateInput(); | ||
if (!Selected) return; | ||
|
||
Muted ^= (bool)(PADinputButtonWentDown & PAD1Y); | ||
} | ||
|
||
} // namespace CCLCC | ||
} // namespace Widgets | ||
} // namespace UI | ||
} // namespace Impacto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include "./optionsslider.h" | ||
#include "../../../spritesheet.h" | ||
|
||
namespace Impacto { | ||
namespace UI { | ||
namespace Widgets { | ||
namespace CCLCC { | ||
|
||
class OptionsVoiceSlider : public OptionsSlider { | ||
public: | ||
OptionsVoiceSlider(const Sprite& box, const Sprite& label, | ||
const Sprite& portrait, const Sprite& mutedPortrait, | ||
glm::vec2 pos, glm::vec4 highlightTint, float sliderSpeed); | ||
void Render() override; | ||
void UpdateInput() override; | ||
|
||
private: | ||
const Sprite& Portrait; | ||
const Sprite& MutedPortrait; | ||
|
||
bool Muted = false; | ||
}; | ||
|
||
} // namespace CCLCC | ||
} // namespace Widgets | ||
} // namespace UI | ||
} // namespace Impacto |