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

Method NetHackQtSettings

win/Qt/qt_set.cpp:67–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65#define TILEHMIN 6
66
67NetHackQtSettings::NetHackQtSettings() :
68 settings(),
69 whichsize("&Zoomed", this),
70 tilewidth(this),
71 tileheight(this),
72 widthlbl("Tile &width:", this),
73 heightlbl("Tile &height:", this),
74#ifdef ENHANCED_PAPERDOLL
75 dollshown("&Shown", this),
76 dollwidth(this),
77 dollheight(this),
78 dollwidthlbl("&Doll width:", this), // should "Doll tile width"...
79 dollheightlbl("Doll height:", this), // ...but that's too verbose
80#endif
81 fontsize(this),
82 normal("times"),
83#ifdef WS_WIN
84 normalfixed("courier new"),
85#else
86 normalfixed("courier"),
87#endif
88 large("times"),
89 small("times"),
90 theglyphs(0)
91{
92 int default_fontsize;
93
94 widthlbl.setBuddy(&tilewidth);
95 tilewidth.setRange(TILEWMIN, 128);
96 heightlbl.setBuddy(&tileheight);
97 tileheight.setRange(TILEHMIN, 128);
98 tilewidth.setValue(settings.value("tilewidth", 16).toInt());
99 tileheight.setValue(settings.value("tileheight", 16).toInt());
100#ifdef ENHANCED_PAPERDOLL
101 dollwidthlbl.setBuddy(&dollwidth);
102 dollwidth.setRange(TILEWMIN, 48);
103 dollheightlbl.setBuddy(&dollheight);
104 dollheight.setRange(TILEHMIN, 48);
105 dollwidth.setValue(settings.value("dollwidth", 32).toInt());
106 dollheight.setValue(settings.value("dollheight", 32).toInt());
107 doll_is_shown = settings.value("dollShown", true).toBool();
108 // needed the very first time
109 settings.setValue("dollShown", QVariant(doll_is_shown));
110#endif
111 default_fontsize = settings.value("fontsize", 2).toInt();
112
113 // these aren't currently part of the settings dialog; they're managed
114 // by the extended commands menu ('#' command) and updateXcmd() below
115 // but are included in qt_settings to be remembered across play sessions
116 xcmd_by_row = settings.value("xcmdByRow", false).toBool();
117 xcmd_set = settings.value("xcmdSet", all_cmds).toInt();
118
119 // Tile/font sizes read from .nethackrc
120 if (qt_tilewidth != NULL) {
121 tilewidth.setValue(atoi(qt_tilewidth));
122 free(qt_tilewidth);
123 qt_tilewidth = NULL;
124 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected