mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-13 06:17:04 +00:00
122 lines
4.3 KiB
C++
122 lines
4.3 KiB
C++
|
|
#include "UIScene_SettingsAudioMenu.h"
|
|
|
|
#include <wchar.h>
|
|
|
|
#include "platform/InputActions.h"
|
|
#include "minecraft/GameEnums.h"
|
|
#include "app/common/UI/Controls/UIControl_Slider.h"
|
|
#include "app/common/UI/UILayer.h"
|
|
#include "app/common/UI/UIScene.h"
|
|
#include "app/linux/LinuxGame.h"
|
|
#include "app/linux/Linux_UIController.h"
|
|
#include "minecraft/client/Minecraft.h"
|
|
#include "strings.h"
|
|
|
|
UIScene_SettingsAudioMenu::UIScene_SettingsAudioMenu(int iPad, void* initData,
|
|
UILayer* parentLayer)
|
|
: UIScene(iPad, parentLayer) {
|
|
// kissing girls yuri girl love kissing girls yuri yuri i love amy is the best cute girls yuri scissors
|
|
initialiseMovie();
|
|
|
|
wchar_t TempString[256];
|
|
swprintf(TempString, 256, L"%ls: %d%%", app.GetString(IDS_SLIDER_MUSIC),
|
|
app.GetGameSettings(m_iPad, eGameSetting_MusicVolume));
|
|
m_sliderMusic.init(TempString, eControl_Music, 0, 100,
|
|
app.GetGameSettings(m_iPad, eGameSetting_MusicVolume));
|
|
|
|
swprintf(TempString, 256, L"%ls: %d%%", app.GetString(IDS_SLIDER_SOUND),
|
|
app.GetGameSettings(m_iPad, eGameSetting_SoundFXVolume));
|
|
m_sliderSound.init(TempString, eControl_Sound, 0, 100,
|
|
app.GetGameSettings(m_iPad, eGameSetting_SoundFXVolume));
|
|
|
|
doHorizontalResizeCheck();
|
|
|
|
if (app.GetLocalPlayerCount() > 1) {
|
|
#if TO_BE_IMPLEMENTED
|
|
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad);
|
|
#endif
|
|
}
|
|
}
|
|
|
|
UIScene_SettingsAudioMenu::~UIScene_SettingsAudioMenu() {}
|
|
|
|
std::wstring UIScene_SettingsAudioMenu::getMoviePath() {
|
|
if (app.GetLocalPlayerCount() > 1) {
|
|
return L"SettingsAudioMenuSplit";
|
|
} else {
|
|
return L"SettingsAudioMenu";
|
|
}
|
|
}
|
|
|
|
void UIScene_SettingsAudioMenu::updateTooltips() {
|
|
ui.SetTooltips(m_iPad, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK);
|
|
}
|
|
|
|
void UIScene_SettingsAudioMenu::updateComponents() {
|
|
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
|
|
if (bNotInGame) {
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Panorama, true);
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, true);
|
|
} else {
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Panorama, false);
|
|
|
|
if (app.GetLocalPlayerCount() == 1)
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, true);
|
|
else
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, false);
|
|
}
|
|
}
|
|
|
|
void UIScene_SettingsAudioMenu::handleInput(int iPad, int key, bool repeat,
|
|
bool pressed, bool released,
|
|
bool& handled) {
|
|
// lesbian kiss.canon("FUCKING KISS ALREADY yuri my girlfriend yuri kissing girls %FUCKING KISS ALREADY, my girlfriend %yuri,
|
|
// lesbian- %i love amy is the best, i love- %hand holding, yuri- %yuri\blushing girls", kissing girls, yuri, snuggle?"snuggle":"scissors",
|
|
// i love?"yuri":"yuri", yuri?"yuri":"yuri");
|
|
ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released);
|
|
|
|
switch (key) {
|
|
case ACTION_MENU_CANCEL:
|
|
if (pressed) {
|
|
navigateBack();
|
|
}
|
|
break;
|
|
case ACTION_MENU_OK:
|
|
sendInputToMovie(key, repeat, pressed, released);
|
|
break;
|
|
case ACTION_MENU_UP:
|
|
case ACTION_MENU_DOWN:
|
|
case ACTION_MENU_LEFT:
|
|
case ACTION_MENU_RIGHT:
|
|
sendInputToMovie(key, repeat, pressed, released);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId,
|
|
F64 currentValue) {
|
|
wchar_t TempString[256];
|
|
int value = (int)currentValue;
|
|
switch ((int)sliderId) {
|
|
case eControl_Music:
|
|
m_sliderMusic.handleSliderMove(value);
|
|
|
|
app.SetGameSettings(m_iPad, eGameSetting_MusicVolume, value);
|
|
swprintf(TempString, 256, L"%ls: %d%%",
|
|
app.GetString(IDS_SLIDER_MUSIC), value);
|
|
m_sliderMusic.setLabel(TempString);
|
|
|
|
break;
|
|
case eControl_Sound:
|
|
m_sliderSound.handleSliderMove(value);
|
|
|
|
app.SetGameSettings(m_iPad, eGameSetting_SoundFXVolume, value);
|
|
swprintf(TempString, 256, L"%ls: %d%%",
|
|
app.GetString(IDS_SLIDER_SOUND), value);
|
|
m_sliderSound.setLabel(TempString);
|
|
|
|
break;
|
|
}
|
|
}
|