Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions addons/source-python/packages/source-python/config/cvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,34 @@ def __exit__(self, exctype, value, trace_back):
# Return
return True

def __bool__(self):
"""Return the boolean value of the ConVar.

:rtype: bool
"""
return bool(self.cvar)

def __int__(self):
"""Return the integer value of the ConVar.

:rtype: int
"""
return int(self.cvar)

def __float__(self):
"""Return the floating point value of the ConVar.

:rtype: float
"""
return float(self.cvar)

def __str__(self):
"""Return the string value of the ConVar.

:rtype: str
"""
return str(self.cvar)

def text(self, text):
"""Add a text to the list.

Expand Down