-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP UI: Add left side panel, with tabs, UI tweaks
- Loading branch information
1 parent
c5e2144
commit 258d395
Showing
9 changed files
with
318 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<vertical bg="round-rect-panel" min-width="80" min-height="40" child-control-height="false" horizontal-fit="PreferredSize" vertical-fit="PreferredSize" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='https://raw.githubusercontent.com/RedBrumbler/Quest-BSML-Docs/gh-pages/schema.xsd'> | ||
<tab-selector tab-tag='main' pad-top="2" /> | ||
<tab tags='main' tab-name='Menu and BGM' > | ||
<vertical pad-left="3" pad-right="3" pad-top="2" pad-bottom="2" horizontal-fit="PreferredSize" vertical-fit="PreferredSize"> | ||
<button text="Menu Music" pref-width="50" on-click="MenuMusicButtonPressed" /> | ||
<button text="Lobby Music" pref-width="50" on-click="LobbyMusicButtonPressed" /> | ||
<button text="Menu Clicks" pref-width="50" on-click="MenuClickButtonPressed" /> | ||
</vertical> | ||
</tab> | ||
<tab tags='main' tab-name='Notes' > | ||
<vertical pad-left="3" pad-right="3" pad-top="2" pad-bottom="2" horizontal-fit="PreferredSize" vertical-fit="PreferredSize"> | ||
<button text="Hit Sounds" pref-width="50" on-click="HitSoundButtonPressed" /> | ||
<button text="Bad Hit Sounds" pref-width="50" on-click="BadHitSoundButtonPressed" /> | ||
<button text="Miss Sounds" pref-width="50" on-click="MissSoundButtonPressed" /> | ||
</vertical> | ||
</tab> | ||
<tab tags='main' tab-name='Level Results' > | ||
<vertical pad-left="3" pad-right="3" pad-top="2" pad-bottom="2" horizontal-fit="PreferredSize" vertical-fit="PreferredSize"> | ||
<button text="Level Cleared Sound" pref-width="50" on-click="LevelClearedButtonPressed" /> | ||
<button text="Level Failed" pref-width="50" on-click="LevelFailedButtonPressed" /> | ||
<button text="Firworks" pref-width="50" on-click="FireworkButtonPressed" /> | ||
</vertical> | ||
</tab> | ||
</vertical> |
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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
<vertical spacing='0.4' min-width='125.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='https://raw.githubusercontent.com/RedBrumbler/Quest-BSML-Docs/gh-pages/schema.xsd'> | ||
<vertical child-align='UpperCenter' child-expand-height='false' child-control-height='true' > | ||
<toggle-setting id='SoundEnabled' text='Sound Enabled' hover-hint='Activates or deactivates this custom sound' value='Active' apply-on-change='true' /> | ||
<slider-setting id='SoundVolumeOffset' text='Volume Offset' hover-hint='Lets you select a Volume Offset that is applied to the sound (Preview volume does not necessarily match volume played in-map)' value='VolumeOffset' min='-1.0' max='1.0' increment='0.01' show-buttons='true' apply-on-change='true' active='false' /> | ||
<slider-setting id='SoundBeatOffset' text='Hit Sound Offset' hover-hint='Sets a custom HitSound beatOffSet (default: 0.185 ms)' value='BeatOffset' digits='3' min='0.0' max='0.25' increment='0.001' show-buttons='true' apply-on-change='true' active='false' /> | ||
<scroll-view min-height='56' > | ||
<vertical id='Sounds' child-align='UpperCenter' child-expand-height='false' child-control-height='true' > | ||
</vertical> | ||
<macro.if value='HasSoundFiles'> | ||
<macro.for-each items='SoundFiles'> | ||
<macro.if value='!IsSetup'> | ||
<horizontal id="NotSetupHorizontal"> | ||
<text text='Please select a sound you want to edit on the left panel.' /> | ||
</horizontal> | ||
</macro.if> | ||
<macro.if value='IsSetup'> | ||
<toggle-setting id='SoundEnabled' text='Sound Enabled' hover-hint='Activates or deactivates this custom sound' value='Active' apply-on-change='true' /> | ||
<slider-setting id='SoundVolumeOffset' text='Volume Offset' hover-hint='Lets you select a Volume Offset that is applied to the sound (Preview volume does not necessarily match volume played in-map)' value='VolumeOffset' min='-1.0' max='1.0' increment='0.01' show-buttons='true' apply-on-change='true' active='false' /> | ||
<slider-setting id='SoundBeatOffset' text='Hit Sound Offset' hover-hint='Sets a custom HitSound beatOffSet (default: 0.185 ms)' value='BeatOffset' digits='3' min='0.0' max='0.25' increment='0.001' show-buttons='true' apply-on-change='true' active='false' /> | ||
<scroll-view id='SDListScroll' min-height='56' > | ||
<vertical id='Sounds' child-align='UpperCenter' child-expand-height='false' child-control-height='true' > | ||
</vertical> | ||
<macro.if value='HasSoundFiles'> | ||
<!-- <macro.for-each items='SoundFiles'> | ||
|
||
</macro.for-each> | ||
</macro.if> | ||
<macro.if value='!HasSoundFiles'> | ||
<horizontal> | ||
<text rich-text='true' text='No sound files were found\nPlease add some sound files' /> | ||
</horizontal> | ||
</macro.if> | ||
</scroll-view> | ||
</macro.for-each> --> | ||
</macro.if> | ||
<macro.if value='!HasSoundFiles'> | ||
<horizontal> | ||
<text rich-text='true' text='No sound files were found.
Please add some sound files.' /> | ||
</horizontal> | ||
</macro.if> | ||
</scroll-view> | ||
</macro.if> | ||
</vertical> | ||
</vertical> |
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,30 @@ | ||
#pragma once | ||
|
||
#include "custom-types/shared/macros.hpp" | ||
#include "bsml/shared/macros.hpp" | ||
|
||
#include "HMUI/ViewController.hpp" | ||
|
||
DECLARE_CLASS_CODEGEN(QuestSounds::UI, ConfigMenuSelectionViewController, HMUI::ViewController, | ||
// DECLARE_INSTANCE_FIELD(ListW<BSML::CustomCellInfo*>, _menus); | ||
// DECLARE_INSTANCE_FIELD(BSML::CustomListTableData*, menuList); | ||
|
||
DECLARE_OVERRIDE_METHOD_MATCH(void, DidActivate, &HMUI::ViewController::DidActivate, bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling); | ||
// DECLARE_OVERRIDE_METHOD_MATCH(void, DidDeactivate, &HMUI::ViewController::DidDeactivate, bool removedFromHierarchy, bool screenSystemDisabling); | ||
|
||
DECLARE_INSTANCE_METHOD(void, MenuMusicButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, LobbyMusicButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, MenuClickButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, HitSoundButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, BadHitSoundButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, MissSoundButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, LevelClearedButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, LevelFailedButtonPressed); | ||
DECLARE_INSTANCE_METHOD(void, FireworkButtonPressed); | ||
|
||
DECLARE_CTOR(ctor); | ||
|
||
public: | ||
void set_selectCallback(std::function<void(int)> callback); | ||
std::function<void(int)> callback; | ||
) |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#pragma once | ||
#include "kaleb/shared/kaleb.hpp" | ||
|
||
DECLARE_FILE(_binary_ConfigMenuSelectionViewController_bsml, Assets, ConfigMenuSelectionViewController_bsml); | ||
DECLARE_FILE(_binary_SoundSettingsViewController_bsml, Assets, SoundSettingsViewController_bsml); |
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,92 @@ | ||
#include "UI/ConfigMenuSelectionViewController.hpp" | ||
#include "assets.hpp" | ||
#include "logging.hpp" | ||
|
||
#include "bsml/shared/BSML.hpp" | ||
|
||
DEFINE_TYPE(QuestSounds::UI, ConfigMenuSelectionViewController); | ||
|
||
namespace QuestSounds::UI { | ||
void ConfigMenuSelectionViewController::ctor() { | ||
// _menus = ListW<BSML::CustomCellInfo*>(); | ||
getLogger().info("ctor"); | ||
return; | ||
} | ||
|
||
void ConfigMenuSelectionViewController::DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { | ||
getLogger().info("DidActivate"); | ||
if (firstActivation) { | ||
getLogger().info("DidActivate firstActivation"); | ||
BSML::parse_and_construct(Assets::ConfigMenuSelectionViewController_bsml, get_transform(), this); | ||
} | ||
return; | ||
} | ||
|
||
void ConfigMenuSelectionViewController::set_selectCallback(std::function<void(int)> callback) { | ||
getLogger().info("Setting selectCallback"); | ||
this->callback = callback; | ||
} | ||
|
||
void ConfigMenuSelectionViewController::MenuMusicButtonPressed() { | ||
getLogger().info("MenuMusicButtonPressed"); | ||
if (callback) { | ||
callback(0); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::LobbyMusicButtonPressed() { | ||
getLogger().info("LobbyMusicButtonPressed"); | ||
if (callback) { | ||
callback(1); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::MenuClickButtonPressed() { | ||
getLogger().info("MenuClickButtonPressed"); | ||
if (callback) { | ||
callback(2); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::HitSoundButtonPressed() { | ||
getLogger().info("HitSoundButtonPressed"); | ||
if (callback) { | ||
callback(3); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::BadHitSoundButtonPressed() { | ||
getLogger().info("BadHitSoundButtonPressed"); | ||
if (callback) { | ||
callback(4); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::MissSoundButtonPressed() { | ||
getLogger().info("MissSoundButtonPressed"); | ||
if (callback) { | ||
callback(5); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::LevelClearedButtonPressed() { | ||
getLogger().info("LevelClearedButtonPressed"); | ||
if (callback) { | ||
callback(6); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::LevelFailedButtonPressed() { | ||
getLogger().info("LevelFailedButtonPressed"); | ||
if (callback) { | ||
callback(7); | ||
} | ||
} | ||
|
||
void ConfigMenuSelectionViewController::FireworkButtonPressed() { | ||
getLogger().info("FireworkButtonPressed"); | ||
if (callback) { | ||
callback(8); | ||
} | ||
} | ||
} |
Oops, something went wrong.