mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-20 23:34:58 +01:00
Add several copies from a vehicle's menu in the consist too
The copies go right after the vehicle, a whole unit for one of a set. The count flyout is shared with the browser.
This commit is contained in:
@@ -81,7 +81,10 @@ public partial class Depot : UserControl
|
||||
_consist, () => _browser.Selected, InsertTextureAt, _browser.SelectInBrowser);
|
||||
|
||||
_cards = new VehicleCards(consistStack, _db, _consist, _cargo, _minis, _hand,
|
||||
RebuildConsist, () => _details.Refresh(), _browser.SelectInBrowser, _drag.ArmCardDrag);
|
||||
RebuildConsist, () => _details.Refresh(), _browser.SelectInBrowser, _drag.ArmCardDrag)
|
||||
{
|
||||
AddCopies = AddCopiesAfter
|
||||
};
|
||||
|
||||
// Hidden still scrolls - it only drops the bar itself.
|
||||
MiniTextures.Sharp(miniPreview);
|
||||
@@ -594,6 +597,16 @@ public partial class Depot : UserControl
|
||||
InsertTexturesAt(texture, at, count);
|
||||
}
|
||||
|
||||
/// <summary>Copies of the vehicle on a card - a whole unit for one of a set - right after it.</summary>
|
||||
private void AddCopiesAfter(ConsistItem item, int count)
|
||||
{
|
||||
int index = _consist.IndexOf(item);
|
||||
if (index < 0 || item.Cars.Count == 0 || _db.TextureForSkin(item.Cars[0].SkinFile) is not { } texture)
|
||||
return;
|
||||
|
||||
InsertTexturesAt(texture, index + 1, count);
|
||||
}
|
||||
|
||||
private void InsertTextureAt(VehicleTexture texture, int at) => InsertTexturesAt(texture, at, 1);
|
||||
|
||||
/// <summary>The vehicle count times in a row from at - each staffed as added - and one redraw.</summary>
|
||||
|
||||
Reference in New Issue
Block a user