leezer3 / OpenBVE

OpenBVE- A free train simulator
http://www.openbve-project.net
280 stars 52 forks source link

Data folder & keyboard controls assignment #7

Closed JakubVanek closed 8 years ago

JakubVanek commented 8 years ago

Hi! I want to ask where I can obtain new Data folder. When I'm trying to start openBVE with old Data folder, the only thing that happens is a bunch of MessageBoxes informing me that controls.cfg format has changed. This is the part of code causing the flood:

LoadControls(string FileOrNull, out Control[] Controls){
...
//We've discovered a SDL keybinding is present, so reset the loading process with the default keyconfig & show an appropriate error message
Thread Message = new Thread(() => MessageBox.Show("An older key-configuration file was found." + Environment.NewLine + "The current key-configuration has been reset to default.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand));
Message.Start();
LoadControls(OpenBveApi.Path.CombineFile(Program.FileSystem.GetDataFolder("Controls"), "Default keyboard assignment.controls"), out CurrentControls);
return;
...
}

I have the old default keyboard controls assignment file, which causes infinite recursion. There should be some test if it's not loading default, if so, use some inbuilt default. And could you please provide a link to download actual Data folder? Thanks, JakubVanek

leezer3 commented 8 years ago

That's mostly my issue, hadn't thought of that particular little piece of fun..... I'd hadn't quite expected someone to build from source with the old data folder! Will sort out a graceful failure mode tomorrow, although I'm not fond of adding hardcoded fallbacks.

I've added the most recent Data folder to the source (Oversight- It wasn't in Michelle's source either), along with an appropriate build event to copy it into the compile directory.

JakubVanek commented 8 years ago

Thanks! :+1: