Add optional built building count to recipe rows (v2)#16
Add optional built building count to recipe rows (v2)#16shpaass merged 6 commits intoYafc-CE:masterfrom
Conversation
This variable, which defaults to null, can be used to track the number of buildings that have actually been built. This number has no impact on the model.
Dropdown menu items for setting or clearing the builtBuildings value have been added for each recipe row. These items mirror the behavior and implementation of those for fixedBuildings, for the most part. The initial value is buildingCount rounded up, or 0 if buildingCount is negative. As 0 is a valid value, clearing builtBuildings returns it to null. Shopping lists now use the builtBuildings value instead of buildingCount if the former is not null.
The text field is only visible if builtBuildings is not null, and is placed under the building count. It is colored grey to indicate that it is not playing a role in the model.
If the number of buildings needed for the model's solution is greater than the specified number of built buildings, the recipe will now be flagged accordingly. This makes it substantially easier to determine which recipes need to be revisited if a change is made.
To make issues more apparent, the entire page now displays an error message (like with deadlocks) if a recipe needs more machines than it currenty has built.
|
A brief sanity test showed no obvious errors. |
|
A clear/empty value could be convenient to remove the count, I guess (only after losing the focus, otherwise it will be annoying to type). BTW allowing |
This PR extends PR ShadowTheAge#118 by @Saklad5 (I rebased their commits for YAFC-CE)
My own addition is to make the check recursive so it shows the error on the top recipe and all subgroups until the actual recipe that has not enough buildings.
You can see that
Tree seedlingrequires 1.04 build instead of the 1 I have. The parent group (Wood) also has the exclamation mark and error message.And the sheet itself shows a red error box with the message as well. (not visible in the screenshot).
This makes lack of buildings more clear, compared when they are hidden in multiple nested groups deep.