Esempio n. 1
0
        /// <summary>
        /// 艦娘の装備など詳細情報を表示する
        /// </summary>
        /// <param name="row">表示する艦娘の順位</param>
        void showDetail(MemberData.Ship.Info info)
        {
            if (Properties.Settings.Default.ShipDetailItem.Length == 0)
            {
                return;
            }

            FormShipDetail dlg = new FormShipDetail(_imgSlotItemIcon);

            dlg.StartPosition = FormStartPosition.Manual;
            dlg.Size          = Properties.Settings.Default.ShipDetailSize;

            if (DetailWndOrigin == DetailWindowAlignmentOrigin.Top)
            {
                //ウィンドウトップをあわせる
                dlg.Location = this.PointToScreen(new Point(fleetList1.Location.X
                                                            + fleetList1.Width + 2, fleetList1.Location.Y));
            }
            else
            {
                //ウィンドウボトムを合わせる
                dlg.Location = this.PointToScreen(new Point(fleetList1.Location.X
                                                            + fleetList1.Width + 2, fleetList1.Location.Y
                                                            + (fleetList1.Size.Height + cbDeck.Size.Height - dlg.Size.Height)));
            }
            dlg.Info = info;

            dlg.Show();
        }
Esempio n. 2
0
                public HPLVItem(MemberData.Ship.Info shipInfo)
                {
                    Text = "HP";
                    UseItemStyleForSubItems = false;

                    string valstr = shipInfo.HP.ToString();

                    if (shipInfo.RepairTime.TotalSeconds > 0)
                    {
                        valstr += string.Format(" (入渠所要:{0})", shipInfo.RepairTimeString);
                    }

                    SubItems.Add(valstr);
                    SubItems[1].BackColor = shipInfo.HP.BackgroundColor;
                }
Esempio n. 3
0
            public ShipListViewItem(MemberData.Ship.Info info, ImageList iconImageList)
            {
                UseItemStyleForSubItems = false;
                _iconIageList           = iconImageList;

                for (int n = 0; n < Enum.GetValues(typeof(ColumnIndex)).Length; n++)
                {
                    SubItems.Add("");
                }

                //GDIオブジェクトは再利用するようにしないと表示更新時にリソースが尽きて落ちる
                SubItems[(int)ColumnIndex.SlotItems] = new SlotItemsLVSubItem();

                Update(info);
            }
Esempio n. 4
0
            public SupplyStatus(MemberData.Ship.Info info)
            {
                if (!info.Fuel.Full)
                {
                    Debug.WriteLine("Fuel not filled");
                    Flags |= SupplyStatusFlags.Fuel;
                }

                if (!info.Bullet.Full)
                {
                    Debug.WriteLine("Bullet not filled");
                    Flags |= SupplyStatusFlags.Bullet;
                }

                ToolTip = string.Format("\n燃料:{0}({1}%)\n弾薬:{2}({3}%)",
                                        info.Fuel, info.Fuel.SimplePercent, info.Bullet, info.Bullet.SimplePercent);
            }
Esempio n. 5
0
        /// <summary>
        /// 情報を描画する
        /// </summary>
        public void RegisterFleetsInfo()
        {
            if (_selectedDeck == null)
            {
                return;
            }

            ///指定した艦隊を登録する
            for (int n = 0; n < 6; n++)
            {
                if (_selectedDeck.Member.Count > n)
                {
                    MemberData.Ship.Info shipInfo = _selectedDeck.Member[n];
                    //艦隊メンバーが存在するとき
                    SetFriendFleetValue(n, shipInfo);
                }
                else
                {
                    ///メンバーが存在しない
                    SetFriendFleetValue(n, null);
                }
            }
        }
Esempio n. 6
0
 public LVItemParamsFactory(MemberData.Ship.Info shipInfo, ImageList imgSlotItem)
 {
     _pwupParams = new SlotItemPowerupParams(shipInfo.SlotItem);
     _imgSlotItem = imgSlotItem;
     _info = shipInfo;
 }
Esempio n. 7
0
 public FormShipDetail(ImageList imgSlotItem)
 {
     Info = null;
     _imgSlotItem = imgSlotItem;
     InitializeComponent();
 }
Esempio n. 8
0
        /// <summary>
        /// 表示する艦隊を変更した時に呼ばれるハンドラ
        /// 何故かメンバー変更時にも呼ばれる
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbDeck_SelectedIndexChanged(object sender, EventArgs e)
        {
            FleetList.Deck item = cbDeck.SelectedItem as FleetList.Deck;
            if (item == null)
            {
                return;
            }

            fleetList1.SelectedDeck = item;

            //コンディション最大値は100
            int minCond        = 100;
            int sumLevel       = 0;
            int airSuperiority = 0;

            ///速度は 0:混成 5:低速 10:高速
            int speed = -1;

            ///航空機索敵値
            int aircraftSearch = 0;

            ///電探の索敵値
            int radarSearch = 0;

            ///艦娘の索敵値(装備込)
            int shipSearch = 0;

            ///艦隊の最低コンディション値とレベル合計と速度構成を調べる
            for (int n = 0; n < 6; n++)
            {
                if (item.Member.Count > n)
                {
                    MemberData.Ship.Info shipInfo = item.Member[n];

                    //艦隊メンバーが存在するとき
                    sumLevel       += shipInfo.Level;
                    airSuperiority += shipInfo.AirSuperiorityAbility;

                    if (minCond > shipInfo.Condition)
                    {
                        minCond = shipInfo.Condition;
                    }

                    //速度種別
                    if (speed == -1)
                    {
                        speed = shipInfo.Speed;
                    }
                    else
                    {
                        if (speed > 0 && speed != shipInfo.Speed)
                        {
                            speed = 0;
                        }
                    }

                    //索敵値
                    aircraftSearch += shipInfo.AircraftSearch;
                    radarSearch    += shipInfo.RadarSearch;
                    shipSearch     += shipInfo.Search.Now;

                    Debug.WriteLine(string.Format("索敵値({0}) 艦載機:{1} 電探:{2} 装備込艦娘:{3}",
                                                  shipInfo.ShipName, shipInfo.AircraftSearch, shipInfo.RadarSearch, shipInfo.Search.Now));
                }
            }

            if (UpdateDeckStatus != null)
            {
                UpdateDeckStatus(new DeckStatus(item.Num, item.Name, minCond, item.ShipDataLastUpdated,
                                                sumLevel, item.Member.Count, speed, airSuperiority, aircraftSearch, radarSearch,
                                                shipSearch));
            }
        }
Esempio n. 9
0
            /// <summary>
            /// IComparable<ShipListViewItem> の魂の実装
            /// </summary>
            /// <param name="it2"></param>
            /// <returns></returns>
            private int compare(MemberData.Ship.Info it2)
            {
                switch (_column)
                {
                case (int)ColumnIndex.ShipId:
                    return(Info.ShipId - it2.ShipId);

                case (int)ColumnIndex.ShipSortNo:
                    return(Info.ShipSortNo - it2.ShipSortNo);

                case (int)ColumnIndex.Fleet:
                    String ft1, ft2;
                    if (Info.Fleet == null)
                    {
                        ft1 = "";
                    }
                    else
                    {
                        ft1 = Info.Fleet.ToString();
                    }

                    if (it2.Fleet == null)
                    {
                        ft2 = "";
                    }
                    else
                    {
                        ft2 = it2.Fleet.ToString();
                    }

                    return(string.Compare(ft1, ft2));

                case (int)ColumnIndex.ShipName:
                    return(string.Compare(Info.ShipName, it2.ShipName));

                case (int)ColumnIndex.ShipNameYomi:
                    return(string.Compare(Info.ShipNameYomi, it2.ShipNameYomi));

                case (int)ColumnIndex.ShipType:
                    return(string.Compare(Info.ShipType, it2.ShipType));

                case (int)ColumnIndex.DockName:
                    return(Info.DockNum - it2.DockNum);

                case (int)ColumnIndex.RepairTime:
                    return(TimeSpan.Compare(Info.RepairTime, it2.RepairTime));

                case (int)ColumnIndex.RepairSteel:
                    return(Info.RepairSteel - it2.RepairSteel);

                case (int)ColumnIndex.RepairFuel:
                    return(Info.RepairFuel - it2.RepairFuel);

                case (int)ColumnIndex.SlotItems:
                    return(Info.SlotItem.Count - it2.SlotItem.Count);

                case (int)ColumnIndex.Level:
                    return(Info.Level - it2.Level);

                case (int)ColumnIndex.UpdateLevel:
                    return(Info.UpdateLevel - it2.UpdateLevel);

                case (int)ColumnIndex.HP:
                    return(Info.HP.Max - it2.HP.Max);

                case (int)ColumnIndex.Experience:
                    return(Info.Experience - it2.Experience);

                case (int)ColumnIndex.RequiredExperience:
                    return(Info.ExperienceRequiredToNextLevel - it2.ExperienceRequiredToNextLevel);

                case (int)ColumnIndex.UpdateExperience:
                    return(Info.ExperienceRequiredToUpgrade - it2.ExperienceRequiredToUpgrade);

                case (int)ColumnIndex.Fuel:
                    return(Info.Fuel.Max - it2.Fuel.Max);

                case (int)ColumnIndex.Bullet:
                    return(Info.Bullet.Max - it2.Bullet.Max);

                case (int)ColumnIndex.Condition:
                    return(Info.Condition - it2.Condition);

                case (int)ColumnIndex.Escape:
                    return(Info.Escape.Now - it2.Escape.Now);

                case (int)ColumnIndex.Fire:
                    return(Info.Fire.CompareTo(it2.Fire));

                case (int)ColumnIndex.Torpedo:
                    return(Info.Torpedo.CompareTo(it2.Torpedo));

                case (int)ColumnIndex.Armor:
                    return(Info.Armor.CompareTo(it2.Armor));

                case (int)ColumnIndex.AntiAir:
                    return(Info.AntiAir.CompareTo(it2.AntiAir));

                case (int)ColumnIndex.Search:
                    return(Info.Search.Now - it2.Search.Now);

                case (int)ColumnIndex.AntiSubm:
                    return(Info.AntiSubm.Now - it2.AntiSubm.Now);

                case (int)ColumnIndex.Speed:
                    return(Info.Speed - it2.Speed);

                case (int)ColumnIndex.Range:
                    return(Info.ShotRange - it2.ShotRange);

                case (int)ColumnIndex.Locked:
                    return((Info.Locked ? 1 : 0) - (it2.Locked ? 1 : 0));

                case (int)ColumnIndex.Luck:
                    return(Info.Lucky.Now - it2.Lucky.Now);

                case (int)ColumnIndex.SallyArea:
                    return(Info.SallyArea - it2.SallyArea);

                default:
                    System.Diagnostics.Debug.WriteLine("ShipListViewItem compare unknown column" + _column.ToString());
                    throw new NotImplementedException("ShipListViewItem compare unknown column" + _column.ToString());
                }
            }
Esempio n. 10
0
            /// <summary>
            /// 表示内容の更新
            /// </summary>
            /// <param name="newInfo"></param>
            /// <returns></returns>
            public void Update(MemberData.Ship.Info newInfo)
            {
                Info = newInfo;

                // データの更新がされていなければビューを更新しない
                if (LastUpdated >= Info.LastUpdated)
                {
                    return;
                }

                LastUpdated = Info.LastUpdated;

                SubItems[(int)ColumnIndex.ShipId].Text     = Info.ShipId.ToString();
                SubItems[(int)ColumnIndex.ShipSortNo].Text = Info.ShipSortNo.ToString();

                if (Info.Fleet != null)
                {
                    SubItems[(int)ColumnIndex.Fleet].Text = Info.Fleet.ToString();
                }
                else
                {
                    SubItems[(int)ColumnIndex.Fleet].Text = "";
                }
                SubItems[(int)ColumnIndex.ShipName].Text     = Info.ShipName;
                SubItems[(int)ColumnIndex.ShipNameYomi].Text = Info.ShipNameYomi;

                SubItems[(int)ColumnIndex.ShipType].Text    = Info.ShipType;
                SubItems[(int)ColumnIndex.DockName].Text    = Info.DockName;
                SubItems[(int)ColumnIndex.RepairTime].Text  = Info.RepairTimeString;
                SubItems[(int)ColumnIndex.RepairSteel].Text = Info.RepairSteel.ToString();
                SubItems[(int)ColumnIndex.RepairFuel].Text  = Info.RepairFuel.ToString();

                SubItems[(int)ColumnIndex.Level].Text      = Info.Level.ToString();
                SubItems[(int)ColumnIndex.Level].BackColor = Info.LevelBackgroundColor;

                SubItems[(int)ColumnIndex.UpdateLevel].Text = Info.UpdateLevel.ToString();

                SubItems[(int)ColumnIndex.HP].Text      = Info.HP.ToString();
                SubItems[(int)ColumnIndex.HP].BackColor = Info.HP.BackgroundColor;

                SubItems[(int)ColumnIndex.Experience].Text = Info.Experience.ToString();
                SubItems[(int)ColumnIndex.RequiredExperience].Text
                    = Info.ExperienceRequiredToNextLevel.ToString();

                SubItems[(int)ColumnIndex.UpdateExperience].Text = Info.ExperienceRequiredToUpgrade.ToString();

                SubItems[(int)ColumnIndex.Fuel].Text      = Info.Fuel.ToString();
                SubItems[(int)ColumnIndex.Fuel].BackColor = Info.Fuel.BackgroundColor;

                SubItems[(int)ColumnIndex.Bullet].Text      = Info.Bullet.ToString();
                SubItems[(int)ColumnIndex.Bullet].BackColor = Info.Bullet.BackgroundColor;

                SubItems[(int)ColumnIndex.Condition].Text      = Info.Condition.ToString();
                SubItems[(int)ColumnIndex.Condition].BackColor = Info.ConditionColor;

                SubItems[(int)ColumnIndex.Escape].Text    = Info.Escape.ToString();
                SubItems[(int)ColumnIndex.Fire].Text      = Info.Fire.ToString();
                SubItems[(int)ColumnIndex.Fire].BackColor = GetUpgradedParameterColor(ColumnIndex.Fire,
                                                                                      Info.Fire);
                SubItems[(int)ColumnIndex.Luck].Text         = Info.Lucky.ToString();
                SubItems[(int)ColumnIndex.Torpedo].Text      = Info.Torpedo.ToString();
                SubItems[(int)ColumnIndex.Torpedo].BackColor = GetUpgradedParameterColor(ColumnIndex.Torpedo,
                                                                                         Info.Torpedo);
                SubItems[(int)ColumnIndex.Search].Text     = Info.Search.ToString();
                SubItems[(int)ColumnIndex.Armor].Text      = Info.Armor.ToString();
                SubItems[(int)ColumnIndex.Armor].BackColor = GetUpgradedParameterColor(ColumnIndex.Armor,
                                                                                       Info.Armor);
                SubItems[(int)ColumnIndex.AntiAir].Text      = Info.AntiAir.ToString();
                SubItems[(int)ColumnIndex.AntiAir].BackColor = GetUpgradedParameterColor(ColumnIndex.AntiAir,
                                                                                         Info.AntiAir);
                SubItems[(int)ColumnIndex.AntiSubm].Text = Info.AntiSubm.ToString();
                SubItems[(int)ColumnIndex.Speed].Text    = Info.SpeedString;
                SubItems[(int)ColumnIndex.Range].Text    = Info.ShotRangeString;

                SubItems[(int)ColumnIndex.Locked].Text    = Info.Locked.ToString();
                SubItems[(int)ColumnIndex.SallyArea].Text = Info.SallyArea.ToString();

                ((SlotItemsLVSubItem)SubItems[(int)ColumnIndex.SlotItems]).Update(Info.SlotItem, Info.SlotNum, _iconIageList);
            }
Esempio n. 11
0
        /// <summary>
        /// 艦娘情報をリストに登録する
        /// </summary>
        /// <param name="order">登録する場所</param>
        /// <param name="info">登録する情報</param>
        void SetFriendFleetValue(int order, MemberData.Ship.Info info)
        {
            Label lblName, lblCond, lblHP;
            SlotItemPictureBox pbSlotItem;

            #region コントロール選択
            switch (order)
            {
            case 0:
                lblName    = lblFleet1;
                lblCond    = lblCond1;
                lblHP      = lblHP1;
                pbSlotItem = pbSlotItem1;
                break;

            case 1:
                lblName    = lblFleet2;
                lblCond    = lblCond2;
                lblHP      = lblHP2;
                pbSlotItem = pbSlotItem2;
                break;

            case 2:
                lblName    = lblFleet3;
                lblCond    = lblCond3;
                lblHP      = lblHP3;
                pbSlotItem = pbSlotItem3;
                break;

            case 3:
                lblName    = lblFleet4;
                lblCond    = lblCond4;
                lblHP      = lblHP4;
                pbSlotItem = pbSlotItem4;
                break;

            case 4:
                lblName    = lblFleet5;
                lblCond    = lblCond5;
                lblHP      = lblHP5;
                pbSlotItem = pbSlotItem5;
                break;

            case 5:
                lblName    = lblFleet6;
                lblCond    = lblCond6;
                lblHP      = lblHP6;
                pbSlotItem = pbSlotItem6;
                break;

            default:
                throw new IndexOutOfRangeException("Unknown order:" + order.ToString());
            }
            #endregion
            if (info == null)
            {
                lblName.Text      = "  ";
                lblName.BackColor = SystemColors.Control;
                lblCond.Text      = "  ";
                lblCond.BackColor = SystemColors.Control;
                lblHP.Text        = "     ";
                lblHP.BackColor   = SystemColors.Control;
                pbSlotItem.ClearSlotItem();

                toolTip1.SetToolTip(lblName, null);
                toolTip1.SetToolTip(lblCond, null);
                toolTip1.SetToolTip(pbSlotItem, null);
                toolTip1.SetToolTip(lblHP, null);

                return;
            }

            lblName.Text = string.Format("{0}|{1}", info.ShipName, info.Level);
            SupplyStatus supplyStatus = new SupplyStatus(info);


            lblName.BackColor = supplyStatus.BackgroundColor;

            lblCond.Text      = info.Condition.ToString();
            lblCond.BackColor = info.ConditionColor;
            lblHP.Text        = string.Format("{0}", info.HP.Percent);

            if (info.DockNum != 0)
            {
                lblHP.BackColor = Color.Aquamarine;
            }
            else
            {
                lblHP.BackColor = info.HP.BackgroundColor;
            }

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0} Lv.{1} Exp.{2}\n射程:{3} 速度:{4}",
                            info.ShipName, info.Level, info.Experience, info.ShotRangeString, info.SpeedString);

            if (info.ExperienceRequiredToNextLevel > 0)
            {
                sb.AppendFormat("\n次Lvまで{0}exp", info.ExperienceRequiredToNextLevel);
            }
            if (info.UpdateLevel > 0)
            {
                if (info.ExperienceRequiredToUpgrade == 0)
                {
                    sb.AppendFormat("\n改造Lv{0}に到達しています", info.UpdateLevel);
                }
                else
                {
                    sb.AppendFormat("\n改造Lv{0}まで{1}exp", info.UpdateLevel,
                                    info.ExperienceRequiredToUpgrade);
                }
            }

            sb.Append(supplyStatus.ToolTip);

            toolTip1.SetToolTip(lblName, sb.ToString());


            toolTip1.SetToolTip(lblCond, string.Format("コンディション:{0}%", info.Condition));

            sb.Clear();
            sb.AppendFormat("HP {0}({1})", info.HP, info.HP.Ratio.ToString("0.00%"));
            if (info.HP.Percent < 100)
            {
                sb.AppendFormat("\n入渠所要 {0}", info.RepairTimeString);
            }
            if (info.DockNum > 0)
            {
                sb.AppendFormat("\n{0}に入渠中", info.DockName);
            }

            toolTip1.SetToolTip(lblHP, sb.ToString());

            pbSlotItem.SlotNum = info.SlotNum;
            pbSlotItem.SetSlotItem(info.SlotItem);

            toolTip1.SetToolTip(pbSlotItem, pbSlotItem.ToolTipText);

            ResumeLayout();
        }
Esempio n. 12
0
 public LVItemParamsFactory(MemberData.Ship.Info shipInfo, ImageList imgSlotItem)
 {
     _pwupParams  = new SlotItemPowerupParams(shipInfo.SlotItem);
     _imgSlotItem = imgSlotItem;
     _info        = shipInfo;
 }
Esempio n. 13
0
 public FormShipDetail(ImageList imgSlotItem)
 {
     Info         = null;
     _imgSlotItem = imgSlotItem;
     InitializeComponent();
 }