Пример #1
0
 public void dock_selected(int dockNo)
 {
     DockCursorBlink(dockNo);
     dockSelectController.Index = dockNo;
     for (int i = dock_count; i < _clsRepair.MapArea.NDockMax; i++)
     {
         if (_clsRepair.IsValidOpenNewDock())
         {
             int num = i;
             GameObject.Find("board1_top/board/Grid/0" + num.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
         }
         else
         {
             int num2 = i;
             GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
         }
     }
     if (dockNo < _clsRepair.GetDocks().Length)
     {
         if (_clsRepair.GetDockData(dockSelectController.Index).ShipId != 0)
         {
             _go_kosoku = 1;
         }
         else
         {
             _go_kosoku = 0;
         }
         if (_go_kosoku == 0)
         {
             if (_clsRepair.GetDockData(dockNo).ShipId != 0 || get_HS_anime(dockNo))
             {
                 SoundUtils.PlaySE(SEFIleInfos.CommonWrong);
                 return;
             }
             rep.set_mode(-2);
             GameObject.Find("dialog_top/dialog").GetComponent <dialog>().SetDock(dockNo);
             bd2 = GameObject.Find("board2").GetComponent <board2>();
             bd2.board2_appear(boardStart: true);
             bd2.set_touch_mode(value: true);
             rep.setmask(1, value: true);
             rep.set_mode(2);
         }
         else if (get_HS_anime(dockNo) || now_kit <= 0)
         {
             SoundUtils.PlaySE(SEFIleInfos.CommonWrong);
         }
         else if (_clsRepair.IsValidChangeRepairSpeed(dockNo))
         {
             SoundUtils.PlaySE(SEFIleInfos.CommonEnter2);
             rep.set_mode(-5);
             dia2.UpdateInfo(dockNo);
             dia2.SetDock(dockNo);
             rep.setmask(3, value: true);
             dia2.dialog2_appear(bstat: true);
             rep.set_mode(5);
         }
         else
         {
             SoundUtils.PlaySE(SEFIleInfos.CommonWrong);
         }
     }
     else
     {
         int num3 = dockNo;
         GameObject.Find("board1_top/board/Grid/0" + num3.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock_on";
         if (_clsRepair.IsValidOpenNewDock())
         {
             SoundUtils.PlaySE(SEFIleInfos.CommonEnter2);
             dia3.UpdateInfo(dockNo);
             dia3.dialog3_appear(bstat: true);
             rep.set_mode(6);
         }
         else
         {
             SoundUtils.PlaySE(SEFIleInfos.CommonEnter2);
             CommonPopupDialog.Instance.StartPopup(Util.getPopupMessage(PopupMess.NoDockKey));
         }
     }
 }
Пример #2
0
        public void DockStatus(int MapArea, int TargetDock)
        {
            _first_key = true;
            rep.GetMstManager();
            rep.GetMst_ship();
            rep.update_portframe();
            _clsRepair = rep.now_clsRepair();
            dock_count = _clsRepair.GetDocks().Length;
            for (int i = 0; i < dock_count; i++)
            {
                int num = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg";
                int num2 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = "cardArea_YB";
                int num3 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num3.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = AreaIdToSeaSpriteName(rep.NowArea());
                int num4 = i;
                GameObject.Find("board1_top/board/Grid/0" + num4.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                int num5 = i;
                GameObject.Find("board1_top/board/Grid/0" + num5.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                if (TargetDock == -1)
                {
                    shutter[i].transform.localScale = Vector3.zero;
                }
                dock_cursor[i] = GameObject.Find("board1_top/board/Grid/" + dock[i].name + "/bg/BackGround");
                btn_Stk[i].SetActive(true);
            }
            int nDockMax = _clsRepair.MapArea.NDockMax;

            for (int j = dock_count; j < nDockMax; j++)
            {
                if (TargetDock != -1 && TargetDock != j)
                {
                    continue;
                }
                int num6 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num6.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg_bar_closed";
                int num7 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num7.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = null;
                int num8 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num8.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = null;
                if (_first_key)
                {
                    if (_clsRepair.IsValidOpenNewDock())
                    {
                        int num9 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num9.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_02";
                        int num10 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num10.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    else
                    {
                        int num11 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num11.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_01";
                        int num12 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num12.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    int num13 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num13.ToString() + "/Shutter/BGKey").transform.localScaleOne();
                    _first_key = false;
                }
                else
                {
                    int num14 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num14.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num15 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num15.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                }
                shutter[j].transform.localScale = Vector3.one;
                dock_cursor[j] = GameObject.Find("board1_top/board/Grid/" + dock[j].name + "/Shutter/ShutterALL");
                dock_cursor[j].transform.localScale = Vector3.one;
                btn_Stk[j].SetActive((j <= dock_count) ? true : false);
                r_now[j].SetActive(false);
            }
            for (int k = nDockMax; k < 4; k++)
            {
                if (TargetDock == -1 || TargetDock == k)
                {
                    int num16 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num16.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num17 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num17.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num18 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num18.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num19 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num19.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num20 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num20.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                    shutter[k].transform.localScale = Vector3.zero;
                    btn_Stk[k].SetActive(false);
                    r_now[k].SetActive(false);
                }
            }
            for (int l = 0; l < dock_count; l++)
            {
                crane_anime component = GameObject.Find("board/Grid/0" + l.ToString() + "/Anime").GetComponent <crane_anime>();
                ShipModel   ship      = _clsRepair.GetDockData(l).GetShip();
                if (TargetDock != -1 && TargetDock != l)
                {
                    continue;
                }
                if (_clsRepair.GetDockData(l).ShipId != 0 && _clsRepair.GetDockData(l).RemainingTurns != 0)
                {
                    r_now[l].SetActive(true);
                    btn_Stk[l].SetActive(false);
                    int num21 = l;
                    tex = GameObject.Find("board/Grid/0" + num21.ToString() + "/repair_now/ship_banner").GetComponent <UITexture>();
                    if (ship.DamageStatus == DamageState.Taiha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else if (ship.DamageStatus == DamageState.Tyuuha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 1);
                    }
                    int num22 = l;
                    lab      = GameObject.Find("board/Grid/0" + num22.ToString() + "/repair_now/text_ship_name").GetComponent <UILabel>();
                    lab.text = ship.Name;
                    int num23 = l;
                    lab      = GameObject.Find("board/Grid/0" + num23.ToString() + "/repair_now/text_level").GetComponent <UILabel>();
                    lab.text = string.Empty + ship.Level;
                    int num24 = l;
                    lab      = GameObject.Find("board/Grid/0" + num24.ToString() + "/repair_now/text_hp").GetComponent <UILabel>();
                    lab.text = ship.NowHp + "/" + ship.MaxHp;
                    MaxHP[l] = ship.MaxHp;
                    int num25 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num25.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter2").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num26 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num26.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num27 = l;
                    lab      = GameObject.Find("board/Grid/0" + num27.ToString() + "/repair_now/text_least_time").GetComponent <UILabel>();
                    lab.text = string.Empty + _clsRepair.GetDockData(l).RemainingTurns;
                    int num28 = l;
                    uibutton = GameObject.Find("board/Grid/0" + num28.ToString() + "/repair_now/btn_high_repair").GetComponent <UIButton>();
                    if (_clsRepair.Material.RepairKit > 0)
                    {
                        uibutton.isEnabled = true;
                    }
                    else
                    {
                        uibutton.isEnabled = false;
                    }
                    set_anime(l, stat: false);
                    component.start_anime(l);
                }
                else
                {
                    r_now[l].SetActive(false);
                    btn_Stk[l].SetActive(true);
                    component.stop_anime(l);
                    set_anime(l, stat: false);
                }
            }
            swsw = GameObject.Find("board3_top/board3/sw01").GetComponent <sw>();
            swsw.set_sw_stat((_clsRepair.Material.RepairKit > 0) ? true : false);
            _dock_exist = true;
        }