Files specific to UDB are now used in the program configuration folder. The files are now called UDBuilder.cfg, UDBuilder.log, and UDBCrash.txt. If there's no UDBuilder.cfg it first tries to copy GZBuilder.cfg before creating a new configuration file. Resolves #442

This commit is contained in:
biwa 2020-07-25 18:42:07 +02:00
parent 73139db972
commit 8aa7462993
4 changed files with 246 additions and 231 deletions

View file

@ -1,218 +1,218 @@
// NOTE: These are the default program settings!
// GZDoom Builder will use this file to create the program settings for a new user.
// Your real settings are in the Local Application data directory
// Windows XP: C:\Documents and Settings\Username\Local Settings\Application Data\Doom Builder\GZBuilder.cfg
// Windows Vista or later: C:\Users\Username\AppData\Local\Doom Builder\GZBuilder.cfg
shortcuts
{
builder_closemap = 0;
builder_configuration = 117;
builder_newmap = 131150;
builder_openmap = 131151;
builder_scrolleast = 39;
builder_scrollnorth = 38;
builder_scrollsouth = 40;
builder_scrollwest = 37;
builder_zoomin = 65530;
builder_zoomout = 65531;
builder_preferences = 116;
builder_savemap = 131155;
builder_savemapas = 196691;
builder_savemapinto = 458835;
builder_mapoptions = 113;
builder_reloadresources = 119;
builder_cancelmode = 27;
builder_gridsetup = 0;
builder_undo = 131162;
builder_redo = 131161;
builder_togglesnap = 0;
builder_clearselection = 67;
builder_toggleautomerge = 0;
builder_centerinscreen = 36;
builder_moveleft = 83;
builder_moveright = 70;
builder_moveforward = 69;
builder_movebackward = 68;
buildermodes_thingsmode = 84;
buildermodes_linedefsmode = 76;
buildermodes_verticesmode = 86;
buildermodes_sectorsmode = 83;
builder_insertvertex = 65622;
builder_testmap = 120;
builder_acceptmode = 13;
builder_classicedit = 2;
builder_classicselect = 1;
builder_deleteitem = 46;
builder_dissolveitem = 8;
buildermodes_finishdraw = 2;
buildermodes_drawpoint = 1;
buildermodes_drawlinesmode = 131140;
buildermodes_flipsidedefs = 65606;
buildermodes_fliplinedefs = 70;
buildermodes_joinsectors = 74;
buildermodes_removepoint = 8;
buildermodes_mergesectors = 65610;
buildermodes_splitlinedefs = 0;
buildermodes_visualmode = 87;
buildermodes_curvelinesmode = 65603;
builder_thingsfilterssetup = 0;
builder_insertitem = 45;
builder_griddec = 219;
builder_gridinc = 221;
buildermodes_findmode = 114;
buildermodes_makesectormode = 77;
buildermodes_editselectionmode = 69;
builder_copyselection = 131139;
builder_pasteselection = 131158;
builder_cutselection = 131160;
buildermodes_gradientbrightness = 71;
builder_categories = 0;
builder_selectgroup6 = 54;
builder_selectgroup1 = 49;
builder_selectgroup10 = 48;
builder_selectgroup7 = 55;
builder_selectgroup2 = 50;
builder_selectgroup5 = 53;
builder_selectgroup8 = 56;
builder_selectgroup9 = 57;
builder_selectgroup3 = 51;
builder_selectgroup4 = 52;
builder_assigngroup1 = 131121;
builder_assigngroup6 = 131126;
builder_assigngroup9 = 131129;
builder_assigngroup2 = 131122;
builder_assigngroup4 = 131124;
builder_assigngroup10 = 131120;
builder_assigngroup8 = 131128;
builder_assigngroup7 = 131127;
builder_assigngroup3 = 131123;
builder_assigngroup5 = 131125;
buildermodes_makedoor = 65604;
builder_pan_view = 32;
builder_openscripteditor = 121;
builder_viewmodebrightness = 0;
builder_testaction = 0;
builder_viewmodefloors = 0;
builder_viewmodenormal = 0;
builder_viewmodeceilings = 0;
buildermodes_errorcheckmode = 115;
builder_movedoublespeed = 16;
builder_visualselect = 1;
builder_visualedit = 2;
builder_movethingleft = 37;
builder_movethingright = 39;
builder_movethingfwd = 38;
builder_movethingback = 40;
buildermodes_raisesector8 = 65530;
buildermodes_lowersector8 = 65531;
buildermodes_raisesector1 = 131066;
buildermodes_lowersector1 = 131067;
buildermodes_showvisualthings = 84;
buildermodes_movetextureright = 39;
buildermodes_movetextureleft = 37;
buildermodes_movetextureup = 38;
buildermodes_lowerbrightness8 = 196603;
buildermodes_raisebrightness8 = 196602;
buildermodes_movetexturedown = 40;
buildermodes_textureselect = 131074;
buildermodes_texturepaste = 4;
buildermodes_texturecopy = 131139;
buildermodes_visualautoalignx = 65;
buildermodes_visualautoaligny = 65601;
buildermodes_togglemiddletexture = 77;
buildermodes_togglelowerunpegged = 76;
buildermodes_toggleupperunpegged = 85;
buildermodes_togglegravity = 71;
builder_insertpreviousprefab = 80;
builder_createprefab = 0;
builder_insertprefabfile = 131152;
buildermodes_placevisualstart = 131159;
buildermodes_togglebrightness = 66;
builder_toggleinfopanel = 192;
buildermodes_resettexture = 65618;
builder_showerrors = 122;
buildermodes_pasteproperties = 393302;
buildermodes_pastepropertieswithoptions = 196694;
buildermodes_floodfilltextures = 65540;
buildermodes_copyproperties = 196675;
buildermodes_texturepasteoffsets = 65622;
buildermodes_movetextureleft8 = 65573;
buildermodes_movetextureright8 = 65575;
buildermodes_lowerfloor8 = 458747;
buildermodes_selectdoublesided = 65586;
buildermodes_raisefloor8 = 458746;
buildermodes_movetextureup8 = 65574;
buildermodes_texturecopyoffsets = 65603;
buildermodes_gradientfloors = 131143;
buildermodes_selectsinglesided = 65585;
buildermodes_gradientceilings = 65607;
buildermodes_flipselectionh = 0;
buildermodes_raiseceiling8 = 131066;
buildermodes_lowerceiling8 = 131067;
buildermodes_flipselectionv = 0;
buildermodes_movetexturedown8 = 65576;
buildermodes_classiccopyproperties = 196675;
buildermodes_togglehighlight = 72;
buildermodes_classicpasteproperties = 393302;
buildermodes_classicpastepropertieswithoptions = 196694;
buildermodes_drawrectanglemode = 196676;
buildermodes_drawellipsemode = 327748;
buildermodes_decreasebevel = 196603;
buildermodes_increasesubdivlevel = 131066;
buildermodes_increasebevel = 196602;
buildermodes_decreasesubdivlevel = 131067;
buildermodes_classicpaintselect = 4;
builder_movethingfwd = 38;
builder_movethingback = 40;
builder_movethingright = 39;
builder_movethingleft = 37;
}
mainwindow
{
positionx = 150;
sizeheight = 572;
positiony = 21;
windowstate = 2;
sizewidth = 739;
}
recentfiles
{
}
configurations
{
}
blackbrowsers = false;
visualfov = 90;
visualmousesensx = 4f;
visualmousesensy = 4f;
visualviewrange = 1000f;
imagebrightness = 2;
qualitydisplay = true;
squarethings = true;
testmonsters = true;
doublesidedalpha = 0.5f;
backgroundalpha = 1f;
defaultviewmode = 2;
classicbilinear = false;
visualbilinear = false;
mousespeed = 500;
movespeed = 600;
viewdistance = 3000f;
invertyaxis = false;
scriptfontname = "Lucida Console";
scriptfontsize = 10;
scriptfontbold = false;
scriptontop = true;
previewimagesize = 1;
autoscrollspeed = 0;
showerrorswindow = true;
// NOTE: These are the default program settings!
// GZDoom Builder will use this file to create the program settings for a new user.
// Your real settings are in the Local Application data directory
// Windows XP: C:\Documents and Settings\Username\Local Settings\Application Data\Doom Builder\GZBuilder.cfg
// Windows Vista or later: C:\Users\Username\AppData\Local\Doom Builder\GZBuilder.cfg
shortcuts
{
builder_closemap = 0;
builder_configuration = 117;
builder_newmap = 131150;
builder_openmap = 131151;
builder_scrolleast = 39;
builder_scrollnorth = 38;
builder_scrollsouth = 40;
builder_scrollwest = 37;
builder_zoomin = 65530;
builder_zoomout = 65531;
builder_preferences = 116;
builder_savemap = 131155;
builder_savemapas = 196691;
builder_savemapinto = 458835;
builder_mapoptions = 113;
builder_reloadresources = 119;
builder_cancelmode = 27;
builder_gridsetup = 0;
builder_undo = 131162;
builder_redo = 131161;
builder_togglesnap = 0;
builder_clearselection = 67;
builder_toggleautomerge = 0;
builder_centerinscreen = 36;
builder_moveleft = 83;
builder_moveright = 70;
builder_moveforward = 69;
builder_movebackward = 68;
buildermodes_thingsmode = 84;
buildermodes_linedefsmode = 76;
buildermodes_verticesmode = 86;
buildermodes_sectorsmode = 83;
builder_insertvertex = 65622;
builder_testmap = 120;
builder_acceptmode = 13;
builder_classicedit = 2;
builder_classicselect = 1;
builder_deleteitem = 46;
builder_dissolveitem = 8;
buildermodes_finishdraw = 2;
buildermodes_drawpoint = 1;
buildermodes_drawlinesmode = 131140;
buildermodes_flipsidedefs = 65606;
buildermodes_fliplinedefs = 70;
buildermodes_joinsectors = 74;
buildermodes_removepoint = 8;
buildermodes_mergesectors = 65610;
buildermodes_splitlinedefs = 0;
buildermodes_visualmode = 87;
buildermodes_curvelinesmode = 65603;
builder_thingsfilterssetup = 0;
builder_insertitem = 45;
builder_griddec = 219;
builder_gridinc = 221;
buildermodes_findmode = 114;
buildermodes_makesectormode = 77;
buildermodes_editselectionmode = 69;
builder_copyselection = 131139;
builder_pasteselection = 131158;
builder_cutselection = 131160;
buildermodes_gradientbrightness = 71;
builder_categories = 0;
builder_selectgroup6 = 54;
builder_selectgroup1 = 49;
builder_selectgroup10 = 48;
builder_selectgroup7 = 55;
builder_selectgroup2 = 50;
builder_selectgroup5 = 53;
builder_selectgroup8 = 56;
builder_selectgroup9 = 57;
builder_selectgroup3 = 51;
builder_selectgroup4 = 52;
builder_assigngroup1 = 131121;
builder_assigngroup6 = 131126;
builder_assigngroup9 = 131129;
builder_assigngroup2 = 131122;
builder_assigngroup4 = 131124;
builder_assigngroup10 = 131120;
builder_assigngroup8 = 131128;
builder_assigngroup7 = 131127;
builder_assigngroup3 = 131123;
builder_assigngroup5 = 131125;
buildermodes_makedoor = 65604;
builder_pan_view = 32;
builder_openscripteditor = 121;
builder_viewmodebrightness = 0;
builder_testaction = 0;
builder_viewmodefloors = 0;
builder_viewmodenormal = 0;
builder_viewmodeceilings = 0;
buildermodes_errorcheckmode = 115;
builder_movedoublespeed = 16;
builder_visualselect = 1;
builder_visualedit = 2;
builder_movethingleft = 37;
builder_movethingright = 39;
builder_movethingfwd = 38;
builder_movethingback = 40;
buildermodes_raisesector8 = 65530;
buildermodes_lowersector8 = 65531;
buildermodes_raisesector1 = 131066;
buildermodes_lowersector1 = 131067;
buildermodes_showvisualthings = 84;
buildermodes_movetextureright = 39;
buildermodes_movetextureleft = 37;
buildermodes_movetextureup = 38;
buildermodes_lowerbrightness8 = 196603;
buildermodes_raisebrightness8 = 196602;
buildermodes_movetexturedown = 40;
buildermodes_textureselect = 131074;
buildermodes_texturepaste = 4;
buildermodes_texturecopy = 131139;
buildermodes_visualautoalignx = 65;
buildermodes_visualautoaligny = 65601;
buildermodes_togglemiddletexture = 77;
buildermodes_togglelowerunpegged = 76;
buildermodes_toggleupperunpegged = 85;
buildermodes_togglegravity = 71;
builder_insertpreviousprefab = 80;
builder_createprefab = 0;
builder_insertprefabfile = 131152;
buildermodes_placevisualstart = 131159;
buildermodes_togglebrightness = 66;
builder_toggleinfopanel = 192;
buildermodes_resettexture = 65618;
builder_showerrors = 122;
buildermodes_pasteproperties = 393302;
buildermodes_pastepropertieswithoptions = 196694;
buildermodes_floodfilltextures = 65540;
buildermodes_copyproperties = 196675;
buildermodes_texturepasteoffsets = 65622;
buildermodes_movetextureleft8 = 65573;
buildermodes_movetextureright8 = 65575;
buildermodes_lowerfloor8 = 458747;
buildermodes_selectdoublesided = 65586;
buildermodes_raisefloor8 = 458746;
buildermodes_movetextureup8 = 65574;
buildermodes_texturecopyoffsets = 65603;
buildermodes_gradientfloors = 131143;
buildermodes_selectsinglesided = 65585;
buildermodes_gradientceilings = 65607;
buildermodes_flipselectionh = 0;
buildermodes_raiseceiling8 = 131066;
buildermodes_lowerceiling8 = 131067;
buildermodes_flipselectionv = 0;
buildermodes_movetexturedown8 = 65576;
buildermodes_classiccopyproperties = 196675;
buildermodes_togglehighlight = 72;
buildermodes_classicpasteproperties = 393302;
buildermodes_classicpastepropertieswithoptions = 196694;
buildermodes_drawrectanglemode = 196676;
buildermodes_drawellipsemode = 327748;
buildermodes_decreasebevel = 196603;
buildermodes_increasesubdivlevel = 131066;
buildermodes_increasebevel = 196602;
buildermodes_decreasesubdivlevel = 131067;
buildermodes_classicpaintselect = 4;
builder_movethingfwd = 38;
builder_movethingback = 40;
builder_movethingright = 39;
builder_movethingleft = 37;
}
mainwindow
{
positionx = 150;
sizeheight = 572;
positiony = 21;
windowstate = 2;
sizewidth = 739;
}
recentfiles
{
}
configurations
{
}
blackbrowsers = false;
visualfov = 90;
visualmousesensx = 4f;
visualmousesensy = 4f;
visualviewrange = 1000f;
imagebrightness = 2;
qualitydisplay = true;
squarethings = true;
testmonsters = true;
doublesidedalpha = 0.5f;
backgroundalpha = 1f;
defaultviewmode = 2;
classicbilinear = false;
visualbilinear = false;
mousespeed = 500;
movespeed = 600;
viewdistance = 3000f;
invertyaxis = false;
scriptfontname = "Lucida Console";
scriptfontsize = 10;
scriptfontbold = false;
scriptontop = true;
previewimagesize = 1;
autoscrollspeed = 0;
showerrorswindow = true;

View file

@ -292,10 +292,10 @@ namespace CodeImp.DoomBuilder.Config
#region ================== Loading / Saving
// This loads the program configuration
internal bool Load(string cfgfilepathname, string defaultfilepathname)
internal bool Load(string cfgfilepathname, string defaultfilepathname, string legacyfilepathname)
{
// First parse it
if(Read(cfgfilepathname, defaultfilepathname))
if(Read(cfgfilepathname, defaultfilepathname, legacyfilepathname))
{
// Read the cache variables
blackbrowsers = cfg.ReadSetting("blackbrowsers", true);
@ -520,15 +520,25 @@ namespace CodeImp.DoomBuilder.Config
}
// This reads the configuration
private bool Read(string cfgfilepathname, string defaultfilepathname)
private bool Read(string cfgfilepathname, string defaultfilepathname, string legacyfilepathname)
{
// Check if no config for this user exists yet
if(!File.Exists(cfgfilepathname))
{
// Copy new configuration
General.WriteLogLine("Local user program configuration is missing!");
File.Copy(defaultfilepathname, cfgfilepathname);
General.WriteLogLine("New program configuration copied for local user");
// Does an legacy configuration exist?
if (File.Exists(legacyfilepathname))
{
General.WriteLogLine("Local user program configuration is missing!");
File.Copy(legacyfilepathname, cfgfilepathname);
General.WriteLogLine("Copied legacy configuration \"" + legacyfilepathname + "\" for local user");
}
else
{
// Copy new configuration
General.WriteLogLine("Local user program configuration is missing!");
File.Copy(defaultfilepathname, cfgfilepathname);
General.WriteLogLine("New program configuration copied for local user");
}
}
// Load it

View file

@ -128,10 +128,11 @@ namespace CodeImp.DoomBuilder
//internal const int SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS;
// Files and Folders
private const string SETTINGS_FILE = "GZBuilder.cfg";
private const string DEFAULT_SETTINGS_FILE = "GZBuilder.default.cfg"; //mxd
private const string LEGACY_SETTINGS_FILE = "GZBuilder.cfg"; // To make transision from GZDB* easier
private const string SETTINGS_FILE = "UDBuilder.cfg";
private const string DEFAULT_SETTINGS_FILE = "UDBuilder.default.cfg"; //mxd
private const string SETTINGS_DIR = "Doom Builder";
private const string LOG_FILE = "GZBuilder.log";
private const string LOG_FILE = "UDBuilder.log";
private const string GAME_CONFIGS_DIR = "Configurations";
private const string COMPILERS_DIR = "Compilers";
private const string PLUGINS_DIR = "Plugins";
@ -612,7 +613,9 @@ namespace CodeImp.DoomBuilder
settings = new ProgramConfiguration();
string defaultsettingsfile = Path.Combine(apppath, DEFAULT_SETTINGS_FILE);
string usersettingsfile = nosettings ? defaultsettingsfile : Path.Combine(settingspath, SETTINGS_FILE);
if(settings.Load(usersettingsfile, defaultsettingsfile))
string legacysettingsfile = nosettings ? String.Empty : Path.Combine(settingspath, LEGACY_SETTINGS_FILE);
if(settings.Load(usersettingsfile, defaultsettingsfile, legacysettingsfile))
{
// Create error logger
errorlogger = new ErrorLogger();

View file

@ -12,6 +12,8 @@ namespace CodeImp.DoomBuilder.Windows
{
public partial class ExceptionDialog : Form
{
private const string CRASH_DUMP_FILE = "UDBCrash.txt";
private readonly bool isterminating;
private readonly string logpath;
@ -19,7 +21,7 @@ namespace CodeImp.DoomBuilder.Windows
{
InitializeComponent();
logpath = Path.Combine(General.SettingsPath, @"GZCrash.txt");
logpath = Path.Combine(General.SettingsPath, CRASH_DUMP_FILE);
Exception ex = (Exception)e.ExceptionObject;
errorDescription.Text = "Error in " + ex.Source + ":";
string sysinfo = GetSystemInfo();
@ -36,7 +38,7 @@ namespace CodeImp.DoomBuilder.Windows
{
InitializeComponent();
logpath = Path.Combine(General.SettingsPath, @"GZCrash.txt");
logpath = Path.Combine(General.SettingsPath, CRASH_DUMP_FILE);
errorDescription.Text = "Error in " + e.Exception.Source + ":";
string sysinfo = GetSystemInfo();
using(StreamWriter sw = File.CreateText(logpath))