]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Menu.cpp
added type description of MenuProperties
[l2e.git] / src / graphics / Menu.cpp
diff --git a/src/graphics/Menu.cpp b/src/graphics/Menu.cpp
new file mode 100644 (file)
index 0000000..b70697e
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Menu.cpp
+ *
+ *  Created on: Sep 9, 2012
+ *      Author: holy
+ */
+
+#include "Menu.h"
+
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
+namespace graphics {
+
+void MenuProperties::CreateTypeDescription() {
+       MenuProperties p;
+       TypeDescription &td(TypeDescription::CreateOrGet("MenuProperties"));
+
+       td.SetSize(sizeof(MenuProperties));
+
+       int fontId(TypeDescription::GetTypeId("Font"));
+       int numberId(TypeDescription::GetTypeId("Number"));
+       int spriteId(TypeDescription::GetTypeId("Sprite"));
+       int stringId(TypeDescription::GetTypeId("String"));
+
+       td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), fontId, true));
+       td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), fontId, true));
+       td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), spriteId, true));
+       td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), numberId, false));
+       td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), numberId, false));
+       td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), numberId, false));
+       td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), numberId, false));
+       td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), numberId, false));
+       td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), numberId, false));
+       td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), stringId, false));
+       td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), numberId, false));
+       td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), numberId, false));
+       td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), numberId, false));
+}
+
+}