private ColorScheme GetColor(ItemType item) { if (craft.Stores[item] > 0) return ColorScheme.White; var isAmmo = item.Metadata().AmmoForWeapon != null; return isAmmo ? ColorScheme.Purple : ColorScheme.Blue; }
private void CreateCostRow(int topRow, ItemType itemType, int quantity) { var metadata = itemType.Metadata(); AddControl(new ExtendedLabel(topRow, 10, 125, metadata.Name, Font.Normal, ColorScheme.Blue)); AddControl(new ExtendedLabel(topRow, 135, 70, $"${metadata.MonthlyCost.FormatNumber()}", Font.Normal, ColorScheme.Blue)); AddControl(new ExtendedLabel(topRow, 205, 45, quantity.FormatNumber(), Font.Normal, ColorScheme.Blue)); AddControl(new Label(topRow, 250, $"${(metadata.MonthlyCost * quantity).FormatNumber()}", Font.Normal, ColorScheme.Blue)); }
public NotEnoughStoresToRearmCraft(Data.Base @base, Craft craft, ItemType ammo) { AddControl(new Border(20, 32, 256, 160, ColorScheme.Green, Backgrounds.Craft, 10)); AddControl(new Label(66, Label.Center, "Not enough", Font.Large, ColorScheme.Green)); AddControl(new Label(82, Label.Center, ammo.Metadata().Name, Font.Large, ColorScheme.Green)); AddControl(new Label(98, Label.Center, $"to rearm {craft.Name}", Font.Large, ColorScheme.Green)); AddControl(new Label(114, Label.Center, $"at {@base.Name}", Font.Large, ColorScheme.Green)); AddControl(new Button(150, 48, 100, 16, "OK", ColorScheme.Green, Font.Normal, EndModal)); AddControl(new Button(150, 172, 100, 16, "OK - 5 secs", ColorScheme.Green, Font.Normal, OnOkFiveSeconds)); }
private void OnIncreaseItem(ItemType item) { if (GameState.SelectedBase.Stores[item] == 0) return; var hwpSpace = item.Metadata().HwpSpace; if (hwpSpace > craft.HwpSpaceAvailable || hwpSpace * 4 > craft.SpaceAvailable) return; if (craft.TotalItemCount == 80) { AbortEquipItem(); new NoMoreEquipmentAllowed().DoModal(this); return; } GameState.SelectedBase.Stores.Remove(item); craft.Stores.Add(item); }
private void OnDecreaseItem(ItemType item) { if (craft.Stores[item] == 0) return; if (item.Metadata().StorageSpace > GameState.SelectedBase.ItemSpaceAvailable) { AbortEquipItem(); new NotEnoughStoreSpace(ColorScheme.LightMagenta, Backgrounds.Battle, 8).DoModal(this); return; } craft.Stores.Remove(item); GameState.SelectedBase.Stores.Add(item); }
private static string GetName(ItemType item) { var metadata = item.Metadata(); var isAmmo = metadata.AmmoForWeapon != null; return isAmmo ? $" \t{metadata.Name}" : metadata.Name; }
private static int GetMonthlyCost(ItemType itemType, int count) => itemType.Metadata().MonthlyCost * count;