make options changable

This commit is contained in:
Wengier
2021-11-15 02:51:26 -05:00
parent 9f2028336e
commit 895a927485
3 changed files with 21 additions and 6 deletions

View File

@@ -2791,11 +2791,11 @@ void DOSBOX_SetupConfigSections(void) {
"You can also change the blinking rate by setting an integer between 1 (fastest) and 7 (slowest), or 0 for no cursor.");
Pstring->SetBasic(true);
Pbool = secprop->Add_bool("gbk",Property::Changeable::OnlyAtStart,false);
Pbool = secprop->Add_bool("gbk",Property::Changeable::WhenIdle,false);
Pbool->Set_help("Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese TTF output or DOS/V emulation.");
Pbool->SetBasic(true);
Pbool = secprop->Add_bool("chinasea",Property::Changeable::OnlyAtStart,false);
Pbool = secprop->Add_bool("chinasea",Property::Changeable::WhenIdle,false);
Pbool->Set_help("Enables the ChinaSea extension (in addition to the standard Big5 charset) for the Traditional Chinese TTF output (use a font containing such characters).");
Pbool->SetBasic(true);

View File

@@ -55,7 +55,7 @@ Bitu call_program;
extern const char *modifier;
extern std::string langname, configfile;
extern int enablelfn, paste_speed, wheel_key, freesizecap, wpType, wpVersion, wpBG, wpFG, lastset, blinkCursor;
extern bool dos_kernel_disabled, force_nocachedir, wpcolon, lockmount, enable_config_as_shell_commands, load, winrun, winautorun, startcmd, startwait, startquiet, starttranspath, mountwarning, wheel_guest, clipboard_dosapi, noremark_save_state, force_load_state, sync_time, manualtime, showbold, showital, showline, showsout, char512, printfont, rtl, dbcs_sbcs, autoboxdraw, halfwidthkana, ticksLocked;
extern bool dos_kernel_disabled, force_nocachedir, wpcolon, lockmount, enable_config_as_shell_commands, load, winrun, winautorun, startcmd, startwait, startquiet, starttranspath, mountwarning, wheel_guest, clipboard_dosapi, noremark_save_state, force_load_state, sync_time, manualtime, showbold, showital, showline, showsout, char512, printfont, rtl, gbk, chinasea, dbcs_sbcs, autoboxdraw, halfwidthkana, ticksLocked;
/* This registers a file on the virtual drive and creates the correct structure for it*/
@@ -94,8 +94,8 @@ public:
};
static std::vector<InternalProgramEntry*> internal_progs;
void EMS_Startup(Section* sec), EMS_DoShutDown(), UpdateDefaultPrinterFont(), RebootLanguage(std::string filename, bool confirm=false);
void DOSBOX_UnlockSpeed2( bool pressed ), GFX_ForceRedrawScreen(void), SetWindowTransparency(int trans), resetFontSize(void), ttf_reset_colors(void);
void EMS_DoShutDown(void), UpdateDefaultPrinterFont(void), GFX_ForceRedrawScreen(void), resetFontSize(void), ttf_reset_colors(void), makestdcp950table(void);
void EMS_Startup(Section* sec), DOSBOX_UnlockSpeed2(bool pressed), RebootLanguage(std::string filename, bool confirm=false), SetWindowTransparency(int trans);
void PROGRAMS_Shutdown(void) {
LOG(LOG_MISC,LOG_DEBUG)("Shutting down internal programs list");
@@ -1674,6 +1674,21 @@ next:
SetBlinkRate(section);
mainMenu.get_item("ttf_blinkc").check(blinkCursor>-1).refresh_item(mainMenu);
#endif
} else if (!strcasecmp(inputline.substr(0, 4).c_str(), "gbk=")) {
if (gbk != section->Get_bool("gbk")) {
gbk = !gbk;
#if defined(USE_TTF)
if (TTF_using()) resetFontSize();
#endif
}
} else if (!strcasecmp(inputline.substr(0, 9).c_str(), "chinasea=")) {
if (chinasea != section->Get_bool("chinasea")) {
chinasea = !chinasea;
if (!chinasea) makestdcp950table();
#if defined(USE_TTF)
if (TTF_using()) resetFontSize();
#endif
}
}
} else if (!strcasecmp(pvars[0].c_str(), "render")) {
if (!strcasecmp(inputline.substr(0, 9).c_str(), "glshader=")) {

View File

@@ -2804,7 +2804,7 @@ nextfile:
nchars = 0;
if (nlines == LINES) {
WriteOut("-- More -- %s (%u) --",word,linecount);
if (PAUSED()==3) return;
if (PAUSED()==3) {DOS_CloseFile(handle);return;}
WriteOut("\n");
nlines=0;
}