Skip to content
LeviMC
English
AutoLightDark
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::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 ::ll::TypedStorage<8, 32, ::RemappingLayoutRawIndex> mLayoutRawIndex;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
41 RemappingLayout(RemappingLayout const&);
42 RemappingLayout();
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 virtual ~RemappingLayout();
48
49 virtual void setMappingWithRawInput(::std::string const& action, int key, ::RawInputType type);
50
51 virtual int getAdjustedKey(int key) const;
52
53 virtual ::std::string getSaveString(::std::string const& action) const;
54
55 virtual ::std::string getMappedKeyName(int key) const;
56
57 virtual ::std::string getMappedKeyName(int key, bool checkUserConfiguredSwap) const;
58
59 virtual ::std::string getMappedKeyName(::Keymapping const& keyMapping) const;
60
61 virtual ::std::string getKeySpriteLocation(
62 int key,
63 bool checkUserConfiguredSwap,
64 bool checkPlatformButtonSwapping,
65 ::IconSize iconSize
66 ) const;
67
68 virtual ::std::string getKeySpriteLocation(::Keymapping const& keyMapping) const;
69
70 virtual int _rawKeyToKey(int rawInputKey, ::RawInputType rawInputType) const = 0;
71 // NOLINTEND
72
73public:
74 // member functions
75 // NOLINTBEGIN
76 MCAPI void assignDefaultMapping(::std::vector<::Keymapping>&& newDefaultMapping);
77
78 MCNAPI void defaultKeyAtIndex(uint64 index);
79
80 MCNAPI ::std::vector<::DuplicateKey> generateIndicesOfDuplicates() const;
81
82 MCAPI ::Keymapping const& getKeymappingByAction(::std::string_view action) const;
83
84 MCNAPI ::RemappingLayout& operator=(::RemappingLayout const& other);
85
86 MCAPI void setMapping(::std::string_view action, ::std::vector<int> const& keys);
87
88 MCAPI void unassignDuplicateKeys(uint64 index);
89
90 MCNAPI void unassignKeyAtIndex(uint64 index);
91 // NOLINTEND
92
93public:
94 // destructor thunk
95 // NOLINTBEGIN
96 MCNAPI void $dtor();
97 // NOLINTEND
98
99public:
100 // virtual function thunks
101 // NOLINTBEGIN
102 MCNAPI void $setMappingWithRawInput(::std::string const& action, int key, ::RawInputType type);
103
104 MCNAPI int $getAdjustedKey(int key) const;
105
106 MCNAPI ::std::string $getSaveString(::std::string const& action) const;
107
108 MCNAPI ::std::string $getMappedKeyName(int key) const;
109
110 MCNAPI ::std::string $getMappedKeyName(int key, bool checkUserConfiguredSwap) const;
111
112 MCNAPI ::std::string $getMappedKeyName(::Keymapping const& keyMapping) const;
113
114 MCNAPI ::std::string $getKeySpriteLocation(
115 int key,
116 bool checkUserConfiguredSwap,
117 bool checkPlatformButtonSwapping,
118 ::IconSize iconSize
119 ) const;
120
121 MCNAPI ::std::string $getKeySpriteLocation(::Keymapping const& keyMapping) const;
122 // NOLINTEND
123
124public:
125 // vftables
126 // NOLINTBEGIN
127 MCNAPI static void** $vftable();
128 // NOLINTEND
129};
Definition Keymapping.h:5
Definition RemappingLayout.h:5
MCAPI::std::string $getMappedKeyName(int key, bool checkUserConfiguredSwap) const
MCAPI::std::string $getMappedKeyName(int key) const
MCAPI::std::string $getKeySpriteLocation(int key, bool checkUserConfiguredSwap, bool checkPlatformButtonSwapping, ::IconSize iconSize) const
MCAPI::std::string $getKeySpriteLocation(::Keymapping const &keyMapping) const
MCAPI int $getAdjustedKey(int key) const
MCAPI void $dtor()
MCAPI void $setMappingWithRawInput(::std::string const &action, int key, ::RawInputType type)
MCAPI void unassignKeyAtIndex(uint64 index)
static MCAPI void ** $vftable()
MCAPI::RemappingLayout & operator=(::RemappingLayout const &other)
MCAPI::std::string $getMappedKeyName(::Keymapping const &keyMapping) const
MCAPI::std::string $getSaveString(::std::string const &action) const
MCAPI void defaultKeyAtIndex(uint64 index)
MCAPI ::std::vector<::DuplicateKey > generateIndicesOfDuplicates() const
Definition DuplicateKey.h:5