38 mValueChangedPublisher;
44 mInputModeChangedPublisher;
56 ::ll::TypedStorage<8, 32, ::std::string> mSaveTag;
57 ::ll::TypedStorage<8, 32, ::std::string> mTelemetryProperty;
58 ::ll::TypedStorage<1, 1, ::Social::Events::PrivacyTagEnterprise> mTelemetryTag;
59 ::ll::TypedStorage<4, 4, ::OptionID const> mID;
60 ::ll::TypedStorage<4, 4, ::OptionOwnerType const> mOwnerType;
61 ::ll::TypedStorage<4, 4, ::OptionType> mOptionType;
62 ::ll::TypedStorage<8, 32, ::std::string const> mCaptionId;
63 ::ll::TypedStorage<8, 56, ::GameVersion> mDefaultVersion;
64 ::ll::TypedStorage<4, 4, ::OptionResetFlags const> mOptionResetFlags;
65 ::ll::TypedStorage<8, 8, ::Option*> mOverrideSource;
66 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceValueChangedSubscription;
67 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOverrideSourceInputModeChangedSubscription;
68 ::ll::TypedStorage<8, 64, ::std::function<void(
bool)>> mRequestSaveCallback;
80 ::OptionOwnerType ownerType,
81 ::OptionResetFlags resetFlags,
82 ::std::string
const& captionId,
83 ::std::string
const& saveTag,
84 ::OptionType optionType,
96 ::OptionOwnerType ownerType,
97 ::OptionResetFlags resetFlags,
98 ::std::string
const& captionId,
99 ::std::string
const& saveTag,
100 ::OptionType optionType,
112 using BoolFilter = ::std::function<bool(
bool)>;
114 using SaveIntCallback = ::std::function<int(
int)>;
116 using StringFilter = ::std::function<::std::string(::std::string
const&)>;
121 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Option::Impl>> mImpl;
132 virtual ~Option() =
default;
137 virtual void save(::std::vector<::std::pair<::std::string, ::std::string>>& propertyVector) = 0;
139 virtual void load(::std::string
const& valueString) = 0;
141 virtual void load(::std::map<::std::string, ::std::string>& propertyMap);
151 ::OptionOwnerType ownerType,
152 ::OptionResetFlags resetFlags,
153 ::std::string
const& captionId,
154 ::std::string
const& saveTag,
155 ::OptionType optionType,
160 MCAPI
void _resetOption(::InputMode inputMode,
bool saveOptionChange);
163 MCAPI
void _updatePropertyVector(
164 ::std::vector<::std::pair<::std::string, ::std::string>>& propertyVector,
165 ::std::string
const& value
169 MCAPI
bool canModify()
const;
171 MCAPI
void clearSaveTag();
174 MCAPI
bool getBool()
const;
177 MCAPI
bool getBool(::InputMode inputMode)
const;
179 MCAPI ::std::string
const& getCaptionId()
const;
181 MCAPI
float getFloat()
const;
183 MCAPI
float getFloat(::InputMode inputMode)
const;
185 MCAPI
float getFloatMax()
const;
187 MCAPI
float getFloatMin()
const;
189 MCAPI ::OptionID getID()
const;
191 MCAPI
int getInt()
const;
193 MCAPI int64 getInt64()
const;
195 MCAPI
int getIntMax()
const;
197 MCAPI
int getIntMin()
const;
199 MCAPI ::OptionOwnerType getOptionOwnerType()
const;
201 MCAPI ::OptionResetFlags getOptionResetFlags()
const;
203 MCAPI ::std::string
const& getSaveTag()
const;
205 MCAPI ::std::string
const& getString()
const;
207 MCAPI ::std::vector<::std::string> getStringList()
const;
209 MCAPI ::std::string
const& getTelemetryProperty()
const;
211 MCAPI ::Social::Events::PrivacyTagEnterprise getTelemetryTag()
const;
213 MCAPI ::OptionType getType()
const;
215 MCAPI ::std::unordered_map<int, ::std::string>
const& getValueNameMap()
const;
217 MCAPI ::std::vector<int>
const& getValues()
const;
219 MCAPI
bool hasOverrideSource()
const;
221 MCAPI
bool isDefaultValue()
const;
223 MCAPI
bool isDefaultValue(::InputMode inputMode)
const;
227 MCAPI
bool isType(::OptionType type)
const;
229 MCAPI
void notifyOptionValueChanged(
bool saveOptionChange);
231 MCAPI
void notifyOptionValueChanged(::InputMode inputMode,
bool saveOptionChange);
234 MCAPI ::Bedrock::PubSub::Subscription registerLock(::std::function<
void(
bool&)> isModifiableCondition);
237 MCAPI ::Bedrock::PubSub::Subscription
238 registerObserver(::std::function<
void(::Option
const&, ::InputMode)> onInputModeChangedCallback);
241 MCAPI ::Bedrock::PubSub::Subscription
242 registerObserver(::std::function<
void(::Option
const&)> onValueChangedCallback);
245 MCAPI ::Bedrock::PubSub::Subscription
246 registerResetObserver(::std::function<
void(::Option
const&)> onValueResetCallback);
249 registerTelemetryProperty(::std::string
const& propertyName, ::Social::Events::PrivacyTagEnterprise propertyTag);
253 MCAPI
void reset(::InputMode inputMode);
255 MCAPI
void resetForced(
bool saveOptionChange);
257 MCAPI
void set(
int value);
259 MCAPI
void set(::InputMode inputmode,
float value);
261 MCAPI
void set(::InputMode inputmode,
bool value);
263 MCAPI
void setCoerceSaveValueCallback(::std::function<
int(
int)> callback);
265 MCAPI
void setCoerceValueCallback(::std::function<::std::string(::std::string
const&)> f);
267 MCAPI
void setCoerceValueCallback(::std::function<
bool(
bool)> f);
269 MCAPI
void setOverrideSource(::Option* overrideSource);
271 MCAPI
void setRequestSaveCallback(::std::function<
void(
bool)> callback);
281 MCAPI
static bool read(::std::string
const& valueString,
int& output);
283 MCAPI
static bool read(::std::string
const& valueString,
float& output);
285 MCAPI
static bool read(::std::string
const& valueString, ::std::vector<::std::string>& output);
288 MCAPI
static bool read(::std::string
const& valueString,
bool& output);
296 ::OptionOwnerType ownerType,
297 ::OptionResetFlags resetFlags,
298 ::std::string
const& captionId,
299 ::std::string
const& saveTag,
300 ::OptionType optionType,
314 MCAPI
void $load(::std::map<::std::string, ::std::string>& propertyMap);