Page 1 of 1

[0.16.51] MapPreset width/height is not applied before click

Posted: Fri Jul 20, 2018 10:03 am
by eradicator
What?
When a custom map-gen-preset has settings for width/height, and the game is restarted, then clicking new game does not apply the settings until the map-gen-preset's name is clicked.

Code: Select all

  data.raw['map-gen-presets'].default['er:tiny-debug-map'] = {
    order = '00',
    basic_settings = {
      height = 100,
      width = 100,
      }
    }
Reproduction
Add above preset. Click "New game", click "Default", click "close", click "New game".
My preset will now be shown as selected, but height/width is not applied.
Click my preset.
Now heigh/width will be applied.

I suspect the preset is only shown as selected, but the actual selected preset is still "default". (And i can't make my preset default=true because then the engine complains that default may not have settings.)
mapgenpreset.png
mapgenpreset.png (325.34 KiB) Viewed 1935 times

Re: [0.16.51] MapPreset width/height is not applied before click

Posted: Fri Jul 20, 2018 11:34 am
by Rseding91
Thanks for the report. It's meant to always have default selected so the bug here is the visual part of the list view not showing default as selected.

Default as you said can't have anything defined: it's default values.

Re: [0.16.51] MapPreset width/height is not applied before click

Posted: Fri Jul 20, 2018 11:57 am
by eradicator
Rseding91 wrote:It's meant to always have default selected so the bug here is the visual part of the list view not showing default as selected.
As expected.
It works btw after using it to start a map once and then going back to main menu. I mainly want to use the preset to quickly get back into game when debugging control.lua. And limiting the map size significantly reduces the time it takes to generate a map.

Re: [0.16.51] MapPreset width/height is not applied before click

Posted: Fri Jun 07, 2019 1:36 pm
by eradicator
As of 0.17.46 it's still showing my preset as selected even though it isn't.

Code: Select all

  data.raw['map-gen-presets'].default['er:tiny-debug-map'] = {
    order = '00',
    basic_settings = {
      height = 100,
      width = 100,
      }
    }
Which with the new interface now requires four clicks (select different preset -> select my preset) to get to my preset.