Esempio n. 1
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;
        }
Esempio n. 2
0
        public void DockStatus(int MapArea, int TargetDock)
        {
            this._first_key = true;
            Mst_DataManager mstManager = this.rep.GetMstManager();
            Mst_ship        mst_ship   = this.rep.GetMst_ship();

            this.rep.update_portframe();
            this._clsRepair = this.rep.now_clsRepair();
            this.dock_count = this._clsRepair.GetDocks().Length;
            for (int i = 0; i < this.dock_count; i++)
            {
                string arg_6A_0 = "board1_top/board/Grid/0";
                int    num      = i;
                this.bds2            = GameObject.Find(arg_6A_0 + num.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                this.bds2.spriteName = "list_bg";
                string arg_A3_0 = "board1_top/board/Grid/0";
                int    num2     = i;
                this.bds2            = GameObject.Find(arg_A3_0 + num2.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                this.bds2.spriteName = "cardArea_YB";
                string arg_DC_0 = "board1_top/board/Grid/0";
                int    num3     = i;
                this.bds2            = GameObject.Find(arg_DC_0 + num3.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                this.bds2.spriteName = this.AreaIdToSeaSpriteName(this.rep.NowArea());
                string arg_120_0 = "board1_top/board/Grid/0";
                int    num4      = i;
                GameObject.Find(arg_120_0 + num4.ToString() + "/Shutter/BGKey").get_transform().localScaleZero();
                string arg_148_0 = "board1_top/board/Grid/0";
                int    num5      = i;
                GameObject.Find(arg_148_0 + num5.ToString() + "/Shutter/BGMes").get_transform().localScaleZero();
                if (TargetDock == -1)
                {
                    this.shutter[i].get_transform().set_localScale(Vector3.get_zero());
                }
                this.dock_cursor[i] = GameObject.Find("board1_top/board/Grid/" + this.dock[i].get_name() + "/bg/BackGround");
                this.btn_Stk[i].SetActive(true);
            }
            int nDockMax = this._clsRepair.MapArea.NDockMax;

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