X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FMenu.cpp;h=113e4151b826f8fa0e1a289ead12388ce6a4f2ee;hb=5ca18f73987fb3935ab34654cbbecf5eca4704cb;hp=ebb76ff412a818352656dfbbfacdb39b1202c599;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/graphics/Menu.cpp b/src/graphics/Menu.cpp index ebb76ff..113e415 100644 --- a/src/graphics/Menu.cpp +++ b/src/graphics/Menu.cpp @@ -23,21 +23,26 @@ void MenuProperties::CreateTypeDescription() { int stringId(TypeDescription::GetTypeId("String")); TypeDescription &td(TypeDescription::CreateOrGet("MenuProperties")); + td.SetConstructor(&Construct); td.SetSize(sizeof(MenuProperties)); - 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)); + td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), fontId).SetReferenced().SetDescription("the font to use for normal/enabled entries")); + td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), fontId).SetReferenced().SetDescription("the font for disabled entries")); + td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), spriteId).SetReferenced().SetDescription("the cursor sprite indicating the current selection")); + td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), numberId).SetDescription("width of an entry in characters")); + td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), numberId).SetDescription("number of visible rows")); + td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), numberId).SetDescription("space between rows in pixles")); + td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), numberId).SetDescription("space reserved for icons in pixels")); + td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), numberId).SetDescription("number of columns")); + td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), numberId).SetDescription("space between cols in pixels")); + td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), stringId).SetDescription("delimiter between text and number; only first character is used")); + td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), numberId).SetDescription("maximum width of a number in chars")); + td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), numberId).SetDescription("maximum number of additional text characters")); + td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), numberId).SetDescription("space between normal and additional text in pixels")); +} + +void MenuProperties::Construct(void *data) { + new (data) MenuProperties; } }