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