LeviLamina
Loading...
Searching...
No Matches
RemappingLayout.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/input/IconSize.h"
7#include "mc/client/input/RemappingLayoutRawIndex.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/deps/input/enums/RawInputType.h"
10
11// auto generated forward declare list
12// clang-format off
13class Keymapping;
14struct DuplicateKey;
15namespace Bedrock::PubSub { class Subscription; }
16namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
17// clang-format on
18
19class RemappingLayout {
20public:
21 // RemappingLayout inner types define
22 using RefreshKeymappingPublisher =
23 ::Bedrock::PubSub::Publisher<void(::std::optional<uint64>), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>;
24
25public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 24, ::std::vector<::Keymapping>> mKeymappings;
29 ::ll::TypedStorage<8, 24, ::std::vector<::Keymapping>> mDefaultMappings;
30 ::ll::TypedStorage<
31 8,
32 16,
33 ::std::shared_ptr<
34 ::Bedrock::PubSub::
35 Publisher<void(::std::optional<uint64>), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>>>
36 mRefreshKeymappingsPublisher;
37 ::ll::TypedStorage<8, 32, ::RemappingLayoutRawIndex> mLayoutRawIndex;
38 // NOLINTEND
39
40public:
41 // virtual functions
42 // NOLINTBEGIN
43 virtual ~RemappingLayout();
44
45 virtual void setMappingWithRawInput(::std::string const& action, int key, ::RawInputType type);
46
47 virtual int getAdjustedKey(int key) const;
48
49 virtual ::std::string getSaveString(::std::string const& action) const;
50
51 virtual ::std::string getMappedKeyName(int key) const;
52
53 virtual ::std::string getMappedKeyName(int key, bool checkUserConfiguredSwap) const;
54
55 virtual ::std::string getMappedKeyName(::Keymapping const& keyMapping) const;
56
57 virtual ::std::string getKeySpriteLocation(int key, ::IconSize iconSize) const;
58
59 virtual ::std::string getKeySpriteLocation(::Keymapping const& keyMapping) const;
60
61 virtual int _rawKeyToKey(int rawInputKey, ::RawInputType rawInputType) const = 0;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI RemappingLayout();
68
69 MCAPI void assignDefaultMapping(::std::vector<::Keymapping>&& newDefaultMapping);
70
71 MCAPI ::std::vector<::DuplicateKey> generateIndicesOfDuplicates() const;
72
73 MCAPI ::Keymapping const& getKeymappingByAction(::std::string const& action) const;
74
75 MCAPI ::Bedrock::PubSub::Subscription
76 registerRefreshKeymappingsListener(::std::function<void(::std::optional<uint64>)> callback);
77
78 MCAPI void setMapping(::std::string const& action, ::std::vector<int> const& keys);
79
80 MCAPI void unassignDuplicateKeys(uint64 index);
81 // NOLINTEND
82
83public:
84 // constructor thunks
85 // NOLINTBEGIN
86 MCAPI void* $ctor();
87 // NOLINTEND
88
89public:
90 // destructor thunk
91 // NOLINTBEGIN
92 MCAPI void $dtor();
93 // NOLINTEND
94
95public:
96 // virtual function thunks
97 // NOLINTBEGIN
98 MCAPI void $setMappingWithRawInput(::std::string const& action, int key, ::RawInputType type);
99
100 MCFOLD int $getAdjustedKey(int key) const;
101
102 MCFOLD ::std::string $getSaveString(::std::string const& action) const;
103
104 MCFOLD ::std::string $getMappedKeyName(int key) const;
105
106 MCFOLD ::std::string $getMappedKeyName(int key, bool checkUserConfiguredSwap) const;
107
108 MCAPI ::std::string $getMappedKeyName(::Keymapping const& keyMapping) const;
109
110 MCFOLD ::std::string $getKeySpriteLocation(int key, ::IconSize iconSize) const;
111
112 MCAPI ::std::string $getKeySpriteLocation(::Keymapping const& keyMapping) const;
113 // NOLINTEND
114
115public:
116 // vftables
117 // NOLINTBEGIN
118 MCNAPI static void** $vftable();
119 // NOLINTEND
120};
Definition Subscription.h:10
Definition Keymapping.h:5
Definition RemappingLayout.h:5
static MCAPI void ** $vftable()
Definition DuplicateKey.h:5