public void Update(int shipID, int[] slot)
            {
                ShipName.Tag = shipID;

                if (shipID == -1)
                {
                    //なし
                    ShipName.Text      = "-";
                    ShipName.ForeColor = Color.FromArgb(0x00, 0x00, 0x00);
                    Equipments.Visible = false;
                    ToolTipInfo.SetToolTip(ShipName, null);
                    ToolTipInfo.SetToolTip(Equipments, null);
                }
                else
                {
                    ShipDataMaster ship = KCDatabase.Instance.MasterShips[shipID];


                    ShipName.Text      = ship.Name;
                    ShipName.ForeColor = GetShipNameColor(ship);
                    ToolTipInfo.SetToolTip(ShipName, GetShipString(shipID, slot));

                    Equipments.SetSlotList(shipID, slot);
                    Equipments.Visible = true;
                    ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(shipID, slot));
                }
            }
			public void Update(int shipID, int[] slot)
			{

				ShipName.Tag = shipID;

				if (shipID == -1)
				{
					//なし
					ShipName.Text = "-";
					ShipName.ForeColor = Utility.Configuration.Config.UI.ForeColor;
					Equipments.Visible = false;
					ToolTipInfo.SetToolTip(ShipName, null);
					ToolTipInfo.SetToolTip(Equipments, null);

				}
				else
				{

					ShipDataMaster ship = KCDatabase.Instance.MasterShips[shipID];


					ShipName.Text = ship.Name;
					ShipName.ForeColor = ship.GetShipNameColor();
					ToolTipInfo.SetToolTip(ShipName, GetShipString(shipID, slot));

					Equipments.SetSlotList(shipID, slot);
					Equipments.Visible = true;
					ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(shipID, slot));
				}

			}
示例#3
0
            public void Update(int shipID, int[] slot)
            {
                ShipName.Tag = shipID;

                if (shipID == -1)
                {
                    //なし
                    ShipName.Text      = "-";
                    ShipName.ForeColor = Color.FromArgb(0x00, 0x00, 0x00);
                    Equipments.Visible = false;
                    ToolTipInfo.SetToolTip(ShipName, null);
                    ToolTipInfo.SetToolTip(Equipments, null);
                }
                else
                {
                    ShipDataMaster ship = KCDatabase.Instance.MasterShips[shipID];


                    ShipName.Text = ship.Name;
                    switch (ship.AbyssalShipClass)
                    {
                    case 0:
                    case 1:                                     //normal
                    default:
                        ShipName.ForeColor = Utility.ThemeManager.GetColor(Utility.Configuration.Config.UI.Theme, Utility.ThemeColors.MainFontColor); break;

                    case 2:                                     //elite
                        ShipName.ForeColor = Color.FromArgb(0xFF, 0x00, 0x00); break;

                    case 3:                                     //flagship
                        ShipName.ForeColor = Color.FromArgb(0xFF, 0x88, 0x00); break;

                    case 4:                                     //latemodel / flagship kai
                        ShipName.ForeColor = Color.FromArgb(0x00, 0x88, 0xFF); break;

                    case 5:                                     //latemodel elite
                        ShipName.ForeColor = Color.FromArgb(0x88, 0x00, 0x00); break;

                    case 6:                                     //latemodel flagship
                        ShipName.ForeColor = Color.FromArgb(0x88, 0x44, 0x00); break;
                    }
                    ShipName.ForeColor = GetShipNameColor(ship);
                    ToolTipInfo.SetToolTip(ShipName, GetShipString(shipID, slot));

                    Equipments.SetSlotList(shipID, slot);
                    Equipments.Visible = true;
                    ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(shipID, slot));
                }
            }
示例#4
0
            public void Update(int shipID, int[] slot)
            {
                ShipName.Tag = shipID;

                if (shipID == -1)
                {
                    //なし
                    ShipName.Text      = "-";
                    ShipName.ForeColor = Color.FromArgb(0x00, 0x00, 0x00);
                    Equipments.Visible = false;
                    ToolTipInfo.SetToolTip(ShipName, null);
                    ToolTipInfo.SetToolTip(Equipments, null);
                }
                else
                {
                    ShipDataMaster ship = KCDatabase.Instance.MasterShips[shipID];


                    ShipName.Text = ship.Name;
                    switch (ship.AbyssalShipClass)
                    {
                    case 0:
                    case 1:                                     //normal
                        ShipName.ForeColor = Color.FromArgb(0x00, 0x00, 0x00); break;

                    case 2:                                     //elite
                        ShipName.ForeColor = Color.FromArgb(0xFF, 0x00, 0x00); break;

                    case 3:                                     //flagship
                        ShipName.ForeColor = Color.FromArgb(0xFF, 0x88, 0x00); break;

                    case 4:                                     //latemodel
                        ShipName.ForeColor = Color.FromArgb(0x00, 0x88, 0xFF); break;
                    }
                    ToolTipInfo.SetToolTip(ShipName, GetShipString(shipID, slot));

                    Equipments.SetSlotList(shipID, slot);
                    Equipments.Visible = true;
                    ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(shipID, slot));
                }
            }
示例#5
0
            public void Update(int baseAirCorpsID)
            {
                KCDatabase db    = KCDatabase.Instance;
                var        corps = db.BaseAirCorps[baseAirCorpsID];

                if (corps == null)
                {
                    baseAirCorpsID = -1;
                }
                else
                {
                    Name.Text = string.Format("#{0} - {1}", corps.MapAreaID, corps.Name);
                    Name.Tag  = corps.MapAreaID;
                    var sb = new StringBuilder();


                    string areaName = KCDatabase.Instance.MapArea.ContainsKey(corps.MapAreaID) ? KCDatabase.Instance.MapArea[corps.MapAreaID].Name : "バミューダ海域";

                    sb.AppendLine("所属海域: " + areaName);

                    // state

                    if (corps.Squadrons.Values.Any(sq => sq != null && sq.Condition > 1))
                    {
                        // 疲労
                        int tired = corps.Squadrons.Values.Max(sq => sq?.Condition ?? 0);

                        if (tired == 2)
                        {
                            Name.ImageAlign = ContentAlignment.MiddleRight;
                            Name.ImageIndex = (int)ResourceManager.IconContent.ConditionTired;
                            sb.AppendLine("疲労");
                        }
                        else
                        {
                            Name.ImageAlign = ContentAlignment.MiddleRight;
                            Name.ImageIndex = (int)ResourceManager.IconContent.ConditionVeryTired;
                            sb.AppendLine("過労");
                        }
                    }
                    else if (corps.Squadrons.Values.Any(sq => sq != null && sq.AircraftCurrent < sq.AircraftMax))
                    {
                        // 未補給
                        Name.ImageAlign = ContentAlignment.MiddleRight;
                        Name.ImageIndex = (int)ResourceManager.IconContent.FleetNotReplenished;
                        sb.AppendLine("未補給");
                    }
                    else
                    {
                        Name.ImageAlign = ContentAlignment.MiddleCenter;
                        Name.ImageIndex = -1;
                    }
                    ToolTipInfo.SetToolTip(Name, sb.ToString());


                    ActionKind.Text = "[" + Constants.GetBaseAirCorpsActionKind(corps.ActionKind) + "]";

                    {
                        int airSuperiority = Calculator.GetAirSuperiority(corps);
                        if (Utility.Configuration.Config.FormFleet.ShowAirSuperiorityRange)
                        {
                            int airSuperiority_max = Calculator.GetAirSuperiority(corps, true);
                            if (airSuperiority < airSuperiority_max)
                            {
                                AirSuperiority.Text = string.Format("{0} ~ {1}", airSuperiority, airSuperiority_max);
                            }
                            else
                            {
                                AirSuperiority.Text = airSuperiority.ToString();
                            }
                        }
                        else
                        {
                            AirSuperiority.Text = airSuperiority.ToString();
                        }

                        ToolTipInfo.SetToolTip(AirSuperiority,
                                               string.Format("確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                                                             (int)(airSuperiority / 3.0),
                                                             (int)(airSuperiority / 1.5),
                                                             Math.Max((int)(airSuperiority * 1.5 - 1), 0),
                                                             Math.Max((int)(airSuperiority * 3.0 - 1), 0)));
                    }

                    Distance.Text = corps.Distance.ToString();

                    Squadrons.SetSlotList(corps);
                    ToolTipInfo.SetToolTip(Squadrons, GetEquipmentString(corps));
                }


                Name.Visible                      =
                    ActionKind.Visible            =
                        AirSuperiority.Visible    =
                            Distance.Visible      =
                                Squadrons.Visible =
                                    baseAirCorpsID != -1;
            }
            public void Update(int shipMasterID)
            {
                KCDatabase db   = KCDatabase.Instance;
                ShipData   ship = db.Ships[shipMasterID];

                if (ship != null)
                {
                    bool isEscaped = KCDatabase.Instance.Fleet[Parent.FleetID].EscapedShipList.Contains(shipMasterID);


                    Name.Text = ship.MasterShip.NameWithClass;
                    Name.Tag  = ship.ShipID;
                    ToolTipInfo.SetToolTip(Name,
                                           string.Format(
                                               "{0} {1}\n火力: {2}/{3}\n雷装: {4}/{5}\n対空: {6}/{7}\n装甲: {8}/{9}\n対潜: {10}/{11}\n回避: {12}/{13}\n索敵: {14}/{15}\n運: {16}\n射程: {17} / 速力: {18}\n(右クリックで図鑑)\n",
                                               ship.MasterShip.ShipTypeName, ship.NameWithLevel,
                                               ship.FirepowerBase, ship.FirepowerTotal,
                                               ship.TorpedoBase, ship.TorpedoTotal,
                                               ship.AABase, ship.AATotal,
                                               ship.ArmorBase, ship.ArmorTotal,
                                               ship.ASWBase, ship.ASWTotal,
                                               ship.EvasionBase, ship.EvasionTotal,
                                               ship.LOSBase, ship.LOSTotal,
                                               ship.LuckTotal,
                                               Constants.GetRange(ship.Range),
                                               Constants.GetSpeed(ship.MasterShip.Speed)
                                               ));


                    Level.Value     = ship.Level;
                    Level.ValueNext = ship.ExpNext;

                    {
                        StringBuilder tip = new StringBuilder();
                        tip.AppendFormat("Total: {0} exp.\r\n", ship.ExpTotal);

                        if (!Utility.Configuration.Config.FormFleet.ShowNextExp)
                        {
                            tip.AppendFormat("次のレベルまで: {0} exp.\r\n", ship.ExpNext);
                        }

                        if (ship.MasterShip.RemodelAfterShipID != 0 && ship.Level < ship.MasterShip.RemodelAfterLevel)
                        {
                            tip.AppendFormat("改装まで: Lv. {0} / {1} exp.\r\n", ship.MasterShip.RemodelAfterLevel - ship.Level, ship.ExpNextRemodel);
                        }
                        else if (ship.Level <= 99)
                        {
                            tip.AppendFormat("Lv99まで: {0} exp.\r\n", Math.Max(ExpTable.GetExpToLevelShip(ship.ExpTotal, 99), 0));
                        }
                        else
                        {
                            tip.AppendFormat("Lv{0}まで: {1} exp.\r\n", ExpTable.ShipMaximumLevel, Math.Max(ExpTable.GetExpToLevelShip(ship.ExpTotal, ExpTable.ShipMaximumLevel), 0));
                        }

                        ToolTipInfo.SetToolTip(Level, tip.ToString());
                    }


                    HP.Value        = ship.HPCurrent;
                    HP.MaximumValue = ship.HPMax;
                    {
                        int dockID = ship.RepairingDockID;

                        HP.RepairTime = null;
                        if (dockID != -1)
                        {
                            HP.RepairTime = db.Docks[dockID].CompletionTime;
                        }
                    }
                    if (isEscaped)
                    {
                        HP.BackColor = Color.Silver;
                    }
                    else
                    {
                        HP.BackColor = SystemColors.Control;
                    }
                    {
                        StringBuilder sb     = new StringBuilder();
                        double        hprate = (double)ship.HPCurrent / ship.HPMax;

                        sb.AppendFormat("HP: {0:0.0}% [{1}]\n", hprate * 100, Constants.GetDamageState(hprate));
                        if (isEscaped)
                        {
                            sb.AppendLine("退避中");
                        }
                        else if (hprate > 0.50)
                        {
                            sb.AppendFormat("中破まで: {0} / 大破まで: {1}\n", ship.HPCurrent - ship.HPMax / 2, ship.HPCurrent - ship.HPMax / 4);
                        }
                        else if (hprate > 0.25)
                        {
                            sb.AppendFormat("大破まで: {0}\n", ship.HPCurrent - ship.HPMax / 4);
                        }
                        else
                        {
                            sb.AppendLine("大破しています!");
                        }

                        if (ship.RepairTime > 0)
                        {
                            var span = DateTimeHelper.FromAPITimeSpan(ship.RepairTime);
                            sb.AppendFormat("入渠時間: {0} @ {1}",
                                            DateTimeHelper.ToTimeRemainString(span),
                                            DateTimeHelper.ToTimeRemainString(new TimeSpan(span.Add(new TimeSpan(0, 0, -30)).Ticks / (ship.HPMax - ship.HPCurrent))));
                        }

                        ToolTipInfo.SetToolTip(HP, sb.ToString());
                    }



                    Condition.Text = ship.Condition.ToString();
                    Condition.Tag  = ship.Condition;
                    SetConditionDesign(ship.Condition);

                    if (ship.Condition < 49)
                    {
                        TimeSpan ts = new TimeSpan(0, (int)Math.Ceiling((49 - ship.Condition) / 3.0) * 3, 0);
                        ToolTipInfo.SetToolTip(Condition, string.Format("完全回復まで 約 {0:D2}:{1:D2}", (int)ts.TotalMinutes, (int)ts.Seconds));
                    }
                    else
                    {
                        ToolTipInfo.SetToolTip(Condition, string.Format("あと {0} 回遠征可能", (int)Math.Ceiling((ship.Condition - 49) / 3.0)));
                    }

                    ShipResource.SetResources(ship.Fuel, ship.FuelMax, ship.Ammo, ship.AmmoMax);


                    Equipments.SetSlotList(ship);
                    ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(ship));
                }
                else
                {
                    Name.Tag = -1;
                }


                Name.Visible                           =
                    Level.Visible                      =
                        HP.Visible                     =
                            Condition.Visible          =
                                ShipResource.Visible   =
                                    Equipments.Visible = shipMasterID != -1;
            }
示例#7
0
            public void Update(int shipMasterID)
            {
                KCDatabase db   = KCDatabase.Instance;
                ShipData   ship = db.Ships[shipMasterID];

                if (ship != null)
                {
                    bool isEscaped = KCDatabase.Instance.Fleet[Parent.FleetID].EscapedShipList.Contains(shipMasterID);


                    Name.Text = ship.MasterShip.NameWithClass;
                    Name.Tag  = ship.ShipID;
                    ToolTipInfo.SetToolTip(Name,
                                           string.Format(
                                               GeneralRes.ShipTooltip,
                                               ship.MasterShip.ShipTypeName, ship.NameWithLevel,
                                               ship.FirepowerBase, ship.FirepowerTotal,
                                               ship.TorpedoBase, ship.TorpedoTotal,
                                               ship.AABase, ship.AATotal,
                                               ship.ArmorBase, ship.ArmorTotal,
                                               ship.ASWBase, ship.ASWTotal,
                                               ship.EvasionBase, ship.EvasionTotal,
                                               ship.LOSBase, ship.LOSTotal,
                                               ship.LuckTotal,
                                               Constants.GetRange(ship.Range),
                                               Constants.GetSpeed(ship.MasterShip.Speed)
                                               ));


                    Level.Value     = ship.Level;
                    Level.ValueNext = ship.ExpNext;

                    {
                        StringBuilder tip = new StringBuilder();
                        if (!Utility.Configuration.Config.FormFleet.ShowNextExp)
                        {
                            tip.AppendFormat(GeneralRes.ToNextLevel + "\r\n", ship.ExpNext);
                        }

                        if (ship.MasterShip.RemodelAfterShipID != 0 && ship.Level < ship.MasterShip.RemodelAfterLevel)
                        {
                            tip.AppendFormat(GeneralRes.ToRemodel, ship.MasterShip.RemodelAfterLevel - ship.Level, ship.ExpNextRemodel);
                        }
                        else if (ship.Level <= 99)
                        {
                            tip.AppendFormat(GeneralRes.To99, Math.Max(ExpTable.GetExpToLevelShip(ship.ExpTotal, 99), 0));
                        }
                        else
                        {
                            tip.AppendFormat(GeneralRes.To150, Math.Max(ExpTable.GetExpToLevelShip(ship.ExpTotal, 150), 0));
                        }

                        ToolTipInfo.SetToolTip(Level, tip.ToString());
                    }


                    HP.Value        = ship.HPCurrent;
                    HP.MaximumValue = ship.HPMax;
                    {
                        int dockID = ship.RepairingDockID;

                        HP.RepairTime = null;
                        if (dockID != -1)
                        {
                            HP.RepairTime = db.Docks[dockID].CompletionTime;
                        }
                    }
                    if (isEscaped)
                    {
                        HP.BackColor = Color.Silver;
                    }
                    else
                    {
                        HP.BackColor = SystemColors.Control;
                    }
                    {
                        StringBuilder sb     = new StringBuilder();
                        double        hprate = (double)ship.HPCurrent / ship.HPMax;

                        sb.AppendFormat("HP: {0:0.0}% [{1}]\n", hprate * 100, Constants.GetDamageState(hprate));
                        if (isEscaped)
                        {
                            sb.AppendLine(GeneralRes.Retreating);
                        }
                        else if (hprate > 0.50)
                        {
                            sb.AppendFormat(GeneralRes.ToMidAndHeavy + "\r\n", ship.HPCurrent - ship.HPMax / 2, ship.HPCurrent - ship.HPMax / 4);
                        }
                        else if (hprate > 0.25)
                        {
                            sb.AppendFormat(GeneralRes.ToHeavy + "\r\n", ship.HPCurrent - ship.HPMax / 4);
                        }
                        else
                        {
                            sb.AppendLine(GeneralRes.IsTaiha);
                        }

                        if (ship.RepairTime > 0)
                        {
                            var span = DateTimeHelper.FromAPITimeSpan(ship.RepairTime);
                            sb.AppendFormat(GeneralRes.DockTime + ": {0}\n",
                                            DateTimeHelper.ToTimeRemainString(span));

                            /*/
                             * sb.AppendFormat( "( @ 1HP: {0} )\n",
                             *      DateTimeHelper.ToTimeRemainString( new TimeSpan( span.Ticks / ( ship.HPMax - ship.HPCurrent ) ) ) );
                             * //*/
                        }

                        ToolTipInfo.SetToolTip(HP, sb.ToString());
                    }



                    Condition.Text = ship.Condition.ToString();
                    if (ship.Condition < 20)
                    {
                        Condition.ImageIndex = (int)ResourceManager.IconContent.ConditionVeryTired;
                    }
                    else if (ship.Condition < 30)
                    {
                        Condition.ImageIndex = (int)ResourceManager.IconContent.ConditionTired;
                    }
                    else if (ship.Condition < 40)
                    {
                        Condition.ImageIndex = (int)ResourceManager.IconContent.ConditionLittleTired;
                    }
                    else if (ship.Condition < 50)
                    {
                        Condition.ImageIndex = (int)ResourceManager.IconContent.ConditionNormal;
                    }
                    else
                    {
                        Condition.ImageIndex = (int)ResourceManager.IconContent.ConditionSparkle;
                    }
                    if (ship.Condition < 49)
                    {
                        TimeSpan ts = new TimeSpan(0, (int)Math.Ceiling((49 - ship.Condition) / 3.0) * 3, 0);
                        ToolTipInfo.SetToolTip(Condition, string.Format(GeneralRes.FatigueRestoreTime, (int)ts.TotalMinutes, (int)ts.Seconds));
                    }
                    else
                    {
                        ToolTipInfo.SetToolTip(Condition, string.Format(GeneralRes.RemainingExpeds, (int)Math.Ceiling((ship.Condition - 49) / 3.0)));
                    }

                    ShipResource.SetResources(ship.Fuel, ship.MasterShip.Fuel, ship.Ammo, ship.MasterShip.Ammo);


                    Equipments.SetSlotList(ship);
                    ToolTipInfo.SetToolTip(Equipments, GetEquipmentString(ship));
                }
                else
                {
                    Name.Tag = -1;
                }


                Name.Visible                           =
                    Level.Visible                      =
                        HP.Visible                     =
                            Condition.Visible          =
                                ShipResource.Visible   =
                                    Equipments.Visible = shipMasterID != -1;
            }
示例#8
0
            public void Update(int baseAirCorpsID)
            {
                KCDatabase db    = KCDatabase.Instance;
                var        corps = db.BaseAirCorps[baseAirCorpsID];

                if (corps == null)
                {
                    baseAirCorpsID = -1;
                }
                else
                {
                    Name.Text = corps.Name;

                    // state
                    if (corps.Squadrons.Values.Any(sq => sq != null && sq.AircraftCurrent < sq.AircraftMax))
                    {
                        // 未補給
                        Name.ImageAlign = ContentAlignment.MiddleRight;
                        Name.ImageIndex = (int)ResourceManager.IconContent.FleetNotReplenished;
                        ToolTipInfo.SetToolTip(Name, "未補給");
                    }
                    else if (corps.Squadrons.Values.Any(sq => sq != null && sq.Condition > 1))
                    {
                        // 疲労
                        int tired = corps.Squadrons.Values.Max(sq => sq != null ? sq.Condition : 0);

                        if (tired == 2)
                        {
                            Name.ImageAlign = ContentAlignment.MiddleRight;
                            Name.ImageIndex = (int)ResourceManager.IconContent.ConditionTired;
                            ToolTipInfo.SetToolTip(Name, "疲労");
                        }
                        else
                        {
                            Name.ImageAlign = ContentAlignment.MiddleRight;
                            Name.ImageIndex = (int)ResourceManager.IconContent.ConditionVeryTired;
                            ToolTipInfo.SetToolTip(Name, "過労");
                        }
                    }
                    else
                    {
                        Name.ImageAlign = ContentAlignment.MiddleCenter;
                        Name.ImageIndex = -1;
                        ToolTipInfo.SetToolTip(Name, null);
                    }


                    ActionKind.Text = "[" + Constants.GetBaseAirCorpsActionKind(corps.ActionKind) + "]";

                    {
                        int airSuperiority = Calculator.GetAirSuperiority(corps);
                        AirSuperiority.Text = airSuperiority.ToString();
                        ToolTipInfo.SetToolTip(AirSuperiority,
                                               string.Format("確保: {0}\r\n優勢: {1}\r\n均衡: {2}\r\n劣勢: {3}\r\n",
                                                             (int)(airSuperiority / 3.0),
                                                             (int)(airSuperiority / 1.5),
                                                             Math.Max((int)(airSuperiority * 1.5 - 1), 0),
                                                             Math.Max((int)(airSuperiority * 3.0 - 1), 0)));
                    }

                    Distance.Text = corps.Distance.ToString();

                    Squadrons.SetSlotList(corps);
                    ToolTipInfo.SetToolTip(Squadrons, GetEquipmentString(corps));
                }


                Name.Visible                      =
                    ActionKind.Visible            =
                        AirSuperiority.Visible    =
                            Distance.Visible      =
                                Squadrons.Visible =
                                    baseAirCorpsID != -1;
            }