コード例 #1
0
        public override bool OnLoad()
        {
            singleton = this;
            sfX       = ((double)IGraphics.Singleton.ScreenWidth / (double)1024);
            sfY       = ((double)IGraphics.Singleton.ScreenHeight / (double)768);


            try
            {
                Bingo.singleton.localSettings = new Settings1063(Bingo.singleton.gameSettings.data);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error parsing local settings: " + ex.Message);
                Application.Exit();
            }


            BMLoader ml = new BMLoader("MainLoader");

            try
            {
                ml.Add(StateLoading.singleton.mediaObjs);
                ml.LoadFile("Main.txt");
                guiManager.Add(ml);


                Sounds = new SoundSystem(ml);   //load sounds...

                fntDenomination   = (IFont)ml.GetObject("denomination_font");
                fntFreeTabsSign   = (IFont)ml.GetObject("FreeTabsSign_font");
                fntPaytablePrizes = (IFont)ml.GetObject("Paytable_font");
                fntGameOver       = (IFont)ml.GetObject("gameover_font");

                picMainBackGround = (GuiPictureBox)ml.GetObject("bg_MainScreen_pic");
                picMainOverlay    = (GuiPictureBox)ml.GetObject("bg_MainScreen_ExtraSpins_pic");

                picFreeTabsWinSign      = (GuiPictureBox)ml.GetObject("ovr_FreeTabsSign_pic");
                picFreeTabsTotalWinSign = (GuiPictureBox)ml.GetObject("ovr_TotalWon_pic");
                picHelpOptions          = (GuiPictureBox)ml.GetObject("bg_Help_pic");
                picPayTable             = (GuiPictureBox)ml.GetObject("bg_Pays_pic");
                picWinPatterns          = (GuiPictureBox)ml.GetObject("bg_WinningPatterns_pic");


                btnRevealAll    = (GuiButton)ml.GetObject("btn_RevealAll_button");
                btnContinue     = (GuiButton)ml.GetObject("btn_btn_Continue");
                btnDenomination = (GuiButton)ml.GetObject("btn_Denomination_button");
                animWholePull   = (AnimatedLabel)ml.GetObject("anim_WholeTabPull_Small_animation");
                animAnySameWin  = (AnimatedLabel)ml.GetObject("anim_AnySameWin_animation");

                //btnSelectLines = (GuiButton)ml.GetObject("btn_SelectLines_button");
                btnCashout     = (GuiButton)ml.GetObject("btn_Cashout_button");
                btnHelpOptions = (GuiButton)ml.GetObject("btn_HelpOptions_button");
                //btnBetUp = (GuiButton)ml.GetObject("btn_BetUp_button");
                //btnBetDown = (GuiButton)ml.GetObject("btn_BetDown_button");

                btnBack        = (GuiButton)ml.GetObject("btn_Back_button");
                btnHelp        = (GuiButton)ml.GetObject("btn_Help_button");
                btnPayouts     = (GuiButton)ml.GetObject("btn_Payouts_button");
                btnWinPatterns = (GuiButton)ml.GetObject("btn_WinningPatterns_button");
                btnAudio       = (GuiButton)ml.GetObject("btn_Audio_button");


                //Labels

                lblBalance    = (GuiLabel)ml.GetObject("lbl_balance");
                lblWon        = (GuiLabel)ml.GetObject("lbl_won");
                lblCost       = (GuiLabel)ml.GetObject("lbl_cost");
                lblFreeTabs   = (GuiLabel)ml.GetObject("lbl_freeTabsLabel");
                lblFreeTabsNo = (GuiLabel)ml.GetObject("lbl_TabsNo");
                lblLineAmount = (GuiLabel)ml.GetObject("lbl_LineAmount");
                lblTabNo      = (GuiLabel)ml.GetObject("lbl_TabNumber");

                // updating bounds so that buttons will not interfere...

                btnCashout.Bounds      = new Rectangle(btnCashout.X, btnCashout.Y, btnCashout.Width - 70, btnCashout.Height);
                btnDenomination.Bounds = new Rectangle(btnDenomination.X, btnDenomination.Y, btnDenomination.Width - 10, btnDenomination.Height - 35);;


                animMiniLogo = (AnimatedLabel)ml.GetObject("anim_MiniLogo_animation");



                //Game States...

                stCredit      = new StCredit(this);
                stPlay        = new StPlay(this);
                stWin         = new StWin(this);
                stLose        = new StLose(this);
                stHelpOptions = new StHelpOptions(this);
                stGameOver    = new StGameOver(this);


                // Creating Complex Objects


                iconsView = new IconsView(ml);
                guiManager.Add(iconsView);

                odoBalance = new TextOdo(lblBalance, Bingo.singleton.curPIN.balance, "C", 0.05M);
                guiManager.Add(odoBalance);

                odoFreeTabs        = new TextOdo(lblFreeTabs, 0M, "#", 1M);
                odoFreeTabs.Active = false;
                guiManager.Add(odoFreeTabs);


                totalWinSign = new Sign(picFreeTabsTotalWinSign, StWin.animComing, StWin.animLeaving);
                guiManager.Add(totalWinSign);

                almTotalWinSign.Enable();
                almTotalWinSign.Reset();


                //order items...

                picMainOverlay.Visible = false;
                guiManager.MoveToFront(picMainBackGround);
                guiManager.MoveToFront(picMainOverlay);
                guiManager.MoveToFront(iconsView);
                guiManager.MoveToFront(btnContinue);
                guiManager.MoveToFront(btnRevealAll);

                if (Bingo.singleton.localSettings.IsSpin)
                {
                    var ftx  = (FramedTexture)ml.GetObject("ftx_blur");
                    var anim = (Animation)ml.GetObject("blur_anim");
                    animBlur = new AnimatedLabel(anim, ftx, 0, 0);
                }
                else
                {
                    guiManager.MoveToFront(animWholePull);
                    animWholePull.Resest();
                    animWholePull.Stop();
                    animWholePull.Interactive = true;
                }

                //guiManager.MoveToFront(btnBetUp);
                //guiManager.MoveToFront(btnBetDown);

                //guiManager.MoveToFront(btnSelectLines);
                guiManager.MoveToFront(btnCashout);
                guiManager.MoveToFront(btnHelpOptions);

                guiManager.MoveToFront(animMiniLogo);
                guiManager.MoveToFront(lblBalance);
                guiManager.MoveToFront(lblWon);
                guiManager.MoveToFront(lblCost);
                guiManager.MoveToFront(lblFreeTabs);
                guiManager.MoveToFront(lblFreeTabsNo);


                guiManager.MoveToFront(lblLineAmount);
                guiManager.MoveToFront(lblTabNo);
                guiManager.MoveToFront(picFreeTabsWinSign);
                guiManager.MoveToFront(picFreeTabsTotalWinSign);

                guiManager.MoveToFront(animAnySameWin);
                animAnySameWin.Stop();
                animAnySameWin.Visible = false;

                guiManager.MoveToFront(picWinPatterns);
                guiManager.MoveToFront(picPayTable);
                guiManager.MoveToFront(picHelpOptions);
                guiManager.MoveToFront(btnDenomination);
                guiManager.MoveToFront(btnWinPatterns);
                guiManager.MoveToFront(btnPayouts);
                guiManager.MoveToFront(btnHelp);
                guiManager.MoveToFront(btnBack);
                guiManager.MoveToFront(btnAudio);

                picWinPatterns.Visible = false;
                picPayTable.Visible    = false;
                picHelpOptions.Visible = false;
                btnWinPatterns.Visible = false;
                btnPayouts.Visible     = false;
                btnHelp.Visible        = false;
                btnBack.Visible        = false;
                btnAudio.Visible       = false;
                btnAudio.ToggleMode    = true;

                // Meters & Service...

                activeLines = Definitions.TotalPaylines;

                pinBalance = Bingo.singleton.curPIN.balance;

                TabPrices = new decimal[Bingo.singleton.localSettings.noOfDenominations];

                for (int i = 0; i < Bingo.singleton.localSettings.noOfDenominations; i++)
                {
                    TabPrices[i] = Bingo.singleton.localSettings.gameDenominations[i];
                }

                // TBR...

                for (int i = 0; i < scatters.Length; i++)
                {
                    scatters[i]          = new freeTabsPerScatters();
                    scatters[i].freeTabs = Definitions.Scatters[i + 2];
                    scatters[i].scatters = (i + 3);
                }

                //Bingo.singleton.service.deleteGameRecoveryData(Bingo.singleton.terminalID.ToString());

                #region Game Recovery

                try
                {
                    string tmpRecoveryData = utils.FileBasedRecovery.getDatabaseRecoveryData();

                    if (tmpRecoveryData != "")
                    {
                        string[] parts = tmpRecoveryData.Split(',');
                        if (parts[0].Contains(Bingo.gameSystemID.ToString()))
                        {
                            //STARTING GAME RECOVERY PROCESS

                            String state = parts[1];

                            //loading icons...

                            //load the 3 inputs...
                            //tmpData += betPerLine.ToString() + "," + denominationIdx.ToString() + "," + activeLines.ToString();

                            betPerLine   = int.Parse(parts[2]);
                            tabPricesIdx = int.Parse(parts[3]);
                            //activeLines = int.Parse(parts[4]);
                            costForReveal   = TabPrices[tabPricesIdx];
                            freeTabsMode    = (parts[25].ToLower() == "true") ? true : false;
                            freeTabsBalance = int.Parse(parts[26]);


                            if (freeTabsMode)
                            {
                                startFreeTabsMode();
                            }

                            switch (state)
                            {
                            case "Credit-State":
                                changeStateTo(stCredit);
                                lblTabNo.Text = parts[27];
                                break;

                            case "Play-State":
                            case "Lose-State":
                            case "Win-State":
                                changeStateTo(stCredit);
                                changeStateTo(stPlay);

                                if (!Bingo.singleton.localSettings.IsSpin)
                                {
                                    animWholePull.Resest();
                                    animWholePull.Play();
                                }

                                lblTabNo.Text             = parts[27];
                                ((StPlay)stPlay).winnings = decimal.Parse(parts[28]);
                                //load last game icons
                                for (int i = 0; i < Definitions.IconsPerTab; i++)
                                {
                                    //tmpData += iconsView.icons[i].iconNo + ",";
                                    //tmpData += (int)iconsView.icons[i].status + ",";
                                    iconsView.icons[i].iconNo = int.Parse(parts[5 + (i * 2)]);
                                    if (((GameObjects.Icon.iconStatus) int.Parse(parts[6 + (i * 2)])) == GameObjects.Icon.iconStatus.Concealed)
                                    {
                                        iconsView.icons[i].status = GameObjects.Icon.iconStatus.Concealed;
                                    }
                                    else
                                    {
                                        iconsView.icons[i].Reveal();
                                    }
                                }
                                ((StPlay)stPlay).autoReveal = (parts[23].ToLower() == "true") ? true : false;
                                ((StPlay)stPlay).setGameStateData(parts[24]);
                                break;
                            }
                        }
                        else
                        {
                            if (MessageBox.Show("This machine has recovery data in Database for another game (" + parts[0] + "). Do you want to reset ", "Recovery", MessageBoxButtons.YesNo) == DialogResult.Yes)
                            {
                                if (Bingo.singleton.service.deleteGameRecoveryData(Bingo.singleton.curEGMData.terminalID))
                                {
                                    MessageBox.Show("Recovery Deleted! The game will Run Now!");
                                    changeStateTo(stCredit);
                                }
                            }
                            else
                            {
                                Application.Exit();
                            }
                        }
                    }
                    else
                    {
                        // change current state...
                        changeStateTo(stCredit);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Recovery Data Error: " + ex.Message);
                }

                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("StateMain - OnLoad: " + ex.ToString());
            }
            return(true);
        }
コード例 #2
0
        public override bool OnLoad()
        {
            singleton = this;
            sfX       = ((double)IGraphics.Singleton.ScreenWidth / (double)1024);
            sfY       = ((double)IGraphics.Singleton.ScreenHeight / (double)768);


            try
            {
                Bingo.singleton.localSettings = new Settings1063("4,0.25,0.50,0.75,1.00,");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error parsing local settings: " + ex.Message);
                Application.Exit();
            }


            BMLoader ml = new BMLoader("MainLoader");

            try
            {
                ml.Add(StateLoading.singleton.mediaObjs);
                ml.LoadFile("Main.txt");
                guiManager.Add(ml);


                Sounds = new SoundSystem(ml);   //load sounds...

                fntDenomination   = (IFont)ml.GetObject("denomination_font");
                fntFreeTabsSign   = (IFont)ml.GetObject("FreeTabsSign_font");
                fntPaytablePrizes = (IFont)ml.GetObject("Paytable_font");
                fntGameOver       = (IFont)ml.GetObject("gameover_font");

                picMainBackGround = (GuiPictureBox)ml.GetObject("bg_MainScreen_pic");
                picMainOverlay    = (GuiPictureBox)ml.GetObject("bg_MainScreen_ExtraSpins_pic");

                picFreeTabsWinSign      = (GuiPictureBox)ml.GetObject("ovr_FreeTabsSign_pic");
                picFreeTabsTotalWinSign = (GuiPictureBox)ml.GetObject("ovr_TotalWon_pic");
                picHelpOptions          = (GuiPictureBox)ml.GetObject("bg_Help_pic");
                picPayTable             = (GuiPictureBox)ml.GetObject("bg_Pays_pic");
                picWinPatterns          = (GuiPictureBox)ml.GetObject("bg_WinningPatterns_pic");


                btnRevealAll    = (GuiButton)ml.GetObject("btn_RevealAll_button");
                btnContinue     = (GuiButton)ml.GetObject("btn_btn_Continue");
                btnDenomination = (GuiButton)ml.GetObject("btn_Denomination_button");
                animWholePull   = (AnimatedLabel)ml.GetObject("anim_WholeTabPull_Small_animation");

                //btnSelectLines = (GuiButton)ml.GetObject("btn_SelectLines_button");
                btnCashout     = (GuiButton)ml.GetObject("btn_Cashout_button");
                btnHelpOptions = (GuiButton)ml.GetObject("btn_HelpOptions_button");
                //btnBetUp = (GuiButton)ml.GetObject("btn_BetUp_button");
                //btnBetDown = (GuiButton)ml.GetObject("btn_BetDown_button");

                btnBack        = (GuiButton)ml.GetObject("btn_Back_button");
                btnHelp        = (GuiButton)ml.GetObject("btn_Help_button");
                btnPayouts     = (GuiButton)ml.GetObject("btn_Payouts_button");
                btnWinPatterns = (GuiButton)ml.GetObject("btn_WinningPatterns_button");
                btnAudio       = (GuiButton)ml.GetObject("btn_Audio_button");


                //Labels

                lblBalance    = (GuiLabel)ml.GetObject("lbl_balance");
                lblWon        = (GuiLabel)ml.GetObject("lbl_won");
                lblCost       = (GuiLabel)ml.GetObject("lbl_cost");
                lblFreeTabs   = (GuiLabel)ml.GetObject("lbl_freeTabsLabel");
                lblFreeTabsNo = (GuiLabel)ml.GetObject("lbl_TabsNo");
                lblLineAmount = (GuiLabel)ml.GetObject("lbl_LineAmount");
                lblTabNo      = (GuiLabel)ml.GetObject("lbl_TabNumber");

                // updating bounds so that buttons will not interfere...

                btnCashout.Bounds      = new Rectangle(btnCashout.X, btnCashout.Y, btnCashout.Width - 70, btnCashout.Height);
                btnDenomination.Bounds = new Rectangle(btnDenomination.X, btnDenomination.Y, btnDenomination.Width - 10, btnDenomination.Height - 35);;


                animMiniLogo = (AnimatedLabel)ml.GetObject("anim_MiniLogo_animation");



                //Game States...

                stCredit      = new StCredit(this);
                stPlay        = new StPlay(this);
                stWin         = new StWin(this);
                stLose        = new StLose(this);
                stHelpOptions = new StHelpOptions(this);
                stGameOver    = new StGameOver(this);


                // Creating Complex Objects


                iconsView = new IconsView(ml);
                guiManager.Add(iconsView);

                odoBalance = new TextOdo(lblBalance, Bingo.singleton.curPIN.balance, "C", 0.05M);
                guiManager.Add(odoBalance);

                odoFreeTabs        = new TextOdo(lblFreeTabs, 0M, "#", 1M);
                odoFreeTabs.Active = false;
                guiManager.Add(odoFreeTabs);


                totalWinSign = new Sign(picFreeTabsTotalWinSign, StWin.animComing, StWin.animLeaving);
                guiManager.Add(totalWinSign);

                almTotalWinSign.Enable();
                almTotalWinSign.Reset();


                //order items...

                picMainOverlay.Visible = false;
                guiManager.MoveToFront(picMainBackGround);
                guiManager.MoveToFront(picMainOverlay);
                guiManager.MoveToFront(iconsView);
                guiManager.MoveToFront(btnContinue);
                guiManager.MoveToFront(btnRevealAll);

                guiManager.MoveToFront(animWholePull);
                animWholePull.Resest();
                animWholePull.Stop();
                animWholePull.Interactive = true;

                //guiManager.MoveToFront(btnBetUp);
                //guiManager.MoveToFront(btnBetDown);

                //guiManager.MoveToFront(btnSelectLines);
                guiManager.MoveToFront(btnCashout);
                guiManager.MoveToFront(btnHelpOptions);

                guiManager.MoveToFront(animMiniLogo);
                guiManager.MoveToFront(lblBalance);
                guiManager.MoveToFront(lblWon);
                guiManager.MoveToFront(lblCost);
                guiManager.MoveToFront(lblFreeTabs);
                guiManager.MoveToFront(lblFreeTabsNo);


                guiManager.MoveToFront(lblLineAmount);
                guiManager.MoveToFront(lblTabNo);
                guiManager.MoveToFront(picFreeTabsWinSign);
                guiManager.MoveToFront(picFreeTabsTotalWinSign);

                guiManager.MoveToFront(picWinPatterns);
                guiManager.MoveToFront(picPayTable);
                guiManager.MoveToFront(picHelpOptions);
                guiManager.MoveToFront(btnDenomination);
                guiManager.MoveToFront(btnWinPatterns);
                guiManager.MoveToFront(btnPayouts);
                guiManager.MoveToFront(btnHelp);
                guiManager.MoveToFront(btnBack);
                guiManager.MoveToFront(btnAudio);

                picWinPatterns.Visible = false;
                picPayTable.Visible    = false;
                picHelpOptions.Visible = false;
                btnWinPatterns.Visible = false;
                btnPayouts.Visible     = false;
                btnHelp.Visible        = false;
                btnBack.Visible        = false;
                btnAudio.Visible       = false;
                btnAudio.ToggleMode    = true;

                // Meters & Service...

                activeLines = Definitions.TotalPaylines;

                pinBalance = Bingo.singleton.curPIN.balance;

                TabPrices = new decimal[Bingo.singleton.localSettings.noOfDenominations];

                for (int i = 0; i < Bingo.singleton.localSettings.noOfDenominations; i++)
                {
                    TabPrices[i] = Bingo.singleton.localSettings.gameDenominations[i];
                }

                // TBR...

                for (int i = 0; i < scatters.Length; i++)
                {
                    scatters[i]          = new freeTabsPerScatters();
                    scatters[i].freeTabs = Definitions.Scatters[i + 2];
                    scatters[i].scatters = (i + 3);
                }

                //Bingo.singleton.service.deleteGameRecoveryData(Bingo.singleton.terminalID.ToString());

                #region Game Recovery

                try
                {
                    // change current state...
                    changeStateTo(stCredit);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Recovery Data Error: " + ex.Message);
                }

                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("StateMain - OnLoad: " + ex.ToString());
            }
            return(true);
        }