Browse Source

fix international chat in Toontown

David Rose 20 years ago
parent
commit
34cd6206a2
1 changed files with 9 additions and 0 deletions
  1. 9 0
      direct/src/gui/DirectEntry.py

+ 9 - 0
direct/src/gui/DirectEntry.py

@@ -11,6 +11,9 @@ class DirectEntry(DirectFrame):
     DirectEntry(parent) - Create a DirectGuiWidget which responds
     DirectEntry(parent) - Create a DirectGuiWidget which responds
     to keyboard buttons
     to keyboard buttons
     """
     """
+
+    directWtext = ConfigVariableBool('direct-wtext', 1)
+    
     def __init__(self, parent = None, **kw):
     def __init__(self, parent = None, **kw):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         # A Direct Frame can have:
         # A Direct Frame can have:
@@ -156,6 +159,12 @@ class DirectEntry(DirectFrame):
             self.guiItem.setText(text)
             self.guiItem.setText(text)
 
 
     def get(self):
     def get(self):
+        if not self.directWtext.getValue():
+            # If the user has configured wide-text off, then always
+            # return an 8-bit string.  This will be encoded if
+            # necessary, according to Panda's default encoding.
+            return self.guiItem.getText()
+            
         if self.unicodeText:
         if self.unicodeText:
             return self.guiItem.getWtext()
             return self.guiItem.getWtext()
         else:
         else: