]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Menu.cpp
6527e3e2c7325a8ed8baa087a270b87af1bcee4a
[l2e.git] / src / graphics / Menu.cpp
1 #include "Menu.h"
2
3 #include "../loader/Interpreter.h"
4 #include "../loader/TypeDescription.h"
5
6 using loader::FieldDescription;
7 using loader::Interpreter;
8 using loader::TypeDescription;
9
10 namespace graphics {
11
12 void MenuProperties::CreateTypeDescription() {
13         MenuProperties p;
14
15         TypeDescription &td(TypeDescription::Create(TYPE_ID, "MenuProperties"));
16         td.SetConstructor(&Construct);
17         td.SetSize(sizeof(MenuProperties));
18
19         td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), Font::TYPE_ID).SetReferenced().SetDescription("the font to use for normal/enabled entries"));
20         td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), Font::TYPE_ID).SetReferenced().SetDescription("the font for disabled entries"));
21         td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), Sprite::TYPE_ID).SetReferenced().SetDescription("the cursor sprite indicating the current selection"));
22         td.AddField("selectedCursor", FieldDescription(((char *)&p.selectedCursor) - ((char *)&p), Sprite::TYPE_ID).SetReferenced().SetDescription("the cursor sprite used when fixating a selection"));
23         td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("width of an entry in characters"));
24         td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("number of visible rows"));
25         td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between rows in pixles"));
26         td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space reserved for icons in pixels"));
27         td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("number of columns"));
28         td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between cols in pixels"));
29         td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), Interpreter::STRING_ID).SetDescription("delimiter between text and number; only first character is used"));
30         td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("maximum width of a number in chars"));
31         td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("maximum number of additional text characters"));
32         td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between normal and additional text in pixels"));
33         td.AddField("wrapX", FieldDescription(((char *)&p.wrapX) - ((char *)&p), Interpreter::BOOLEAN_ID).SetDescription("horizontally wrap cursor movement"));
34         td.AddField("wrapY", FieldDescription(((char *)&p.wrapY) - ((char *)&p), Interpreter::BOOLEAN_ID).SetDescription("vertically wrap cursor movement"));
35 }
36
37 void MenuProperties::Construct(void *data) {
38         new (data) MenuProperties;
39 }
40
41 }