We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3391d92 commit 4efc7efCopy full SHA for 4efc7ef
src/core/modules/cvars/cvars_wrap.cpp
@@ -281,6 +281,26 @@ void export_convar(scope _cvars)
281
"Remove the notify flag and makes the cvar no longer public."
282
)
283
284
+ // Special methods...
285
+ .def("__float__",
286
+ &ConVar::GetFloat,
287
+ "Returns the value as a float."
288
+ )
289
+
290
+ .def("__int__",
291
+ &ConVar::GetInt,
292
+ "Returns the value as an int."
293
294
295
+ .def("__bool__",
296
+ &ConVar::GetBool,
297
+ "Returns the value as a bool."
298
299
300
+ .def("__str__",
301
+ &ConVar::GetString,
302
+ "Returns the value as a string."
303
304
305
ADD_MEM_TOOLS(ConVar)
306
;
0 commit comments