mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 00:39:17 +01:00
Stub LibraryAppletPlayerSelect
This commit is contained in:
parent
4ec1cc7086
commit
a164635f32
@ -258,6 +258,7 @@ add_library(skyline SHARED
|
||||
${source_DIR}/skyline/services/btm/IBtmUserCore.cpp
|
||||
${source_DIR}/skyline/applet/applet_creator.cpp
|
||||
${source_DIR}/skyline/applet/controller_applet.cpp
|
||||
${source_DIR}/skyline/applet/player_select_applet.cpp
|
||||
${source_DIR}/skyline/services/codec/IHardwareOpusDecoder.cpp
|
||||
${source_DIR}/skyline/services/codec/IHardwareOpusDecoderManager.cpp
|
||||
${source_DIR}/skyline/services/hid/IHidServer.cpp
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include "controller_applet.h"
|
||||
#include "player_select_applet.h"
|
||||
#include "applet_creator.h"
|
||||
|
||||
namespace skyline::applet {
|
||||
@ -14,6 +15,8 @@ namespace skyline::applet {
|
||||
switch (appletId) {
|
||||
case AppletId::LibraryAppletController:
|
||||
return std::make_shared<ControllerApplet>(state, manager, std::move(onAppletStateChanged), std::move(onNormalDataPushFromApplet), std::move(onInteractiveDataPushFromApplet), appletMode);
|
||||
case AppletId::LibraryAppletPlayerSelect:
|
||||
return std::make_shared<PlayerSelectApplet>(state, manager, std::move(onAppletStateChanged), std::move(onNormalDataPushFromApplet), std::move(onInteractiveDataPushFromApplet), appletMode);
|
||||
default:
|
||||
throw exception("Unimplemented Applet: 0x{:X} ({})", static_cast<u32>(appletId), ToString(appletId));
|
||||
}
|
||||
|
32
app/src/main/cpp/skyline/applet/player_select_applet.cpp
Normal file
32
app/src/main/cpp/skyline/applet/player_select_applet.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <services/am/storage/ObjIStorage.h>
|
||||
#include "player_select_applet.h"
|
||||
|
||||
namespace skyline::applet {
|
||||
PlayerSelectApplet::PlayerSelectApplet(const DeviceState &state,
|
||||
service::ServiceManager &manager,
|
||||
std::shared_ptr<kernel::type::KEvent> onAppletStateChanged,
|
||||
std::shared_ptr<kernel::type::KEvent> onNormalDataPushFromApplet,
|
||||
std::shared_ptr<kernel::type::KEvent> onInteractiveDataPushFromApplet,
|
||||
service::applet::LibraryAppletMode appletMode)
|
||||
: IApplet(state, manager, std::move(onAppletStateChanged), std::move(onNormalDataPushFromApplet), std::move(onInteractiveDataPushFromApplet), appletMode) {}
|
||||
|
||||
Result PlayerSelectApplet::Start() {
|
||||
// Return default user
|
||||
PushNormalDataAndSignal(std::make_shared<service::am::ObjIStorage<AccountResult>>(state, manager, AccountResult{}));
|
||||
|
||||
// Notify the guest that we've finished running
|
||||
onAppletStateChanged->Signal();
|
||||
return {};
|
||||
};
|
||||
|
||||
Result PlayerSelectApplet::GetResult() {
|
||||
return {};
|
||||
}
|
||||
|
||||
void PlayerSelectApplet::PushNormalDataToApplet(std::shared_ptr<service::am::IStorage> data) {}
|
||||
|
||||
void PlayerSelectApplet::PushInteractiveDataToApplet(std::shared_ptr<service::am::IStorage> data) {}
|
||||
}
|
37
app/src/main/cpp/skyline/applet/player_select_applet.h
Normal file
37
app/src/main/cpp/skyline/applet/player_select_applet.h
Normal file
@ -0,0 +1,37 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common/uuid.h>
|
||||
#include <services/account/IAccountServiceForApplication.h>
|
||||
#include <services/am/applet/IApplet.h>
|
||||
|
||||
namespace skyline::applet {
|
||||
/**
|
||||
* @brief The player select applet is responsible for allowing the user to select a player to use with the application
|
||||
*/
|
||||
class PlayerSelectApplet : public service::am::IApplet {
|
||||
private:
|
||||
/**
|
||||
* @brief Result structure for the player select applet
|
||||
*/
|
||||
struct AccountResult {
|
||||
Result result{};
|
||||
u32 _pad_;
|
||||
service::account::UserId accountId{constant::DefaultUserId};
|
||||
};
|
||||
static_assert(sizeof(AccountResult) == 0x18);
|
||||
|
||||
public:
|
||||
PlayerSelectApplet(const DeviceState &state, service::ServiceManager &manager, std::shared_ptr<kernel::type::KEvent> onAppletStateChanged, std::shared_ptr<kernel::type::KEvent> onNormalDataPushFromApplet, std::shared_ptr<kernel::type::KEvent> onInteractiveDataPushFromApplet, service::applet::LibraryAppletMode appletMode);
|
||||
|
||||
Result Start() override;
|
||||
|
||||
Result GetResult() override;
|
||||
|
||||
void PushNormalDataToApplet(std::shared_ptr<service::am::IStorage> data) override;
|
||||
|
||||
void PushInteractiveDataToApplet(std::shared_ptr<service::am::IStorage> data) override;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user