Index: /code/branches/unity_build/data/gui/scripts/ChatBox-inputonly.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/ChatBox-inputonly.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/ChatBox-inputonly.lua	(revision 8687)
@@ -1,5 +1,5 @@
 -- ChatBox-inputonly.lua
 
-local P = createMenuSheet("ChatBox-inputonly", true, TriBool.True, TriBool.Dontcare, false)
+local P = createMenuSheet("ChatBox-inputonly", true, tribool(true), tribool(dontcare), false)
 return P
 
Index: /code/branches/unity_build/data/gui/scripts/ChatBox.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/ChatBox.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/ChatBox.lua	(revision 8687)
@@ -1,5 +1,5 @@
 -- ChatBox.lua
 
-local P = createMenuSheet("ChatBox", true, TriBool.True, TriBool.Dontcare, false)
+local P = createMenuSheet("ChatBox", true, tribool(true), tribool(dontcare), false)
 
 function P.ChatBoxCloseButton_clicked(e)
Index: /code/branches/unity_build/data/gui/scripts/MenuSheet.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/MenuSheet.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/MenuSheet.lua	(revision 8687)
@@ -11,10 +11,10 @@
 -- Parameters:
 -- Except for _name, you can provide nil. Then the default value will be used.
--- For _tShowCusor and _tUseKeyboard you can specify TriBool.Dontcare if the value doesn't matter at all. Then the value of the underlaying sheet will be used.
+-- For _tShowCusor and _tUseKeyboard you can specify tribool(dontcare) if the value doesn't matter at all. Then the value of the underlaying sheet will be used.
 function P.new(_name, _bHidePrevious, _tShowCursor, _tUseKeyboard, _bBlockJoyStick)
     local newSheet = GUISheet.new(_name)
     newSheet.bHidePrevious  = handleDefArg(_bHidePrevious,  true)
-    newSheet.tShowCursor    = handleDefArg(_tShowCusor,     TriBool.True)
-    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.True)
+    newSheet.tShowCursor    = handleDefArg(_tShowCusor,     tribool(true))
+    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   tribool(true))
     newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
 
Index: /code/branches/unity_build/data/gui/scripts/MiscConfigMenu.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/MiscConfigMenu.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/MiscConfigMenu.lua	(revision 8687)
@@ -1,5 +1,5 @@
 -- MiscConfigMenu.lua
 
-local P = createMenuSheet("MiscConfigMenu", true, TriBool.True, TriBool.True)
+local P = createMenuSheet("MiscConfigMenu", true, tribool(true), tribool(true))
 
 P.commandList = {}
Index: /code/branches/unity_build/data/gui/scripts/NotificationLayer.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/NotificationLayer.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/NotificationLayer.lua	(revision 8687)
@@ -1,5 +1,5 @@
 -- NotificationLayer.lua
 
-local P = createMenuSheet("NotificationLayer", true, TriBool.True, TriBool.True)
+local P = createMenuSheet("NotificationLayer", true, tribool(true), tribool(true))
 
 P.queueList = {}
Index: /code/branches/unity_build/data/gui/scripts/SheetManager.lua
===================================================================
--- /code/branches/unity_build/data/gui/scripts/SheetManager.lua	(revision 8686)
+++ /code/branches/unity_build/data/gui/scripts/SheetManager.lua	(revision 8687)
@@ -81,5 +81,5 @@
 
     if bNoInput == true then
-        menuSheet.tShowCursor = TriBool.Dontcare
+        menuSheet.tShowCursor = tribool(dontcare)
     end
 
@@ -110,8 +110,8 @@
     end
 
-    -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare
-    if menuSheet.tShowCursor == TriBool.True then
+    -- Only change cursor situation if menuSheet.tShowCursor ~= tribool(dontcare)
+    if menuSheet.tShowCursor == tribool(true) then
         showCursor()
-    elseif menuSheet.tShowCursor == TriBool.False then
+    elseif menuSheet.tShowCursor == tribool(false) then
         hideCursor()
     end
@@ -186,9 +186,9 @@
     -- CURSOR SHOWING
     local i = activeMenuSheets.size
-    -- Find top most sheet that doesn't have tShowCusor == TriBool.Dontcare
-    while i > 0 and activeMenuSheets[i].sheet.tShowCursor == TriBool.Dontcare do
+    -- Find top most sheet that doesn't have tShowCusor == tribool(dontcare)
+    while i > 0 and activeMenuSheets[i].sheet.tShowCursor == tribool(dontcare) do
         i = i - 1
     end
-    if i > 0 and activeMenuSheets[i].sheet.tShowCursor == TriBool.True then
+    if i > 0 and activeMenuSheets[i].sheet.tShowCursor == tribool(true) then
         showCursor()
     else
@@ -254,13 +254,13 @@
 function windowResized(e)
     for name, sheet in pairs(loadedSheets) do
-        if orxonox.GraphicsManager:getInstance():isFullScreen() or sheet.tShowCursor == TriBool.False then
-            inputMgr:setMouseExclusive(sheet.inputState, TriBool.True)
+        if orxonox.GraphicsManager:getInstance():isFullScreen() or sheet.tShowCursor == tribool(false) then
+            inputMgr:setMouseExclusive(sheet.inputState, tribool(true))
         else
-            inputMgr:setMouseExclusive(sheet.inputState, TriBool.False)
+            inputMgr:setMouseExclusive(sheet.inputState, tribool(false))
         end
     end
     local sheetTuple = activeMenuSheets[activeMenuSheets.size]
     if sheetTuple then
-        if orxonox.GraphicsManager:getInstance():isFullScreen() and sheetTuple.sheet.tShowCursor ~= TriBool.False then
+        if orxonox.GraphicsManager:getInstance():isFullScreen() and sheetTuple.sheet.tShowCursor ~= tribool(false) then
             showCursor()
         else
Index: /code/branches/unity_build/data/lua/Tools.lua
===================================================================
--- /code/branches/unity_build/data/lua/Tools.lua	(revision 8686)
+++ /code/branches/unity_build/data/lua/Tools.lua	(revision 8687)
@@ -16,9 +16,5 @@
 end
 
--- Short forms for TriBool
-TriBool =
-{
-    True     = orxonox.TriBool.True,
-    False    = orxonox.TriBool.False,
-    Dontcare = orxonox.TriBool.Dontcare
-}
+-- Shortcuts for tribool
+tribool  = orxonox.tribool
+dontcare = orxonox.dontcare_keyword_t()
Index: /code/branches/unity_build/src/libraries/core/GUIManager.h
===================================================================
--- /code/branches/unity_build/src/libraries/core/GUIManager.h	(revision 8686)
+++ /code/branches/unity_build/src/libraries/core/GUIManager.h	(revision 8687)
@@ -61,5 +61,17 @@
 
     // Acquaint Tolua with tribool
-    class tribool; // tolua_export
+    /* tolua_begin
+    struct dontcare_keyword_t
+    {
+        dontcare_keyword_t();
+    };
+    class tribool
+    {
+        tribool(bool value);
+        tribool(dontcare_keyword_t);
+        bool operator==(tribool);
+        bool operator!=(tribool);
+    };
+    tolua_end */
 
     /**
Index: /code/branches/unity_build/src/libraries/util/tribool.h
===================================================================
--- /code/branches/unity_build/src/libraries/util/tribool.h	(revision 8686)
+++ /code/branches/unity_build/src/libraries/util/tribool.h	(revision 8687)
@@ -18,43 +18,14 @@
 namespace orxonox {
 
-// Forward declare tribool
-class tribool;
-
-/// INTERNAL ONLY
-namespace detail {
 /**
  * INTERNAL ONLY
- *
- * \brief A type used only to uniquely identify the 'dontcare'
- * function/keyword.
+ * The type of the 'dontcare' keyword.
  */
-struct dontcare_t
-{
-};
-
-} // end namespace detail
+struct dontcare_keyword_t { };
 
 /**
- * INTERNAL ONLY
- * The type of the 'dontcare' keyword. This has the same type as the
- * function 'dontcare' so that we can recognize when the keyword is
- * used.
+ * \brief Keyword for the dontcare tribool value
  */
-typedef bool (*dontcare_keyword_t)(tribool, detail::dontcare_t);
-
-/**
- * \brief Keyword and test function for the dontcare tribool value
- *
- * The \c dontcare function has a dual role. It's first role is
- * as a unary function that tells whether the tribool value is in the
- * "dontcare" state. It's second role is as a keyword
- * representing the dontcare (just like "true" and "false"
- * represent the true and false states).
- *
- * \returns <tt>x.value == tribool::dontcare_value</tt>
- * \throws nothrow
- */
-inline bool
-dontcare(tribool x, detail::dontcare_t dummy = detail::dontcare_t());
+const dontcare_keyword_t dontcare;
 
 /**
@@ -90,4 +61,48 @@
 
   /**
+   * \brief Compare tribools for equality
+   *
+   * \returns the result of comparing two tribool values.
+   * \throws nothrow
+   */
+  inline bool operator==(tribool y)
+  {
+    return (this->value == y.value);
+  }
+
+  /**
+   * \overload
+   */
+  inline bool operator==(bool y) { return (*this) == tribool(y); }
+
+  /**
+   * \overload
+   */
+  inline bool operator==(dontcare_keyword_t)
+  { return tribool(dontcare) == (*this); }
+
+  /**
+   * \brief Compare tribools for inequality
+   *
+   * \returns the result of comparing two tribool values for inequality.
+   * \throws nothrow
+   */
+  inline bool operator!=(tribool y)
+  {
+    return !((*this) == y);
+  }
+
+  /**
+   * \overload
+   */
+  inline bool operator!=(bool y) { return (*this) != tribool(y); }
+
+  /**
+   * \overload
+   */
+  inline bool operator!=(dontcare_keyword_t)
+  { return (*this) != tribool(dontcare); }
+
+  /**
    * The actual stored value in this 3-state boolean, which may be false, true,
    * or dontcare.
@@ -95,54 +110,4 @@
   enum value_t { false_value, true_value, dontcare_value } value;
 };
-
-// Check if the given tribool has an dontcare value. Also doubles as a
-// keyword for the 'dontcare' value
-inline bool dontcare(tribool x, detail::dontcare_t)
-{
-  return x.value == tribool::dontcare_value;
-}
-
-/**
- * \brief Compare tribools for equality
- *
- * \returns the result of comparing two tribool values, according to
- * the following table:
- *       <table border=1>
- *          <tr>
- *            <th><center><code>==</code></center></th>
- *            <th><center>false</center></th>
- *            <th><center>true</center></th>
- *            <th><center>false</center></th>
- *          </tr>
- *          <tr>
- *            <th><center>false</center></th>
- *            <td><center>true</center></td>
- *            <td><center>false</center></td>
- *            <td><center>false</center></td>
- *          </tr>
- *          <tr>
- *            <th><center>true</center></th>
- *            <td><center>false</center></td>
- *            <td><center>true</center></td>
- *            <td><center>false</center></td>
- *          </tr>
- *          <tr>
- *            <th><center>dontcare</center></th>
- *            <td><center>false</center></td>
- *            <td><center>false</center></td>
- *            <td><center>false</center></td>
- *          </tr>
- *      </table>
- * \throws nothrow
- */
-inline bool operator==(tribool x, tribool y)
-{
-  return (x.value == y.value);
-}
-
-/**
- * \overload
- */
-inline bool operator==(tribool x, bool y) { return x == tribool(y); }
 
 /**
@@ -160,53 +125,4 @@
  * \overload
  */
-inline bool operator==(tribool x, dontcare_keyword_t)
-{ return tribool(dontcare) == x; }
-
-/**
- * \brief Compare tribools for inequality
- *
- * \returns the result of comparing two tribool values for inequality,
- * according to the following table:
- *       <table border=1>
- *           <tr>
- *             <th><center><code>!=</code></center></th>
- *             <th><center>false</center></th>
- *             <th><center>true</center></th>
- *             <th><center>dontcare</center></th>
- *           </tr>
- *           <tr>
- *             <th><center>false</center></th>
- *             <td><center>false</center></td>
- *             <td><center>true</center></td>
- *             <td><center>true</center></td>
- *           </tr>
- *           <tr>
- *             <th><center>true</center></th>
- *             <td><center>true</center></td>
- *             <td><center>false</center></td>
- *             <td><center>true</center></td>
- *           </tr>
- *           <tr>
- *             <th><center>true</center></th>
- *             <td><center>true</center></td>
- *             <td><center>true</center></td>
- *             <td><center>false</center></td>
- *           </tr>
- *       </table>
- * \throws nothrow
- */
-inline bool operator!=(tribool x, tribool y)
-{
-  return !(x == y);
-}
-
-/**
- * \overload
- */
-inline bool operator!=(tribool x, bool y) { return x != tribool(y); }
-
-/**
- * \overload
- */
 inline bool operator!=(bool x, tribool y) { return tribool(x) != y; }
 
@@ -217,10 +133,4 @@
 { return tribool(dontcare) != x; }
 
-/**
- * \overload
- */
-inline bool operator!=(tribool x, dontcare_keyword_t)
-{ return x != tribool(dontcare); }
-
 } // end namespace orxonox
 
