Skip to content

Commit

Permalink
Ensure MNTexts referencing strings from defs are set during menu init
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 20, 2012
1 parent a407989 commit 5aec052
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions doomsday/plugins/common/src/hu_menu.c
Expand Up @@ -2236,10 +2236,15 @@ static void initPageObjects(mn_page_t* page)

switch(MNObject_Type(ob))
{
case MN_TEXT:
case MN_MOBJPREVIEW:
case MN_TEXT: {
mndata_text_t* txt = (mndata_text_t*)ob->_typedata;
MNObject_SetFlags(ob, FO_SET, MNF_NO_FOCUS);
break;

if(txt->text && (PTR2INT(txt->text) > 0 && PTR2INT(txt->text) < NUMTEXT))
{
txt->text = GET_TXT(PTR2INT(txt->text));
}
break; }

case MN_BUTTON: {
const mn_actioninfo_t* action = MNObject_Action(ob, MNA_MODIFIED);
Expand Down Expand Up @@ -2288,6 +2293,10 @@ static void initPageObjects(mn_page_t* page)
cbox->height = MNDATA_COLORBOX_HEIGHT;
break; }

case MN_MOBJPREVIEW:
MNObject_SetFlags(ob, FO_SET, MNF_NO_FOCUS);
break;

default: break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/m_ctrl.c
Expand Up @@ -316,7 +316,7 @@ void Hu_MenuInitControlsPage(void)
mndata_text_t* txt = &ControlsMenuTexts[textIdx++];

ob->_type = MN_TEXT;
txt->text = (char*) binds->text;
txt->text = binds->text;
ob->_typedata = txt;
ob->_pageFontIdx = MENU_FONT1;
ob->_pageColorIdx = MENU_COLOR2;
Expand Down

0 comments on commit 5aec052

Please sign in to comment.