diff --git a/source/gui/CDropDown.cpp b/source/gui/CDropDown.cpp index 1d1a7e45d4..567f9d8d78 100644 --- a/source/gui/CDropDown.cpp +++ b/source/gui/CDropDown.cpp @@ -267,7 +267,7 @@ CRect CDropDown::GetListRect() const bool CDropDown::MouseOver() { if(!GetGUI()) - throw PS_NEEDS_PGUI; + throw PSERROR_GUI_OperationNeedsGUIObject(); if (m_Open) { diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h index 452620530e..fd81226820 100644 --- a/source/gui/CGUI.h +++ b/source/gui/CGUI.h @@ -32,10 +32,6 @@ CGUI #ifndef INCLUDED_CGUI #define INCLUDED_CGUI -#include "ps/Errors.h" -ERROR_GROUP(GUI); -ERROR_TYPE(GUI, JSOpenFailed); - //-------------------------------------------------------- // Includes / Compiler directives //-------------------------------------------------------- @@ -66,6 +62,8 @@ extern InReaction gui_handler(const SDL_Event_* ev); // Error declarations //-------------------------------------------------------- +ERROR_TYPE(GUI, JSOpenFailed); + //-------------------------------------------------------- // Declarations //-------------------------------------------------------- diff --git a/source/gui/GUIbase.cpp b/source/gui/GUIbase.cpp index 49bdafc937..1b08ff0cc0 100644 --- a/source/gui/GUIbase.cpp +++ b/source/gui/GUIbase.cpp @@ -182,14 +182,3 @@ bool CClientArea::SetClientArea(const CStr& Value) //-------------------------------------------------------- // Error definitions //-------------------------------------------------------- -// TODO Gee: (2004-09-01) Keeper? The PS_NAME_ABIGUITY for instance doesn't let the user know which objects. -DEFINE_ERROR(PS_NAME_TAKEN, "Reference name is taken"); -DEFINE_ERROR(PS_OBJECT_FAIL, "Object provided is null"); -DEFINE_ERROR(PS_SETTING_FAIL, "Setting does not exist"); -DEFINE_ERROR(PS_VALUE_INVALID, "Value provided is syntactically incorrect"); -DEFINE_ERROR(PS_NEEDS_PGUI, "m_pGUI is NULL when needed for a requested operation"); -DEFINE_ERROR(PS_NAME_AMBIGUITY, "Two or more objects are sharing name"); -DEFINE_ERROR(PS_NEEDS_NAME, "An object are trying to fit into a GUI without a name"); - -DEFINE_ERROR(PS_LEXICAL_FAIL, "PS_LEXICAL_FAIL"); -DEFINE_ERROR(PS_SYNTACTICAL_FAIL, "PS_SYNTACTICAL_FAIL"); diff --git a/source/gui/GUIbase.h b/source/gui/GUIbase.h index 439ffb7487..3f73fd9858 100644 --- a/source/gui/GUIbase.h +++ b/source/gui/GUIbase.h @@ -44,6 +44,9 @@ GUI Core, stuff that the whole GUI uses #include "ps/Overlay.h" #include "ps/CStr.h" + +#include "ps/Errors.h" + #include "ps/Pyrogenesis.h" // deprecated DECLARE_ERROR //-------------------------------------------------------- @@ -217,15 +220,14 @@ public: //-------------------------------------------------------- // Error declarations //-------------------------------------------------------- -DECLARE_ERROR(PS_NAME_TAKEN); -DECLARE_ERROR(PS_OBJECT_FAIL); -DECLARE_ERROR(PS_SETTING_FAIL); -DECLARE_ERROR(PS_VALUE_INVALID); -DECLARE_ERROR(PS_NEEDS_PGUI); -DECLARE_ERROR(PS_NAME_AMBIGUITY); -DECLARE_ERROR(PS_NEEDS_NAME); +ERROR_GROUP(GUI); -DECLARE_ERROR(PS_LEXICAL_FAIL); -DECLARE_ERROR(PS_SYNTACTICAL_FAIL); +ERROR_TYPE(GUI, ReferenceNameTake); +ERROR_TYPE(GUI, NullObjectProvided); +ERROR_TYPE(GUI, InvalidSetting); +ERROR_TYPE(GUI, InvalidValueSyntax); +ERROR_TYPE(GUI, OperationNeedsGUIObject); +ERROR_TYPE(GUI, NameAmbiguity); +ERROR_TYPE(GUI, ObjectNeedsName); #endif diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp index 1456de8349..fcd7fe9bd0 100644 --- a/source/gui/GUIutil.cpp +++ b/source/gui/GUIutil.cpp @@ -310,11 +310,11 @@ template PS_RESULT GUI::GetSettingPointer(const IGUIObject *pObject, const CStr& Setting, T* &Value) { if (pObject == NULL) - return PS_OBJECT_FAIL; + throw PSERROR_GUI_NullObjectProvided(); std::map::const_iterator it = pObject->m_Settings.find(Setting); if (it == pObject->m_Settings.end()) - return PS_SETTING_FAIL; + throw PSERROR_GUI_InvalidSetting(); if (it->second.m_pSetting == NULL) return PS_FAIL; @@ -344,10 +344,10 @@ PS_RESULT GUI::SetSetting(IGUIObject *pObject, const CStr& Setting, const T &Value, const bool& SkipMessage) { if (pObject == NULL) - return PS_OBJECT_FAIL; + throw PSERROR_GUI_NullObjectProvided(); if (!pObject->SettingExists(Setting)) - return PS_SETTING_FAIL; + throw PSERROR_GUI_InvalidSetting(); #ifndef NDEBUG CheckType(pObject, Setting); diff --git a/source/gui/GUIutil.h b/source/gui/GUIutil.h index f16ace598b..af04f620fb 100644 --- a/source/gui/GUIutil.h +++ b/source/gui/GUIutil.h @@ -163,7 +163,7 @@ public: const CStr& Setting, T &Value) { if (!GUIinstance.ObjectExists(Object)) - return PS_OBJECT_FAIL; + throw PSERROR_GUI_NullObjectProvided(); // Retrieve pointer and call sibling function const IGUIObject *pObject = GetObjectPointer(GUIinstance, Object); @@ -201,7 +201,7 @@ public: const bool& SkipMessage=false) { if (!GUIinstance.ObjectExists(Object)) - return PS_OBJECT_FAIL; + throw PSERROR_GUI_NullObjectProvided(); // Retrieve pointer and call sibling function diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp index 6aff1448fb..dab0e9576e 100644 --- a/source/gui/IGUIObject.cpp +++ b/source/gui/IGUIObject.cpp @@ -147,11 +147,11 @@ void IGUIObject::AddToPointersMap(map_pObjects &ObjectMap) // (i.e. being the base object) if (m_Name.empty()) { - throw PS_NEEDS_NAME; + throw PSERROR_GUI_ObjectNeedsName(); } if (ObjectMap.count(m_Name) > 0) { - throw PS_NAME_AMBIGUITY; + throw PSERROR_GUI_NameAmbiguity(); } else { @@ -195,7 +195,7 @@ void IGUIObject::AddSetting(const EGUISettingType &Type, const CStr& Name) bool IGUIObject::MouseOver() { if(!GetGUI()) - throw PS_NEEDS_PGUI; + throw PSERROR_GUI_OperationNeedsGUIObject(); return m_CachedActualSize.PointInside(GetMousePos()); } @@ -282,7 +282,7 @@ PS_RESULT IGUIObject::SetSetting(const CStr& Setting, const CStr& Value, const b PS_RESULT IGUIObject::GetSettingType(const CStr& Setting, EGUISettingType &Type) const { if (!SettingExists(Setting)) - return PS_SETTING_FAIL; + throw PSERROR_GUI_InvalidSetting(); if (m_Settings.find(Setting) == m_Settings.end()) return PS_FAIL; diff --git a/source/ps/Errors.cpp b/source/ps/Errors.cpp index 24b4575ae0..94e6036aad 100644 --- a/source/ps/Errors.cpp +++ b/source/ps/Errors.cpp @@ -1,20 +1,3 @@ -/* Copyright (C) 2009 Wildfire Games. - * This file is part of 0 A.D. - * - * 0 A.D. is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * 0 A.D. is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with 0 A.D. If not, see . - */ - // Auto-generated by errorlist.pl - do not edit. #include "precompiled.h" @@ -50,7 +33,14 @@ class PSERROR_File_OpenFailed : public PSERROR_File { public: PSRETURN getCode() class PSERROR_File_ReadFailed : public PSERROR_File { public: PSRETURN getCode() const; }; class PSERROR_File_UnexpectedEOF : public PSERROR_File { public: PSRETURN getCode() const; }; class PSERROR_File_WriteFailed : public PSERROR_File { public: PSRETURN getCode() const; }; +class PSERROR_GUI_InvalidSetting : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_InvalidValueSyntax : public PSERROR_GUI { public: PSRETURN getCode() const; }; class PSERROR_GUI_JSOpenFailed : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_NameAmbiguity : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_NullObjectProvided : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_ObjectNeedsName : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_OperationNeedsGUIObject : public PSERROR_GUI { public: PSRETURN getCode() const; }; +class PSERROR_GUI_ReferenceNameTake : public PSERROR_GUI { public: PSRETURN getCode() const; }; class PSERROR_Game_World_MapLoadFailed : public PSERROR_Game_World { public: PSRETURN getCode() const; }; class PSERROR_I18n_Script_SetupFailed : public PSERROR_I18n_Script { public: PSRETURN getCode() const; }; class PSERROR_Renderer_VBOFailed : public PSERROR_Renderer { public: PSRETURN getCode() const; }; @@ -83,7 +73,14 @@ extern const PSRETURN PSRETURN_File_OpenFailed = 0x04000003; extern const PSRETURN PSRETURN_File_ReadFailed = 0x04000004; extern const PSRETURN PSRETURN_File_UnexpectedEOF = 0x04000005; extern const PSRETURN PSRETURN_File_WriteFailed = 0x04000006; -extern const PSRETURN PSRETURN_GUI_JSOpenFailed = 0x05000001; +extern const PSRETURN PSRETURN_GUI_InvalidSetting = 0x05000001; +extern const PSRETURN PSRETURN_GUI_InvalidValueSyntax = 0x05000002; +extern const PSRETURN PSRETURN_GUI_JSOpenFailed = 0x05000003; +extern const PSRETURN PSRETURN_GUI_NameAmbiguity = 0x05000004; +extern const PSRETURN PSRETURN_GUI_NullObjectProvided = 0x05000005; +extern const PSRETURN PSRETURN_GUI_ObjectNeedsName = 0x05000006; +extern const PSRETURN PSRETURN_GUI_OperationNeedsGUIObject = 0x05000007; +extern const PSRETURN PSRETURN_GUI_ReferenceNameTake = 0x05000008; extern const PSRETURN PSRETURN_Game_World_MapLoadFailed = 0x06040001; extern const PSRETURN PSRETURN_I18n_Script_SetupFailed = 0x07030001; extern const PSRETURN PSRETURN_Renderer_VBOFailed = 0x08000001; @@ -135,69 +132,83 @@ extern const PSRETURN CODE__PSRETURN_Scripting_DefineType = 0x09010000; extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile = 0xffff0000; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile = 0x09020000; -extern const PSRETURN MASK__PSRETURN_CVFSFile_AlreadyLoaded = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_CVFSFile_AlreadyLoaded = 0xffffffff; extern const PSRETURN CODE__PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001; -extern const PSRETURN MASK__PSRETURN_CVFSFile_InvalidBufferAccess = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_CVFSFile_InvalidBufferAccess = 0xffffffff; extern const PSRETURN CODE__PSRETURN_CVFSFile_InvalidBufferAccess = 0x01000002; -extern const PSRETURN MASK__PSRETURN_CVFSFile_LoadFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_CVFSFile_LoadFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_CVFSFile_LoadFailed = 0x01000003; -extern const PSRETURN MASK__PSRETURN_DllLoader_DllNotLoaded = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_DllLoader_DllNotLoaded = 0xffffffff; extern const PSRETURN CODE__PSRETURN_DllLoader_DllNotLoaded = 0x02000001; -extern const PSRETURN MASK__PSRETURN_DllLoader_SymbolNotFound = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_DllLoader_SymbolNotFound = 0xffffffff; extern const PSRETURN CODE__PSRETURN_DllLoader_SymbolNotFound = 0x02000002; -extern const PSRETURN MASK__PSRETURN_Error_InvalidError = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Error_InvalidError = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Error_InvalidError = 0x03000001; -extern const PSRETURN MASK__PSRETURN_File_InvalidType = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_InvalidType = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_InvalidType = 0x04000001; -extern const PSRETURN MASK__PSRETURN_File_InvalidVersion = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_InvalidVersion = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_InvalidVersion = 0x04000002; -extern const PSRETURN MASK__PSRETURN_File_OpenFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_OpenFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_OpenFailed = 0x04000003; -extern const PSRETURN MASK__PSRETURN_File_ReadFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_ReadFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_ReadFailed = 0x04000004; -extern const PSRETURN MASK__PSRETURN_File_UnexpectedEOF = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_UnexpectedEOF = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_UnexpectedEOF = 0x04000005; -extern const PSRETURN MASK__PSRETURN_File_WriteFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_File_WriteFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_File_WriteFailed = 0x04000006; -extern const PSRETURN MASK__PSRETURN_GUI_JSOpenFailed = 0xFFFFFFFF; -extern const PSRETURN CODE__PSRETURN_GUI_JSOpenFailed = 0x05000001; -extern const PSRETURN MASK__PSRETURN_Game_World_MapLoadFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_GUI_InvalidSetting = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_InvalidSetting = 0x05000001; +extern const PSRETURN MASK__PSRETURN_GUI_InvalidValueSyntax = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_InvalidValueSyntax = 0x05000002; +extern const PSRETURN MASK__PSRETURN_GUI_JSOpenFailed = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_JSOpenFailed = 0x05000003; +extern const PSRETURN MASK__PSRETURN_GUI_NameAmbiguity = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_NameAmbiguity = 0x05000004; +extern const PSRETURN MASK__PSRETURN_GUI_NullObjectProvided = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_NullObjectProvided = 0x05000005; +extern const PSRETURN MASK__PSRETURN_GUI_ObjectNeedsName = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_ObjectNeedsName = 0x05000006; +extern const PSRETURN MASK__PSRETURN_GUI_OperationNeedsGUIObject = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_OperationNeedsGUIObject = 0x05000007; +extern const PSRETURN MASK__PSRETURN_GUI_ReferenceNameTake = 0xffffffff; +extern const PSRETURN CODE__PSRETURN_GUI_ReferenceNameTake = 0x05000008; +extern const PSRETURN MASK__PSRETURN_Game_World_MapLoadFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Game_World_MapLoadFailed = 0x06040001; -extern const PSRETURN MASK__PSRETURN_I18n_Script_SetupFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_I18n_Script_SetupFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_I18n_Script_SetupFailed = 0x07030001; -extern const PSRETURN MASK__PSRETURN_Renderer_VBOFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Renderer_VBOFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Renderer_VBOFailed = 0x08000001; -extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_AlreadyExists = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_AlreadyExists = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_AlreadyExists = 0x09010001; -extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_CreationFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_CreationFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_CreationFailed = 0x09010002; -extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_EvalErrors = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_EvalErrors = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_EvalErrors = 0x09020001; -extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_OpenFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_OpenFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_OpenFailed = 0x09020002; -extern const PSRETURN MASK__PSRETURN_Scripting_CallFunctionFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_CallFunctionFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_CallFunctionFailed = 0x09000001; -extern const PSRETURN MASK__PSRETURN_Scripting_ConversionFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_ConversionFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_ConversionFailed = 0x09000002; -extern const PSRETURN MASK__PSRETURN_Scripting_CreateObjectFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_CreateObjectFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_CreateObjectFailed = 0x09000003; -extern const PSRETURN MASK__PSRETURN_Scripting_DefineConstantFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_DefineConstantFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_DefineConstantFailed = 0x09000004; -extern const PSRETURN MASK__PSRETURN_Scripting_RegisterFunctionFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_RegisterFunctionFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_RegisterFunctionFailed = 0x09000005; -extern const PSRETURN MASK__PSRETURN_Scripting_SetupFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_SetupFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_SetupFailed = 0x09000006; -extern const PSRETURN MASK__PSRETURN_Scripting_TypeDoesNotExist = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Scripting_TypeDoesNotExist = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Scripting_TypeDoesNotExist = 0x09000007; -extern const PSRETURN MASK__PSRETURN_System_RequiredExtensionsMissing = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_System_RequiredExtensionsMissing = 0xffffffff; extern const PSRETURN CODE__PSRETURN_System_RequiredExtensionsMissing = 0x0a000001; -extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002; -extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003; -extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; -extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xFFFFFFFF; +extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xffffffff; extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002; PSRETURN PSERROR_CVFSFile_AlreadyLoaded::getCode() const { return 0x01000001; } @@ -212,7 +223,14 @@ PSRETURN PSERROR_File_OpenFailed::getCode() const { return 0x04000003; } PSRETURN PSERROR_File_ReadFailed::getCode() const { return 0x04000004; } PSRETURN PSERROR_File_UnexpectedEOF::getCode() const { return 0x04000005; } PSRETURN PSERROR_File_WriteFailed::getCode() const { return 0x04000006; } -PSRETURN PSERROR_GUI_JSOpenFailed::getCode() const { return 0x05000001; } +PSRETURN PSERROR_GUI_InvalidSetting::getCode() const { return 0x05000001; } +PSRETURN PSERROR_GUI_InvalidValueSyntax::getCode() const { return 0x05000002; } +PSRETURN PSERROR_GUI_JSOpenFailed::getCode() const { return 0x05000003; } +PSRETURN PSERROR_GUI_NameAmbiguity::getCode() const { return 0x05000004; } +PSRETURN PSERROR_GUI_NullObjectProvided::getCode() const { return 0x05000005; } +PSRETURN PSERROR_GUI_ObjectNeedsName::getCode() const { return 0x05000006; } +PSRETURN PSERROR_GUI_OperationNeedsGUIObject::getCode() const { return 0x05000007; } +PSRETURN PSERROR_GUI_ReferenceNameTake::getCode() const { return 0x05000008; } PSRETURN PSERROR_Game_World_MapLoadFailed::getCode() const { return 0x06040001; } PSRETURN PSERROR_I18n_Script_SetupFailed::getCode() const { return 0x07030001; } PSRETURN PSERROR_Renderer_VBOFailed::getCode() const { return 0x08000001; } @@ -259,7 +277,14 @@ const char* GetErrorString(PSRETURN code) case 0x04000004: return "File_ReadFailed"; case 0x04000005: return "File_UnexpectedEOF"; case 0x04000006: return "File_WriteFailed"; - case 0x05000001: return "GUI_JSOpenFailed"; + case 0x05000001: return "GUI_InvalidSetting"; + case 0x05000002: return "GUI_InvalidValueSyntax"; + case 0x05000003: return "GUI_JSOpenFailed"; + case 0x05000004: return "GUI_NameAmbiguity"; + case 0x05000005: return "GUI_NullObjectProvided"; + case 0x05000006: return "GUI_ObjectNeedsName"; + case 0x05000007: return "GUI_OperationNeedsGUIObject"; + case 0x05000008: return "GUI_ReferenceNameTake"; case 0x06040001: return "Game_World_MapLoadFailed"; case 0x07030001: return "I18n_Script_SetupFailed"; case 0x08000001: return "Renderer_VBOFailed"; @@ -300,7 +325,14 @@ void ThrowError(PSRETURN code) case 0x04000004: throw PSERROR_File_ReadFailed(); break; case 0x04000005: throw PSERROR_File_UnexpectedEOF(); break; case 0x04000006: throw PSERROR_File_WriteFailed(); break; - case 0x05000001: throw PSERROR_GUI_JSOpenFailed(); break; + case 0x05000001: throw PSERROR_GUI_InvalidSetting(); break; + case 0x05000002: throw PSERROR_GUI_InvalidValueSyntax(); break; + case 0x05000003: throw PSERROR_GUI_JSOpenFailed(); break; + case 0x05000004: throw PSERROR_GUI_NameAmbiguity(); break; + case 0x05000005: throw PSERROR_GUI_NullObjectProvided(); break; + case 0x05000006: throw PSERROR_GUI_ObjectNeedsName(); break; + case 0x05000007: throw PSERROR_GUI_OperationNeedsGUIObject(); break; + case 0x05000008: throw PSERROR_GUI_ReferenceNameTake(); break; case 0x06040001: throw PSERROR_Game_World_MapLoadFailed(); break; case 0x07030001: throw PSERROR_I18n_Script_SetupFailed(); break; case 0x08000001: throw PSERROR_Renderer_VBOFailed(); break;