コード例 #1
0
        public override VisualElement CreateInspectorGUI()
        {
            serializedObject.Update();

            root = new VisualElement();
            root.styleSheets.Add(StylesheetSetup());
            root.ToUSS(nameof(root));

            // root.RegisterCallback<GeometryChangedEvent>(DeferredExecution);

            var exampleInspectorContainer = new VisualElement();

            exampleInspectorContainer.NameAsUSS(nameof(exampleInspectorContainer));

            var playerDetailsRowContainer = new VisualElement();

            playerDetailsRowContainer.NameAsUSS(nameof(playerDetailsRowContainer));

            var detailsHolder = new VisualElement();

            detailsHolder.NameAsUSS(nameof(detailsHolder));
            var playerDetailsLabel = new AnimatedLabel {
                text = "Player Details"
            };

            playerDetailsLabel.NameAsUSS(nameof(playerDetailsLabel));
            detailsHolder.Add(playerDetailsLabel);
            playerDetailsRowContainer.Add(detailsHolder);
            labelData.Add(playerDetailsLabel);

            playerDetailsLabel.HoverBorderPulse("#2F569C".FromHex(), "#D2A00C".FromHex(), default, true, new Vector2(1, 1));
コード例 #2
0
        public void addAnimation(int icon, AnimatedLabel anim)
        {
            AnimatedLabel animCopy = new AnimatedLabel();

            animCopy.SetFrom(anim);

            animCopy.userData = icon;    // reference the icon no.
            animCopy.X        = icons[icon].X;
            animCopy.Y        = icons[icon].Y;
            StateMain.singleton.Animations.Add(animCopy);
            anim.Play();
        }
コード例 #3
0
        public void SpinReel(int reelNo)
        {
            if (soundsOn && reelNo == 0)
            {
                Sounds.reelSpin.Stop(true);
                Sounds.reelSpin.Play(false, true);
            }

            for (int j = 0; j < 3; j++)
            {
                reelSpinning[reelNo, j] = true;

                var anim = new AnimatedLabel();
                anim.SetFrom(animBlur);

                anim.X = 367 + (207 * reelNo);
                anim.Y = 90 + (j * 208);
                Animations.Add(anim);
                anim.Resest();
                anim.Play();
                SpinningReelAnims[reelNo, j] = anim;
            }
        }
コード例 #4
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);
        }
コード例 #5
0
        public GameIntroExperience()
        {
            Random rand = new Random();

            StackLayout startingLayout = new StackLayout
            {
                Orientation       = StackOrientation.Vertical,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            AnimatedLabel statusLabel = new AnimatedLabel
            {
                Text                    = "Welcome to Game " + (string)App.Get_Data_Store().Fetch("game_id"),
                FontSize                = 36,
                FontAttributes          = FontAttributes.None,
                Padding                 = 10,
                TextAlignmentHorizontal = TextAlignment.Center
            };

            toFadeOut.Add(statusLabel);
            startingLayout.Children.Add(statusLabel);

            StackLayout opponentInfo = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            AnimatedLabel opponentLabel = new AnimatedLabel
            {
                Text           = "Opponent: ",
                FontSize       = 22,
                FontAttributes = FontAttributes.Bold,
            };

            toFadeOut.Add(opponentLabel);
            opponentInfo.Children.Add(opponentLabel);

            //All this is to identify what opponents we are about to face in our match. It's very exciting stuff here.

            //Dictionary of <index>, <opponent profile dict - personal details>
            Dictionary <string, object> opponents = (Dictionary <string, object>)App.Get_Data_Store().Fetch("opponents");
            // The number of opponents
            int count = 0;
            //The string containing your opponents' names.
            String opponentString = "";
            //Label to hold the catchphrase of the opponent. Might feasibly be empty if they haven't equipped one.
            AnimatedLabel opponentCatchphrase = new AnimatedLabel
            {
                FontSize       = 18,
                FontAttributes = FontAttributes.Italic,
                Padding        = 20
            };

            toFadeOut.Add(opponentCatchphrase);
            //The catchphrase to display to the player
            String chosenCatchphrase = "";
            //List to hold all opponent catchphrases (in case of multiple, we pick one)
            List <String> catchphraseList = new List <String>();

            //Go through each opponent, increment, and get their name
            foreach (KeyValuePair <string, object> entry in opponents)
            {
                count++;
                Dictionary <string, object> profile = (Dictionary <string, object>)entry.Value;
                opponentString = opponentString + (string)profile["name"] + ", ";
                string catchphrase = (string)profile["catchphrase"];
                if (!String.IsNullOrWhiteSpace(catchphrase))
                {
                    catchphraseList.Add(catchphrase);
                }
            }
            //We have opponents (not a solo game)
            if (count > 0)
            {
                //Change label to indicate multiple
                opponentLabel.Text = "Opponents: ";
                //Remove the trailing comma and space
                opponentString           = opponentString.Substring(0, opponentString.Length - 2);
                chosenCatchphrase        = catchphraseList[rand.Next(0, catchphraseList.Count)];
                opponentCatchphrase.Text = chosenCatchphrase;
            }
            else
            {
                //There are no opponents
                opponentString = "Yourself";
            }

            AnimatedLabel opponentName = new AnimatedLabel
            {
                Text     = opponentString,
                FontSize = 22
            };

            toFadeOut.Add(opponentName);
            opponentInfo.Children.Add(opponentName);

            startingLayout.Children.Add(opponentInfo);

            if (!String.IsNullOrWhiteSpace(chosenCatchphrase))
            {
                startingLayout.Children.Add(opponentCatchphrase);
            }

            this.Content = startingLayout;

            Display_UI();
        }
コード例 #6
0
        public async Task Display_Game_Info()
        {
            await Task.Delay(TimeSpan.FromSeconds(1.5));

            StackLayout infoLayout = new StackLayout()
            {
                Orientation       = StackOrientation.Vertical,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                Padding           = 10
            };

            Dictionary <string, object> game_data = (Dictionary <string, object>)App.Get_Data_Store().Fetch("game_data");
            //name, desc

            AnimatedLabel subtextLabel = new AnimatedLabel
            {
                Text             = TextUtil.FirstLetterToUpperCase((string)game_data["name"]) + " Mode",
                FontSize         = 32,
                FontAttributes   = FontAttributes.Bold,
                HorizontalLayout = LayoutOptions.Center,
                Opacity          = 0.0,
            };

            toFadeIn.Add(subtextLabel);
            toFadeOut.Add(subtextLabel);
            infoLayout.Children.Add(subtextLabel);

            AnimatedLabel descriptionLabel = new AnimatedLabel
            {
                Text             = (string)game_data["desc"],
                HorizontalLayout = LayoutOptions.Center,
                FontSize         = 18,
                Opacity          = 0.0,
            };

            toFadeIn.Add(descriptionLabel);
            toFadeOut.Add(descriptionLabel);
            infoLayout.Children.Add(descriptionLabel);

            AnimatedLabel timerStartLabel = new AnimatedLabel
            {
                Text             = "Time starts when your first guess is made",
                HorizontalLayout = LayoutOptions.Center,
                FontSize         = 18,
                Opacity          = 0.0,
            };

            toFadeIn.Add(timerStartLabel);
            toFadeOut.Add(timerStartLabel);
            infoLayout.Children.Add(timerStartLabel);

            AnimatedLabel ngramLengthLabel = new AnimatedLabel
            {
                Text             = "You are searching for a " + (string)App.Get_Data_Store().Fetch("word_size") + "-gram",
                FontSize         = 24,
                FontAttributes   = FontAttributes.Bold,
                HorizontalLayout = LayoutOptions.Center,
                Opacity          = 0.0,
            };

            toFadeIn.Add(ngramLengthLabel);
            toFadeOut.Add(ngramLengthLabel);
            infoLayout.Children.Add(ngramLengthLabel);

            this.Content = infoLayout;
            this.ForceLayout();
        }
コード例 #7
0
        public QueueExperience()
        {
            RelativeLayout layout = new RelativeLayout();

            Label queueingForTitle = new Label()
            {
                Text                    = "Queuing for...",
                FontAttributes          = FontAttributes.Italic,
                HorizontalTextAlignment = TextAlignment.Start,
                HorizontalOptions       = LayoutOptions.Start,
                FontSize                = 34,
            };

            layout.Children.Add(queueingForTitle, Constraint.RelativeToParent((p) => { return((p.Width / 5) - 50); }), Constraint.Constant(45), Constraint.RelativeToParent((p) => { return(p.Width - (p.Width / 5)); }), Constraint.Constant(50));

            queueingFor =
                new AnimatedLabel
            {
                Text           = (string)App.Get_Data_Store().Fetch("queue_for"),
                FontSize       = 42,
                FontAttributes = FontAttributes.Bold
            };
            layout.Children.Add(queueingFor, Constraint.RelativeToParent((p) => { return((p.Width / 4) * 3 - 100); }), Constraint.Constant(45 + 40), Constraint.RelativeToParent((p) => { return(p.Width - ((p.Width / 4) * 3 - 100)); }), Constraint.Constant(70));

            StackLayout waitLayout = new StackLayout()
            {
                Orientation       = StackOrientation.Vertical,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            expectedQueueTime = new AnimatedLabel
            {
                Opacity  = 0.0,
                Text     = "Expected Queue Time: ",
                FontSize = 20,
            };
            waitLayout.Children.Add(expectedQueueTime);
            spentQueueTime = new AnimatedLabel
            {
                Opacity  = 0.0,
                Text     = "Time Spent in Queue: ",
                FontSize = 20,
            };
            waitLayout.Children.Add(spentQueueTime);
            rewardLabel = new AnimatedLabel
            {
                Opacity  = 0.0,
                Text     = "Reward: ",
                FontSize = 20,
            };
            waitLayout.Children.Add(rewardLabel);

            layout.Children.Add(waitLayout, Constraint.RelativeToParent((p) => { return(0); }), Constraint.RelativeToParent((p) => { return((p.Height * 3) / 4); }), Constraint.RelativeToParent((p) => { return(p.Width); }), Constraint.Constant(30));

            key_pregame_dict = new Dictionary <string, View>();

            this.Content = layout;

            Check_Queue_Status_Until_Done();
        }
コード例 #8
0
        public IconsView(MultiMediaLoader ml)
            : base("IconsView", 0, 0)
        {
            singleton = this;
            //pay lines init
            payLines = new int[Definitions.TotalPaylines * 3, Definitions.reelWidth];
            StateMain.getPaylines(ref payLines);

            // initialize static data for icons
            FramedTexture ftx = (FramedTexture)ml.GetObject("ftx_ovr_SlotIcons");

            Icon.iconImages = new GuiPictureBox(ftx, 0, 0, 0);

            ftx = (FramedTexture)ml.GetObject("ftx_ovr_SlotIcons_Win");
            Icon.winIconImages = new GuiPictureBox(ftx, 0, 0, 0);

            ftx            = (FramedTexture)ml.GetObject("ftx_anim_Reveal");
            Icon.coverAnim = new GuiPictureBox(ftx, 0, 0, 0);

            ftx         = (FramedTexture)ml.GetObject("ftx_ovr_LineLights");
            LineLights  = new GuiPictureBox(ftx, 0, 0, 0);
            fntLineBets = (IFont)ml.GetObject("lineBet_font");

            // Load Boxes and Lines...
            picWinBoxes = new GuiPictureBox[Definitions.TotalPaylines];
            picWinLines = new GuiPictureBox[Definitions.TotalPaylines];

            for (int i = 1; i <= Definitions.TotalPaylines; i++)
            {
                ftx = (FramedTexture)ml.GetObject("ftx_ovr_Line_" + i.ToString() + "_Box");
                picWinBoxes[i - 1] = new GuiPictureBox(ftx, 0, 0, 0);

                ftx = (FramedTexture)ml.GetObject("ftx_ovr_Line_" + i.ToString());
                picWinLines[i - 1] = new GuiPictureBox(ftx, 0, 0, 0);
            }


            //load the overlay...
            ftx            = (FramedTexture)ml.GetObject("ftx_ovr_MainScreen");
            picTabsOverlay = new GuiPictureBox(ftx, 0, 0, 0);

            ftx = (FramedTexture)ml.GetObject("ftx_ovr_MainScreen_ExtraSpins");
            picTabsOverlayFreeTabs = new GuiPictureBox(ftx, 0, 0, 0);
            StateMain.singleton.picMainOverlay.Alpha = 0;

            //loading icon animations ...
            Animation anim = (Animation)ml.GetObject("anim_Win_anim");

            for (int i = 0; i < Definitions.iconIndexMax; i++)
            {
                ftx = (FramedTexture)ml.GetObject("ftx_anim_Win_" + (i + 1).ToString());
                iconAnimations[i] = new AnimatedLabel(anim, ftx, 0, 0);
            }

            // setting icons locations...

            for (int i = 0; i < Definitions.IconsPerTab; i++)
            {
                icons[i] = new Icon();

                icons[i].X      = Definitions.CardLocations[i, 0];
                icons[i].Y      = Definitions.CardLocations[i, 1];
                icons[i].iconNo = (i + 1) % Definitions.iconIndexMax; //for test TBR..
            }

            //almChangeFlashingLine.Enable();
            almFlashLines.Enable();
        }
コード例 #9
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);
        }