MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / FontOptionsMenu

Method FontOptionsMenu

src/bzflag/FontOptionsMenu.cpp:72–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70//============================================================================//
71
72FontOptionsMenu::FontOptionsMenu()
73 : consoleFont(NULL)
74 , serifFont(NULL)
75 , sansSerifFont(NULL) {
76 fontOptionsMenu = this;
77
78 // cache font face ID
79 const LocalFontFace* fontFace = MainMenu::getFontFace();
80
81 consoleFont = LocalFontFace::create(BZDB.get("consoleFont"));
82 serifFont = LocalFontFace::create(BZDB.get("serifFont"));
83 sansSerifFont = LocalFontFace::create(BZDB.get("sansSerifFont"));
84
85 // add controls
86 HUDuiLabel* label = new HUDuiLabel;
87 label->setFontFace(fontFace);
88 label->setString("Font Settings");
89 addControl(label, false);
90
91 HUDuiList* option;
92
93 // Console Font
94 option = new HUDuiList;
95 option->setFontFace(fontFace);
96 option->setLabel("Console Font:");
97 option->setCallback(callback, (void*)"c");
98 addFaces(option);
99 setOptionFont(BZDB.get("consoleFont"), consoleFont, option);
100 addControl(option);
101
102 // Serif Font
103 option = new HUDuiList;
104 option->setFontFace(fontFace);
105 option->setLabel("Serif Font:");
106 option->setCallback(callback, (void*)"s");
107 addFaces(option);
108 setOptionFont(BZDB.get("serifFont"), serifFont, option);
109 addControl(option);
110
111 // Sans Serif Font
112 option = new HUDuiList;
113 option->setFontFace(fontFace);
114 option->setLabel("Sans Serif Font:");
115 option->setCallback(callback, (void*)"S");
116 addFaces(option);
117 setOptionFont(BZDB.get("sansSerifFont"), sansSerifFont, option);
118 addControl(option);
119
120 initNavigation();
121}
122
123
124FontOptionsMenu::~FontOptionsMenu() {

Callers

nothing calls this directly

Calls 8

addFacesFunction · 0.85
setOptionFontFunction · 0.85
setLabelMethod · 0.80
setCallbackMethod · 0.80
createFunction · 0.50
getMethod · 0.45
setFontFaceMethod · 0.45
setStringMethod · 0.45

Tested by

no test coverage detected