MCPcopy Create free account
hub / github.com/NetHack/NetHack / Gem_preference_update

Function Gem_preference_update

outdated/win/gem/wingem.c:1131–1203  ·  view source on GitHub ↗
(pref)

Source from the content-addressed store, hash-verified

1129 }
1130}
1131void
1132Gem_preference_update(pref)
1133const char *pref;
1134{
1135 if (stricmp(pref, "font_message") == 0
1136 || stricmp(pref, "font_size_message") == 0) {
1137 if (iflags.wc_fontsiz_message < NHFONT_SIZE_MIN
1138 || iflags.wc_fontsiz_message > NHFONT_SIZE_MAX)
1139 iflags.wc_fontsiz_message = NHFONT_DEFAULT_SIZE;
1140 mar_set_font(NHW_MESSAGE, iflags.wc_font_message,
1141 iflags.wc_fontsiz_message);
1142 return;
1143 }
1144 if (stricmp(pref, "font_map") == 0
1145 || stricmp(pref, "font_size_map") == 0) {
1146 if (iflags.wc_fontsiz_map < NHFONT_SIZE_MIN
1147 || iflags.wc_fontsiz_map > NHFONT_SIZE_MAX)
1148 iflags.wc_fontsiz_map = NHFONT_DEFAULT_SIZE;
1149 mar_set_font(NHW_MAP, iflags.wc_font_map, iflags.wc_fontsiz_map);
1150 return;
1151 }
1152 if (stricmp(pref, "font_status") == 0
1153 || stricmp(pref, "font_size_status") == 0) {
1154 if (iflags.wc_fontsiz_status < NHFONT_SIZE_MIN
1155 || iflags.wc_fontsiz_status > NHFONT_SIZE_MAX)
1156 iflags.wc_fontsiz_status = NHFONT_DEFAULT_SIZE;
1157 mar_set_font(NHW_STATUS, iflags.wc_font_status,
1158 iflags.wc_fontsiz_status);
1159 return;
1160 }
1161 if (stricmp(pref, "font_menu") == 0
1162 || stricmp(pref, "font_size_menu") == 0) {
1163 if (iflags.wc_fontsiz_menu < NHFONT_SIZE_MIN
1164 || iflags.wc_fontsiz_menu > NHFONT_SIZE_MAX)
1165 iflags.wc_fontsiz_menu = NHFONT_DEFAULT_SIZE;
1166 mar_set_font(NHW_MENU, iflags.wc_font_menu, iflags.wc_fontsiz_menu);
1167 return;
1168 }
1169 if (stricmp(pref, "font_text") == 0
1170 || stricmp(pref, "font_size_text") == 0) {
1171 if (iflags.wc_fontsiz_text < NHFONT_SIZE_MIN
1172 || iflags.wc_fontsiz_text > NHFONT_SIZE_MAX)
1173 iflags.wc_fontsiz_text = NHFONT_DEFAULT_SIZE;
1174 mar_set_font(NHW_TEXT, iflags.wc_font_text, iflags.wc_fontsiz_text);
1175 return;
1176 }
1177 if (stricmp(pref, "scroll_margin") == 0) {
1178 mar_set_margin(iflags.wc_scroll_margin);
1179 Gem_cliparound(u.ux, u.uy);
1180 return;
1181 }
1182 if (stricmp(pref, "ascii_map") == 0) {
1183 mar_set_tile_mode(!iflags.wc_ascii_map);
1184 doredraw();
1185 return;
1186 }
1187 if (stricmp(pref, "hilite_pet") == 0) {
1188 /* MAR -- works without doing something here. */

Callers

nothing calls this directly

Calls 8

mar_set_fontFunction · 0.85
mar_set_marginFunction · 0.85
Gem_cliparoundFunction · 0.85
mar_set_tile_modeFunction · 0.85
doredrawFunction · 0.85
mar_set_msg_alignFunction · 0.85
mar_set_status_alignFunction · 0.85
mar_set_msg_visibleFunction · 0.85

Tested by

no test coverage detected