| 70 | //============================================================================// |
| 71 | |
| 72 | FontOptionsMenu::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 | |
| 124 | FontOptionsMenu::~FontOptionsMenu() { |
nothing calls this directly
no test coverage detected