-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from EnderdracheLP/feat/ppdm
Add per player difficulty and modifier options
- Loading branch information
Showing
51 changed files
with
1,226 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<vertical id='segmentVert' bg='panel-top' anchor-pos-y='-25' pref-width='60' min-height='10' vertical-fit='MinSize' pad='2' active='false'> | ||
<text-segments id='difficultyControl' select-cell='SetSelectedDifficulty' /> | ||
</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,8 @@ | ||
<horizontal id="ppth"> | ||
<vertical min-width='45' horizontal-fit='MinSize'> </vertical> | ||
<vertical min-width='45' horizontal-fit='MinSize'> </vertical> | ||
<vertical min-width='45' horizontal-fit='MinSize'> | ||
<toggle-setting id='ppdt' value='PerPlayerDifficulty' apply-on-change='true' text='Per Player Difficulty' hover-hint='Allows each player to select their own difficulty!' bind-value='true'/> | ||
<toggle-setting id='ppmt' value='PerPlayerModifiers' apply-on-change='true' text='Per Player Modifiers' hover-hint="Allows each player to select their own modifiers!" bind-value='true'/> | ||
</vertical> | ||
</horizontal> |
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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
#pragma once | ||
|
||
#include "custom-types/shared/macros.hpp" | ||
#include "custom-types/shared/coroutine.hpp" | ||
#include "lapiz/shared/macros.hpp" | ||
#include "UnityEngine/MonoBehaviour.hpp" | ||
#include "../Objects/MpPlayersDataModel.hpp" | ||
#include "Beatmaps/Providers/MpBeatmapLevelProvider.hpp" | ||
#include "GlobalNamespace/GameServerPlayerTableCell.hpp" | ||
#include "GlobalNamespace/IConnectedPlayer.hpp" | ||
#include "GlobalNamespace/ILobbyPlayerData.hpp" | ||
|
||
DECLARE_CLASS_CODEGEN(MultiplayerCore::UI, GameServerPlayerTableCellCustomData, UnityEngine::MonoBehaviour, | ||
DECLARE_INJECT_METHOD(void, Inject, MultiplayerCore::Objects::MpPlayersDataModel* mpPlayersDataModel); | ||
DECLARE_INJECT_METHOD(void, Inject, MultiplayerCore::Objects::MpPlayersDataModel* mpPlayersDataModel, MultiplayerCore::Beatmaps::Providers::MpBeatmapLevelProvider* beatmapLevelProvider); | ||
DECLARE_INSTANCE_FIELD_PRIVATE(MultiplayerCore::Objects::MpPlayersDataModel*, _mpPlayersDataModel); | ||
DECLARE_INSTANCE_FIELD(MultiplayerCore::Beatmaps::Providers::MpBeatmapLevelProvider*, _mpBeatmapLevelProvider); | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::GameServerPlayerTableCell*, _gameServerPlayerTableCell); | ||
|
||
DECLARE_INSTANCE_METHOD(void, Awake); | ||
public: | ||
void SetData(GlobalNamespace::IConnectedPlayer* connectedPlayer, GlobalNamespace::ILobbyPlayerData* playerData, bool hasKickPermissions, bool allowSelection, System::Threading::Tasks::Task_1<GlobalNamespace::EntitlementStatus>* getLevelEntitlementTask); | ||
custom_types::Helpers::Coroutine SetDataCoroutine(GlobalNamespace::IConnectedPlayer* connectedPlayer, GlobalNamespace::ILobbyPlayerData* playerData, bool hasKickPermissions, bool allowSelection, System::Threading::Tasks::Task_1<GlobalNamespace::EntitlementStatus>* getLevelEntitlementTask); | ||
private: | ||
void SetLevelFoundValues(bool displayLevelText); | ||
) |
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,95 @@ | ||
#pragma once | ||
|
||
#include "custom-types/shared/macros.hpp" | ||
#include "lapiz/shared/macros.hpp" | ||
|
||
#include "GlobalNamespace/GameServerLobbyFlowCoordinator.hpp" | ||
#include "GlobalNamespace/BeatmapLevelsModel.hpp" | ||
|
||
|
||
#include "System/Object.hpp" | ||
#include "System/IDisposable.hpp" | ||
#include "Zenject/IInitializable.hpp" | ||
|
||
#include "UnityEngine/UI/VerticalLayoutGroup.hpp" | ||
#include "UnityEngine/UI/HorizontalLayoutGroup.hpp" | ||
#include "UnityEngine/CanvasGroup.hpp" | ||
|
||
#include "HMUI/TextSegmentedControl.hpp" | ||
|
||
#include "bsml/shared/BSML/Components/Settings/ToggleSetting.hpp" | ||
|
||
#include "Beatmaps/Providers/MpBeatmapLevelProvider.hpp" | ||
#include "Objects/MpPlayersDataModel.hpp" | ||
#include "Networking/MpPacketSerializer.hpp" | ||
#include "Repositories/MpStatusRepository.hpp" | ||
|
||
#include "Players/Packets/MpPerPlayerPacket.hpp" | ||
#include "Players/Packets/GetMpPerPlayerPacket.hpp" | ||
|
||
DECLARE_CLASS_CODEGEN_INTERFACES(MultiplayerCore::UI, MpPerPlayerUI, System::Object, std::vector<Il2CppClass*>({ classof(::Zenject::IInitializable*), classof(::System::IDisposable*)}), | ||
|
||
DECLARE_INSTANCE_FIELD(GlobalNamespace::GameServerLobbyFlowCoordinator*, _gameServerLobbyFlowCoordinator); | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::LobbySetupViewController*, _lobbyViewController); | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::ILobbyGameStateController*, _gameStateController); | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::BeatmapLevelsModel*, _beatmapLevelsModel); | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::MultiplayerSessionManager*, _multiplayerSessionManager); | ||
DECLARE_INSTANCE_FIELD(MultiplayerCore::Beatmaps::Providers::MpBeatmapLevelProvider*, _beatmapLevelProvider); | ||
DECLARE_INSTANCE_FIELD(MultiplayerCore::Objects::MpPlayersDataModel*, _playersDataModel); | ||
DECLARE_INSTANCE_FIELD(MultiplayerCore::Networking::MpPacketSerializer*, _packetSerializer); | ||
DECLARE_INSTANCE_FIELD(MultiplayerCore::Repositories::MpStatusRepository*, _statusRepository); | ||
|
||
// Values | ||
DECLARE_INSTANCE_FIELD(GlobalNamespace::BeatmapKey, _currentBeatmapKey); | ||
DECLARE_INSTANCE_FIELD(ListW<StringW>, _allowedDifficulties); | ||
|
||
DECLARE_OVERRIDE_METHOD_MATCH(void, Initialize, &::Zenject::IInitializable::Initialize); | ||
DECLARE_OVERRIDE_METHOD_MATCH(void, Dispose, &::System::IDisposable::Dispose); | ||
|
||
DECLARE_INSTANCE_METHOD(void, DidActivate, bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling); | ||
DECLARE_INSTANCE_METHOD(void, ModifierSelectionDidActivate, bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling); | ||
// DECLARE_INSTANCE_METHOD(void, DidDeactivate, bool removedFromHierarchy, bool screenSystemDisabling); | ||
DECLARE_INSTANCE_METHOD(void, SetLobbyState, GlobalNamespace::MultiplayerLobbyState state); | ||
DECLARE_INSTANCE_METHOD(void, LocalSelectedBeatmap, GlobalNamespace::LevelSelectionFlowCoordinator::State* state); | ||
DECLARE_INSTANCE_METHOD(void, UpdateDifficultyListWithBeatmapKey, GlobalNamespace::BeatmapKey beatmapKey); | ||
DECLARE_INSTANCE_METHOD(void, UpdateDifficultyList, ListW<StringW> difficulties); | ||
DECLARE_INSTANCE_METHOD(void, ClearLocalSelectedBeatmap); | ||
DECLARE_INSTANCE_METHOD(void, HandleMpPerPlayerPacket, MultiplayerCore::Players::Packets::MpPerPlayerPacket* packet, GlobalNamespace::IConnectedPlayer* player); | ||
DECLARE_INSTANCE_METHOD(void, HandleGetMpPerPlayerPacket, MultiplayerCore::Players::Packets::GetMpPerPlayerPacket* packet, GlobalNamespace::IConnectedPlayer* player); | ||
DECLARE_INSTANCE_METHOD(void, UpdateButtonsEnabled); | ||
|
||
DECLARE_INSTANCE_METHOD(void, SetSelectedDifficulty, HMUI::SegmentedControl* control, int index); | ||
DECLARE_INSTANCE_METHOD(void, set_PerPlayerDifficulty, bool value); | ||
DECLARE_INSTANCE_METHOD(bool, get_PerPlayerDifficulty); | ||
DECLARE_INSTANCE_METHOD(void, set_PerPlayerModifiers, bool value); | ||
DECLARE_INSTANCE_METHOD(bool, get_PerPlayerModifiers); | ||
|
||
DECLARE_CTOR(ctor, | ||
GlobalNamespace::GameServerLobbyFlowCoordinator* gameServerLobbyFlowCoordinator, | ||
GlobalNamespace::BeatmapLevelsModel* beatmapLevelsModel, | ||
GlobalNamespace::IMultiplayerSessionManager* sessionManager, | ||
MultiplayerCore::Beatmaps::Providers::MpBeatmapLevelProvider* beatmapLevelProvider, | ||
MultiplayerCore::Objects::MpPlayersDataModel* playersDataModel, | ||
MultiplayerCore::Networking::MpPacketSerializer* packetSerializer, | ||
MultiplayerCore::Repositories::MpStatusRepository* statusRepository | ||
); | ||
|
||
// UI Elements | ||
DECLARE_INSTANCE_FIELD(UnityEngine::UI::VerticalLayoutGroup*, segmentVert); | ||
DECLARE_INSTANCE_FIELD(UnityEngine::UI::HorizontalLayoutGroup*, ppth); | ||
DECLARE_INSTANCE_FIELD(HMUI::TextSegmentedControl*, difficultyControl); | ||
DECLARE_INSTANCE_FIELD(BSML::ToggleSetting*, ppdt); | ||
DECLARE_INSTANCE_FIELD(BSML::ToggleSetting*, ppmt); | ||
DECLARE_INSTANCE_FIELD(UnityEngine::CanvasGroup*, _difficultyCanvasGroup); | ||
|
||
// Event Listeners | ||
// Delegates | ||
DECLARE_INSTANCE_FIELD(HMUI::ViewController::DidActivateDelegate*, didActivateDelegate); | ||
DECLARE_INSTANCE_FIELD(HMUI::ViewController::DidActivateDelegate*, modifierSelectionDidActivateDelegate); | ||
// DECLARE_INSTANCE_FIELD(HMUI::ViewController::DidDeactivateDelegate*, didDeactivateDelegate); | ||
DECLARE_INSTANCE_FIELD(System::Action_1<GlobalNamespace::MultiplayerLobbyState>*, setLobbyStateDelegate); | ||
DECLARE_INSTANCE_FIELD(System::Action_1<GlobalNamespace::LevelSelectionFlowCoordinator::State*>*, localSelectedBeatmapDelegate); | ||
DECLARE_INSTANCE_FIELD(System::Action_1<GlobalNamespace::BeatmapKey>*, updateDifficultyListDelegate); | ||
DECLARE_INSTANCE_FIELD(System::Action*, clearLocalSelectedBeatmapDelegate); | ||
DECLARE_INSTANCE_FIELD(System::Action*, updateButtonsEnabledDelegate); | ||
) |
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
Oops, something went wrong.