Moderator: OpenTTD Developers
But today I thought "Don't be so lazy! It's open source for a reason. Start modifying!" and here it is: A very simple patch to add a "New game" option to the save/load menu. It pops up the new game dialog inside the current game. I hope having saved one (or maybe two?) mouse clicks makes you as warm inside as it makes me .
Comments and feedback are appreciated; it felt too easy so maybe there is a reason why this behavior isn't in trunk?
v2: Updated patch to allow all inputs in the new game dialog to be edited.
- (2.89 KiB) Downloaded 112 times
I did use the system monitor to check for that. It showed no difference in ram usage when using my function ten times. I'm not really a c/c++ developer so I don't know how to profile more than that. gdb and gprof is not my home turfNickman wrote:By that I mean that all used memory is cleared when creating a new map using your new menu item?
Only think I can imagine that might go "wrong" is that you accidentally select the option from the menu and your current game is lost. I suppose that if you close the "New map" window, that your current game will remain usable? If so, then it's probably guarded enough, although an additional red warning "If you proceed, all unsaved progress of the current game will be lost. Continue? Yes/No" wouldn't hurt. Yes, it's an extra click but at least users are informed what they're about to do.
Found a bug though. It seems that the "Number of towns" and "Number of industries" input refuses to register the changes made to them (whatever you chose in the dropdown it stays the same). All other inputs work as intended. New version will probably be out tomorrow to fix this.
adf88 wrote:You don't need any patches. Just tweak the settings once, before you start a game, they will be saved. All you have to do to restart a game is quit to the main menu and click "New game"->"Generate" - that's all, less then 2 seconds.
For that you can also open the console and type newgame and press enter. So if you are quick on the keyboard, this is faster and more convinient.
Since no one have reported any problem with this patch I'll switch to my next patch idea, also one for those as lazy as me. It will be a "Play current scenario" sub-menu choice that will launch the current scenario from the scenario editor as a game. It's a bit trickier than the new game in-game patch so don't hold your breath...
- After creating a new game, let the "new game" window opened for 20 seconds. So you can recreate many new games on the fly without reopening the window.
- Display the new game with the same zoom level as before creating the new game.
- If the minimap was open before creating a new game, re-open it.
With those evolutions, I think your patch would be very usefull and really user-friendly.
Users browsing this forum: No registered users and 5 guests