Beispiel #1
0
 // Token: 0x06000732 RID: 1842 RVA: 0x00060484 File Offset: 0x0005E684
 public void doCloseMenu()
 {
     Res.outz("CLOSE MENU");
     this.isClose  = false;
     this.showMenu = false;
     InfoDlg.hide();
     if (this.close)
     {
         GameCanvas.panel.cp    = null;
         global::Char.chatPopup = null;
         if (GameCanvas.panel2 != null && GameCanvas.panel2.cp != null)
         {
             GameCanvas.panel2.cp = null;
         }
     }
     else if (this.touch)
     {
         GameCanvas.panel.cp = null;
         if (GameCanvas.panel2 != null && GameCanvas.panel2.cp != null)
         {
             GameCanvas.panel2.cp = null;
         }
         if (this.menuSelectedItem >= 0)
         {
             Command command = (Command)this.menuItems.elementAt(this.menuSelectedItem);
             if (command != null)
             {
                 SoundMn.gI().buttonClose();
                 command.performAction();
             }
         }
     }
 }
Beispiel #2
0
 // Token: 0x060006EA RID: 1770 RVA: 0x00006723 File Offset: 0x00004923
 public static void update()
 {
     if (InfoDlg.delay > 0)
     {
         InfoDlg.delay--;
         if (InfoDlg.delay == 0)
         {
             InfoDlg.hide();
         }
     }
 }
Beispiel #3
0
 // Token: 0x06000733 RID: 1843 RVA: 0x00060568 File Offset: 0x0005E768
 public void performSelect()
 {
     InfoDlg.hide();
     if (this.menuSelectedItem >= 0)
     {
         Command command = (Command)this.menuItems.elementAt(this.menuSelectedItem);
         if (command != null)
         {
             command.performAction();
         }
     }
 }
Beispiel #4
0
    // Token: 0x06000897 RID: 2199 RVA: 0x0007D454 File Offset: 0x0007B654
    public void perform(int idAction, object p)
    {
        Res.outz("perform " + idAction);
        if (idAction == 1000)
        {
            GameCanvas.connect();
        }
        if (idAction == 1 || idAction == 4)
        {
            this.cancel();
        }
        if (idAction == 2)
        {
            ServerListScreen.stopDownload  = false;
            ServerListScreen.cmdDownload   = new Command(mResources.huy, this, 4, null);
            ServerListScreen.cmdDownload.x = GameCanvas.w / 2 - mScreen.cmdW / 2;
            ServerListScreen.cmdDownload.y = GameCanvas.hh + 65;
            this.right = null;
            if (!GameCanvas.isTouch)
            {
                ServerListScreen.cmdDownload.x = GameCanvas.w / 2 - mScreen.cmdW / 2;
                ServerListScreen.cmdDownload.y = GameCanvas.h - mScreen.cmdH - 1;
            }
            this.center = new Command(string.Empty, this, 4, null);
            if (!ServerListScreen.isGetData)
            {
                Service.gI().getResource(1, null);
                if (!GameCanvas.isTouch)
                {
                    ServerListScreen.cmdDownload.isFocus = true;
                    this.center = new Command(string.Empty, this, 4, null);
                }
                ServerListScreen.isGetData = true;
            }
        }
        if (idAction == 3)
        {
            Res.outz("toi day");
            if (GameCanvas.loginScr == null)
            {
                GameCanvas.loginScr = new LoginScr();
            }
            GameCanvas.loginScr.switchToMe();
            bool flag  = Rms.loadRMSString("acc") != null && !Rms.loadRMSString("acc").Equals(string.Empty);
            bool flag2 = Rms.loadRMSString("userAo" + ServerListScreen.ipSelect) != null && !Rms.loadRMSString("userAo" + ServerListScreen.ipSelect).Equals(string.Empty);
            if (!flag && !flag2)
            {
                GameCanvas.connect();
                string text = Rms.loadRMSString("userAo" + ServerListScreen.ipSelect);
                if (text == null || text.Equals(string.Empty))
                {
                    Service.gI().login2(string.Empty);
                }
                else
                {
                    GameCanvas.loginScr.isLogin2 = true;
                    GameCanvas.connect();
                    Service.gI().setClientType();
                    Service.gI().login(text, string.Empty, GameMidlet.VERSION, 1);
                }
                if (Session_ME.connected)
                {
                    GameCanvas.startWaitDlg();
                }
                else
                {
                    GameCanvas.startOKDlg(mResources.maychutathoacmatsong);
                }
            }
            else
            {
                GameCanvas.loginScr.doLogin();
            }
            LoginScr.serverName = ServerListScreen.nameServer[ServerListScreen.ipSelect];
        }
        if (idAction == 10100)
        {
            if (GameCanvas.loginScr == null)
            {
                GameCanvas.loginScr = new LoginScr();
            }
            GameCanvas.loginScr.switchToMe();
            GameCanvas.connect();
            Service.gI().login2(string.Empty);
            Res.outz("tao user ao");
            GameCanvas.startWaitDlg();
            LoginScr.serverName = ServerListScreen.nameServer[ServerListScreen.ipSelect];
        }
        if (idAction == 5)
        {
            ServerListScreen.doUpdateServer();
            if (ServerListScreen.nameServer.Length == 1)
            {
                return;
            }
            MyVector myVector = new MyVector(string.Empty);
            for (int i = 0; i < ServerListScreen.nameServer.Length; i++)
            {
                myVector.addElement(new Command(ServerListScreen.nameServer[i], this, 6, null));
            }
            GameCanvas.menu.startAt(myVector, 0);
            if (!GameCanvas.isTouch)
            {
                GameCanvas.menu.menuSelectedItem = ServerListScreen.ipSelect;
            }
        }
        if (idAction == 6)
        {
            ServerListScreen.ipSelect = GameCanvas.menu.menuSelectedItem;
            this.selectServer();
        }
        if (idAction == 7)
        {
            if (GameCanvas.loginScr == null)
            {
                GameCanvas.loginScr = new LoginScr();
            }
            GameCanvas.loginScr.switchToMe();
        }
        if (idAction == 8)
        {
            bool     flag3     = Rms.loadRMSInt("lowGraphic") == 1;
            MyVector myVector2 = new MyVector("cau hinh");
            myVector2.addElement(new Command(mResources.cauhinhthap, this, 9, null));
            myVector2.addElement(new Command(mResources.cauhinhcao, this, 10, null));
            GameCanvas.menu.startAt(myVector2, 0);
            if (flag3)
            {
                GameCanvas.menu.menuSelectedItem = 0;
            }
            else
            {
                GameCanvas.menu.menuSelectedItem = 1;
            }
        }
        if (idAction == 9)
        {
            Rms.saveRMSInt("lowGraphic", 1);
            GameCanvas.startOK(mResources.plsRestartGame, 8885, null);
        }
        if (idAction == 10)
        {
            Rms.saveRMSInt("lowGraphic", 0);
            GameCanvas.startOK(mResources.plsRestartGame, 8885, null);
        }
        if (idAction == 11)
        {
            if (GameCanvas.loginScr == null)
            {
                GameCanvas.loginScr = new LoginScr();
            }
            GameCanvas.loginScr.switchToMe();
            string text2 = Rms.loadRMSString("userAo" + ServerListScreen.ipSelect);
            if (text2 == null || text2.Equals(string.Empty))
            {
                Service.gI().login2(string.Empty);
            }
            else
            {
                GameCanvas.loginScr.isLogin2 = true;
                GameCanvas.connect();
                Service.gI().setClientType();
                Service.gI().login(text2, string.Empty, GameMidlet.VERSION, 1);
            }
            GameCanvas.startWaitDlg(mResources.PLEASEWAIT);
            Res.outz("tao user ao");
        }
        if (idAction == 12)
        {
            GameMidlet.instance.exit();
        }
        if (idAction == 13 && (!ServerListScreen.isGetData || ServerListScreen.loadScreen))
        {
            switch (mSystem.clientType)
            {
            case 1:
                mSystem.callHotlineJava();
                break;

            case 3:
            case 5:
                mSystem.callHotlineIphone();
                break;

            case 4:
                mSystem.callHotlinePC();
                break;

            case 6:
                mSystem.callHotlineWindowsPhone();
                break;
            }
        }
        if (idAction == 14)
        {
            Command cmdYes = new Command(mResources.YES, GameCanvas.serverScreen, 15, null);
            Command cmdNo  = new Command(mResources.NO, GameCanvas.serverScreen, 16, null);
            GameCanvas.startYesNoDlg(mResources.deletaDataNote, cmdYes, cmdNo);
        }
        if (idAction == 15)
        {
            Rms.clearAll();
            GameCanvas.startOK(mResources.plsRestartGame, 8885, null);
        }
        if (idAction == 16)
        {
            InfoDlg.hide();
            GameCanvas.currentDialog = null;
        }
    }
Beispiel #5
0
 // Token: 0x0600072D RID: 1837 RVA: 0x0005F750 File Offset: 0x0005D950
 public void startAt(MyVector menuItems, int pos)
 {
     if (this.showMenu)
     {
         return;
     }
     this.isClose = false;
     this.touch   = false;
     this.close   = false;
     this.tDelay  = 0;
     if (menuItems.size() == 1)
     {
         this.menuSelectedItem = 0;
         Command command = (Command)menuItems.elementAt(0);
         if (command != null && command.caption.Equals(mResources.saying))
         {
             command.performAction();
             this.showMenu = false;
             InfoDlg.showWait();
             return;
         }
     }
     SoundMn.gI().openMenu();
     this.isNotClose = new bool[menuItems.size()];
     for (int i = 0; i < this.isNotClose.Length; i++)
     {
         this.isNotClose[i] = false;
     }
     this.disableClose       = false;
     ChatPopup.currChatPopup = null;
     Effect2.vEffect2.removeAllElements();
     Effect2.vEffect2Outside.removeAllElements();
     InfoDlg.hide();
     if (menuItems.size() == 0)
     {
         return;
     }
     this.menuItems = menuItems;
     this.menuW     = 60;
     this.menuH     = 60;
     for (int j = 0; j < menuItems.size(); j++)
     {
         Command command2 = (Command)menuItems.elementAt(j);
         command2.isPlaySoundButton = false;
         int width = mFont.tahoma_7_yellow.getWidth(command2.caption);
         command2.subCaption = mFont.tahoma_7_yellow.splitFontArray(command2.caption, this.menuW - 10);
         Res.outz("c caption= " + command2.caption);
     }
     Menu.menuTemY = new int[menuItems.size()];
     this.menuX    = (GameCanvas.w - menuItems.size() * this.menuW) / 2;
     if (this.menuX < 1)
     {
         this.menuX = 1;
     }
     this.menuY = GameCanvas.h - this.menuH - (Paint.hTab + 1) - 1;
     if (GameCanvas.isTouch)
     {
         this.menuY -= 3;
     }
     this.menuY += 27;
     for (int k = 0; k < Menu.menuTemY.Length; k++)
     {
         Menu.menuTemY[k] = GameCanvas.h;
     }
     this.showMenu         = true;
     this.menuSelectedItem = 0;
     Menu.cmxLim           = this.menuItems.size() * this.menuW - GameCanvas.w;
     if (Menu.cmxLim < 0)
     {
         Menu.cmxLim = 0;
     }
     Menu.cmtoX = 0;
     Menu.cmx   = 0;
     Menu.xc    = 50;
     this.w     = menuItems.size() * this.menuW - 1;
     if (this.w > GameCanvas.w - 2)
     {
         this.w = GameCanvas.w - 2;
     }
     if (GameCanvas.isTouch && !Main.isPC)
     {
         this.menuSelectedItem = -1;
     }
 }