Esempio n. 1
0
        protected override void OnInitialize(object[] parameters)
        {
            UIFrame frame = AddFrame(
                0, 0, UI.Game.Renderer.TileCount.Width, UI.Game.Renderer.TileCount.Height,
                (int)TileID.Frame, RGBColor.Goldenrod);

            frame.ZOrder = 1;

            AddLabel(2, 2, "ONE BIT OF ENGINE DEMO", (int)TileID.Font, RGBColor.PaleGoldenrod);

            AddLabel(2, 4, "Please select an option:", (int)TileID.Font, RGBColor.PaleGoldenrod);

            UIMenu menu = AddMenu(2, 6, (int)TileID.Font, RGBColor.White);

            menu.SelectedColor = RGBColor.Yellow;
            menu.SelectedVFX   = TileVFX.Negative;

            MenuUI           = menu.AddMenuItem("User interface demo");
            MenuGameWorld    = menu.AddMenuItem("Game world demo");
            MenuDrawingBoard = menu.AddMenuItem("Drawing board");
            MenuVFX          = menu.AddMenuItem("Visual FX demo");
            MenuAudio        = menu.AddMenuItem("Audio demo");
            MenuInput        = menu.AddMenuItem("Input demo");
            menu.AddSeparator();
            MenuExit = menu.AddMenuItem("Exit");

            menu.OnSelectedItemValidated += OnMenuItemValidated;
            menu.OnSelectedItemChanged   += OnMenuItemChanged;

            AddLabel(2, UI.Game.Renderer.TileCount.Height - 4, "[UP,DOWN]: select, [ENTER]: validate", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 3, "[F]: fullscreen toggle, [ESC]: quit", (int)TileID.Font, RGBColor.PaleGoldenrod);
        }
 // Use this for initialization
 void Start()
 {
     m_targetGlove = m_targetGlove.GetComponent <GloveController>();
     m_slider      = GetComponent <BarSlider>();
     m_frame       = GetComponent <UIFrame>();
     m_frame.SetLabel(m_targetGlove.GetGestureName(m_gestureindex));
 }
Esempio n. 3
0
 void HidePlayerAndTarget()
 {
     if (TargetCamObject != null)
     {
         Camera targetCamera = TargetCamObject.GetComponent <Camera>();
         HideCamFeed(TargetCamObject);
         UIFrame targetCamFrame = TargetFrameObject.GetComponent <UIFrame>();
         if (targetCamFrame != null)
         {
             targetCamFrame.display = false;
         }
     }
     if (PlayerCameraObject != null)
     {
         Camera playerCamera = PlayerCameraObject.GetComponent <Camera>();
         HideCamFeed(PlayerCameraObject);
         FrameTile playerFrameTile = PlayerCameraObject.GetComponentInChildren <FrameTile>();
         if (playerFrameTile != null)
         {
             playerFrameTile.Hide();
         }
         UIFrame playerCamFrame = CurrentFrameObject.GetComponent <UIFrame>();
         if (playerCamFrame != null)
         {
             playerCamFrame.display = false;
         }
     }
 }
Esempio n. 4
0
        /*
         * UIFrame
         * A generic UI frame
         */
        public static UIFrame CreateFrame()
        {
            GameObject frame  = Instantiate(Instance.framePrefab) as GameObject;
            UIFrame    attach = frame.GetComponent <UIFrame>();

            return(attach);
        }
 private void Awake()
 {
     uiFrame = defaultUISettings.CreateUIInstance();
     Signals.Get <StartDemoSignal>().AddListener(OnStartDemo);
     Signals.Get <NavigateToWindowSignal>().AddListener(OnNavigateToWindow);
     Signals.Get <ShowConfirmationPopupSignal>().AddListener(OnShowConfirmationPopup);
 }
Esempio n. 6
0
 public override void Awake()
 {
     base.Awake();
     SetIsDraggable(true);
     SetIsDockable(true);
     m_frame = GetComponent <UIFrame>();
 }
Esempio n. 7
0
        void Logout()
        {
            isLogginOut = true;

            isLoggedOut = true;

            API.Bot.Overrides.FiniteStateMachine.Engine.StopEngine();
            logoutTick = Environment.TickCount;

            UIFrame.Update();

            UIFrame.Frame GameMenuFrame = UIFrame.GetFrameByName("GameMenuFrame");

            while (!GameMenuFrame.IsVisible)
            {
                MyWoW.Helpers.Keybindings.UseBinding("TOGGLEGAMEMENU");
                Thread.Sleep(1000);
                UIFrame.Update();
            }

            UIFrame.Frame GameMenuButtonLogout = UIFrame.GetFrameByName("GameMenuButtonLogout");
            GameMenuButtonLogout.LeftClick();

            lblStartingBot.Text    = "Logging out...";
            lblStartingBot.Visible = true;
            btnStartBotNow.Visible = true;
        }
Esempio n. 8
0
        /// <summary>
        /// (Protected) Adds a new <see cref="UIFrame"/> control on the page.
        /// </summary>
        /// <param name="x">X coordinate</param>
        /// <param name="y">Y coordinate</param>
        /// <param name="width">Width of the frame</param>
        /// <param name="height">Height of the frame</param>
        /// <param name="frameTile">The tile to use for the frame. Frame tile must follow one another on the tilemap (but can be on multiple rows) in this order: upper-left corner, upper-right corner, lower-left corner, lower-right corner, top border, left border, bottom border, right border</param>
        /// <param name="color">Color</param>
        /// <param name="fillTile">The tile to use as a background for the frame, or null if none</param>
        /// <param name="tilemap">Font tile tilemap</param>
        /// <returns>An UIFrame control</returns>
        protected UIFrame AddFrame(int x, int y, int width, int height, int frameTile, RGBColor color, int?fillTile = null, int tilemap = 0)
        {
            UIFrame control = AddControl <UIFrame>(x, y, color, tilemap);

            control.FrameTile = frameTile;
            control.Size      = new Dimension(width, height);
            control.FillTile  = fillTile;
            return(control);
        }
Esempio n. 9
0
 void Awake()
 {
     uiFrame = defSettings.CreateUIInstance();
     cam     = uiFrame.UICamera;
     Locator.Instance.GameEvents.gameStartMsg         += OnGameStart;
     Locator.Instance.GameEvents.gamePauseMsg         += OnGamePause;
     Locator.Instance.GameEvents.asteroidClickMsg     += OnAsteroidClick;
     Locator.Instance.GameEvents.asteroidDestroyedMsg += OnAsteroidDestroyed;
 }
Esempio n. 10
0
        private static void ParseQueryForUI(List <UIBase> attributes, IElement element, int[] layout)
        {
            int[] elmLayout = GetLayout(element.Style, layout);
            var   tmp       = new UIQuery()
            {
                x      = elmLayout[0],
                y      = elmLayout[1],
                width  = elmLayout[2],
                height = elmLayout[3]
            };

            tmp.Text       = element.TextContent;
            tmp.WidthLabel = element.GetWidth();
            tmp.NestedName = element.GetAttribute("nested-name");
            tmp.Owner      = element.GetAttribute("owner");
            tmp.QueryUID   = element.GetAttribute("query");

            if (tmp != null)
            {
                // find the frame it belongs to
                foreach (var item in attributes)
                {
                    var frame = item as UIFrame;
                    if (frame != null)
                    {
                        if (tmp.IsIn(frame))
                        {
                            frame.AddChild(tmp);
                            return;
                        }
                    }
                }

                UIFrame lastframe = null;

                foreach (var item in attributes)
                {
                    if (item.NestedName == "NO_FRAME")
                    {
                        lastframe = item as UIFrame;
                        break;
                    }
                }

                if (lastframe == null)
                {
                    lastframe = new UIFrame()
                    {
                        NestedName = "NO_FRAME", TabIndex = 99
                    };
                    attributes.Add(lastframe);
                }

                lastframe.AddChild(tmp);
            }
        }
Esempio n. 11
0
        public FloorSelectDialog(int tower, int screenWidth, int screenHeight, Happiness game)
        {
            m_Game = game;
            m_iTower = tower;

            int iCenterX = screenWidth >> 1;
            int iCenterY = screenHeight >> 1;
            m_FloorScrollPosition = 0;
            m_iSelectedFloor = -1;

            // Frame rect
            int width = (int)(Constants.FloorSelectDialog_Width * screenWidth);
            int height = (int)(Constants.FloorSelectDialog_Height * screenHeight);
            m_Rect = new Rectangle(iCenterX - (width >> 1), iCenterY - (height >> 1), width, height);

            // Title
            int iTopMargin = (int)(Constants.FloorSelectDialog_MarginTopBottom * screenHeight);
            string title = string.Format("{0} x {0}", tower + 3);
            m_Title = new UILabel(title, iCenterX, m_Rect.Top + iTopMargin, Color.Goldenrod, Assets.MenuFont, UILabel.XMode.Center);

            // Buttons
            m_iLeftRightMargin = (int)(Constants.FloorSelectDialog_MarginLeftRight * screenWidth);
            int navButtonTop = m_Rect.Top + iTopMargin;
            int navButtonWidth = (int)(Constants.FloorSelectDialog_NavButtonWidth * screenWidth);
            int navButtonHeight = (int)(Constants.FloorSelectDialog_NavButtonHeight * screenHeight);
            int lbButtonWidth = (int)(Constants.FloorSelectDialog_LBButtonWidth * screenWidth);
            int lbButtonHeight = (int)(Constants.FloorSelectDialog_LBButtonHeight * screenHeight);
            m_Buttons = new UIButton[3];
            m_Buttons[0] = new UIButton(0, "<", Assets.MenuFont, new Rectangle(m_Rect.Left + m_iLeftRightMargin, navButtonTop, navButtonWidth, navButtonHeight), Assets.ScrollBar);
            m_Buttons[1] = new UIButton(1, ">", Assets.MenuFont, new Rectangle(m_Rect.Right - (m_iLeftRightMargin + navButtonWidth), navButtonTop, navButtonWidth, navButtonHeight), Assets.ScrollBar);
            m_Buttons[2] = new UIButton(2, "Leaderboard", Assets.DialogFont, new Rectangle(m_Rect.Right - (m_iLeftRightMargin + lbButtonWidth), m_Rect.Bottom - (iTopMargin + lbButtonHeight), lbButtonWidth, lbButtonHeight), Assets.ScrollBar);
            m_Buttons[1].Enabled = false;
            m_Buttons[2].Enabled = false;

            // Floors
            int floorScrollWidth = (int)(Constants.FloorSelectDialog_FloorScrollWidth * screenWidth);
            int floorScrollTop = m_Title.PositionY + m_Title.Height + (iTopMargin >> 1);
            int floorScrollBottom = m_Rect.Bottom - iTopMargin;
            int floorScrollHeight = floorScrollBottom - floorScrollTop;
            int waitIconSize = (int)(Constants.FloorSelectDialog_WaitIconSize * screenHeight);
            int halfWaitIconSize = waitIconSize >> 1;
            m_FloorScrollRect = new Rectangle(iCenterX - (floorScrollWidth >> 1), floorScrollTop, floorScrollWidth, floorScrollHeight);
            m_FloorWaitRectangle = new Rectangle(iCenterX - halfWaitIconSize, iCenterY - halfWaitIconSize, waitIconSize, waitIconSize);

            m_FloorDataFetchText = new UILabel("Fetching Data...", iCenterX, m_FloorWaitRectangle.Bottom, Color.White, Assets.DialogFont, UILabel.XMode.Center);

            m_ScrollFrame = new UIFrame(5, m_FloorScrollRect);

            // Request the data from the server
            NetworkManager.Net.RequestTowerData(tower, true);

            m_iFloorSelectTutorialWidth = (int)(Constants.FloorSelectDialog_FloorSelectTutorialWidth * screenWidth);
            int floorPlayTutorialWidth = (int)(Constants.FloorSelectDialog_PlayTutorialWidth * screenWidth);
            m_Game.Tutorial.SetPieceData(TutorialSystem.TutorialPiece.FloorPlay, new Vector2(m_Buttons[1].Rect.Left, m_Buttons[1].Rect.Bottom), (float)-Math.PI / 4,
                                                                                 new Rectangle(m_FloorScrollRect.Right + m_iLeftRightMargin, m_Buttons[1].Rect.Bottom + m_Game.Tutorial.ArrowWidth, floorPlayTutorialWidth, 0), "Press this button to play the selected floor.", TutorialSystem.TutorialPiece.None, m_Buttons[1].Rect);
        }
Esempio n. 12
0
    private void Awake()
    {
        // Assign Globals
        uiFrame   = _uiFrame;
        discovery = _discovery;
        guideSync = _guideSync;
        POIpositionScalingFactor = _POIpositionScalingFactor;
        cache = new Cache();

        Signals.Get <ShowContentSignal>().AddListener(OnShowContent);
    }
Esempio n. 13
0
        /*
         * Button
         * Pressable clip button
         */
        public static ClipButtonAttachment CreateClipButton(InstrumentClip clip, UIFrame.AnchorLocation anchor)
        {
            GameObject button = Instantiate(Instance.clipButtonPrefab) as GameObject;

            ClipButtonAttachment attach = button.GetComponent <ClipButtonAttachment>();

            attach.Init(clip);

            UIFrame frame = button.GetComponent <UIFrame>();

            frame.SetAnchor(anchor);

            return(attach);
        }
 public void InstantiateAndRegisterScreens(UIFrame frame)
 {
     uiFrame = frame;
     InstantiateAndRegisterScreen(guideContentWindowController, guideContentWindow);
     InstantiateAndRegisterScreen(visitorContentWindowController, visitorContentWindow);
     InstantiateAndRegisterScreen(profileNameWindowController, profileNameWindow);
     InstantiateAndRegisterScreen(profileEditWindowController, profileEditWindow);
     InstantiateAndRegisterScreen(guideSetupWindowController, guideSetupWindow);
     InstantiateAndRegisterScreen(loadingWindowController, loadingWindow);
     InstantiateAndRegisterScreen(networkConfigurationWindowController, networkSettingsWindow);
     InstantiateAndRegisterScreen(modeSelectionWindowController, modeSelectionWindow);
     InstantiateAndRegisterScreen(visitorSetupWindowController, visitorSetupWindow);
     InstantiateAndRegisterScreen(explorerWindowController, explorerWindow);
 }
Esempio n. 15
0
        /*
         * Slider
         * A controllable parameter slider
         */
        public static SliderAttachment CreateSlider(BaseInstrumentParam param, UIFrame.AnchorLocation anchor)
        {
            GameObject slider = Instantiate(Instance.sliderPrefab) as GameObject;

            UIFrame frame = slider.GetComponent <UIFrame>();

            //frame.SetAnchor(UIFrame.AnchorLocation.TOP_LEFT);
            frame.SetAnchor(anchor);

            SliderAttachment attach = slider.GetComponent <SliderAttachment>();

            attach.Init(param);

            return(attach);
        }
Esempio n. 16
0
        public FishNet(Texture2D texture, Map map, Vector2 position, Point size)
            : base(map, position, texture, size, "fishnet")
        {
            this.texture     = texture;
            this.map         = map;
            this.position    = position;
            this.showBoard   = false;
            this.showBanner  = false;
            this.hasAddBtn   = false;
            this.bannerFish  = Fish.Null;
            this.detailBoard = new UIFrame(new Point(0, 47), new Vector2((Define.windowWidth - 6 * Define.UnitOFpixel) / 2, (Define.windowHeight - 10 * Define.UnitOFpixel) / 2), new Rectangle(0, 0, 6 * Define.UnitOFpixel, 10 * Define.UnitOFpixel), 0.8f, Color.White);

            this.renderRectangle = new Rectangle(288, 1248, 3 * Define.UnitOFpixel, 3 * Define.UnitOFpixel);
            this.fishList        = new List <Fish>();
        }
Esempio n. 17
0
        private static void ParseAttributesForUI(List <UIBase> attributes, List <UIBase> attributesNotIn, IElement element, int[] layout)
        {
            int[] lay = GetLayout(element.Style, layout);

            if (element.TagName == "DIV")
            {
                // Test if the element could be a comos frame.
                if (element.Style.BorderRadius == "4px")
                {
                    // This is a frame
                    attributes.Add(new UIFrame()
                    {
                        x      = lay[0],
                        y      = lay[1],
                        width  = lay[2],
                        height = lay[3]
                    });
                }
                // Test if element is label defining the frame.
                else if (element.Id != null && element.Id.StartsWith("Border"))
                {
                    // This defines a text of a frame
                    // This text is always after the border definition.
                    // => Get the matching UIFrame (is last in list)
                    UIFrame frame = (UIFrame)attributes.Last();
                    frame.Text = element.TextContent;
                }
                // Else the children elements of this div define a specific tab control attribute
                else if (element.Children.Count() == 1)
                {
                    ParseAttributeForUI(attributes, attributesNotIn, element.Children[0], lay);
                }
                else if (element.ClassName == "SUIQuery")
                {
                    // query spec
                    ParseQueryForUI(attributes, element, lay);
                }
                else
                {
                    Debug.Assert(false); // All elements should be divs
                }
            }
            else
            {
                Debug.Assert(false); // All elements should be divs
            }
        }
Esempio n. 18
0
        //Funcion para extraer información de atributos
        private void processDisplayElement(UIBase myAttribute)
        {
            if (myAttribute.ContainsNestedName("Z10T00002.Z001Q"))      //Si el atributo es una query de Arbol de Fallos, parseo los datos
            {
                this.isPEMActivity = true;
                UIFrame queryFrame       = (UIFrame)myAttribute;
                UIQuery arbolFallasQuery = (UIQuery)queryFrame.Children[0];
                CRow[]  myRows           = arbolFallasQuery.Result.Rows;
                foreach (CRow line in myRows)
                {
                    this.FailureTreeFullLabels.Add(line.Items.ElementAt(0).Text);     //la columna cero es el fullLabel
                    this.FailureTreeDescriptions.Add(line.Items.ElementAt(1).Text);   //la columna uno es la descripción
                }

                parseFailureTreeInfo();
            }
        }
Esempio n. 19
0
    public void GridSetupComplete()
    {
        if (PlayerCameraObject != null)
        {
            Vector2 topLeftTileWorldPos = Grid.GetTileWorldCentre(new Vector2Int(0, 0));
            PlayerCameraObject.transform.position = new Vector3(topLeftTileWorldPos.x, topLeftTileWorldPos.y, -1.0f);
            Camera playerCamera = PlayerCameraObject.GetComponent <Camera>();
            ShowCamFeed(PlayerCameraObject);

            FrameTile playerFrameTile = PlayerCameraObject.GetComponentInChildren <FrameTile>();
            if (playerFrameTile != null)
            {
                playerFrameTile.Show();
            }

            UIFrame playerCamFrame = CurrentFrameObject.GetComponent <UIFrame>();
            if (playerCamFrame != null)
            {
                playerCamFrame.display = true;
            }
        }

        if (TargetCamObject != null)
        {
            Vector3 targetPos = ChooseTargetPosition();
            TargetCamObject.transform.position = targetPos;
            TargetCamObject.transform.rotation = Quaternion.Euler(0.0f, 0.0f, rotationOptions[Random.Range(0, numRotationOptions)]);
            Camera targetCamera = TargetCamObject.GetComponent <Camera>();
            ShowCamFeed(TargetCamObject);

            UIFrame targetCamFrame = TargetFrameObject.GetComponent <UIFrame>();
            if (targetCamFrame != null)
            {
                targetCamFrame.display = true;
            }
        }

        if (InstructionsObject != null)
        {
            InstructionsObject.GetComponent <Instructions>().display = true;
        }

        InputHandler.Instance.UpdatePlayerForButtonsState();

        setupComplete = true;
    }
Esempio n. 20
0
        protected override void OnInitialize(object[] parameters)
        {
            UIFrame frame = AddFrame(
                0, 0, UI.Game.Renderer.TileCount.Width, UI.Game.Renderer.TileCount.Height,
                (int)TileID.Frame, RGBColor.Goldenrod);

            frame.ZOrder = 1;

            AddLabel(2, 2, "AUDIO DEMO", (int)TileID.Font, RGBColor.PaleGoldenrod);

            AddLabel(2, 4, "Please select an option:", (int)TileID.Font, RGBColor.PaleGoldenrod);
            UIMenu menu = AddMenu(2, 6, (int)TileID.Font, RGBColor.White);

            menu.SelectedColor = RGBColor.Yellow;
            menu.AddMenuItem("Play an explosion");
            menu.AddMenuItem("Play an fireball sound");
            menu.AddMenuItem("Play a looping fireball sound");
            menu.OnSelectedItemValidated += OnMenuItemValidated;

            AddLabel(2, UI.Game.Renderer.TileCount.Height - 3, "[F]: fullscreen toggle, [ESC]: back", (int)TileID.Font, RGBColor.PaleGoldenrod);
        }
Esempio n. 21
0
        public void ThreadMain()
        {
            while (true)
            {
                if (chkPauseWhenChat.Checked)
                {
                    UIFrame.Frame chatEditbox = UIFrame.GetFrameByName("ChatFrame1EditBox");
                    if (Keyboard.IsChatboxOpened && !isChatOpen && chatEditbox != null && chatEditbox.IsVisible && !Mailbox.IsMailboxOpen)
                    {
                        string currentState = API.Bot.Overrides.FiniteStateMachine.Engine.CurrentState;

                        string[] disableChatStates = new string[] { "Moving", "Combat", "Loot", "SkinAround", "Mount" };

                        if (API.Bot.Overrides.FiniteStateMachine.Engine.Running && disableChatStates.Contains(currentState))
                        {
                            // Pause
                            Log("Chatting - Pausing bot");
                            isChatOpen = true;
                            //MyWoW.Helpers.Movements.StopMove();
                            API.Bot.Stop();
                            Thread.Sleep(1000);
                        }
                    }
                    else if (!Keyboard.IsChatboxOpened && isChatOpen)
                    {
                        // unpause
                        Log("Done chatting - Resuming bot");
                        isChatOpen = false;
                        API.Bot.Start();
                        Thread.Sleep(1000);
                        if (!API.Bot.Overrides.FiniteStateMachine.Engine.Running)
                        {
                            API.Bot.Overrides.FiniteStateMachine.Engine.StartEngine();
                        }
                    }
                }
                Thread.Sleep(10);
            }
        }
Esempio n. 22
0
    void LayoutCameras()
    {
        float screenAspect = (float)Screen.height / (float)Screen.width;

        if (GridCameraObject != null)
        {
            GridCameraObject.transform.position = new Vector3(Grid.GridWidth * (Grid.TileSideLength - 1), Grid.GridHeight * (Grid.TileSideLength - 1), -2.0f) * 0.5f;
            Camera gridCamera = GridCameraObject.GetComponent <Camera>();
            gridCamera.orthographicSize = 6;
            gridCamera.rect             = new Rect(0.0f, 0.2f, 1.0f, MainGridHeightProportion);
        }
        float panelCamWidth       = (1.0f - MainGridHeightProportion) * screenAspect;
        float textWidthProportion = 0.3f;

        if (TargetCamObject != null)
        {
            UIFrame targetCamFrame = TargetFrameObject.GetComponent <UIFrame>();
            if (targetCamFrame != null)
            {
                targetCamFrame.panelFrameCentre     = new Vector2(1.0f - panelCamWidth * 0.5f, MainGridHeightProportion + (1.0f - MainGridHeightProportion) * 0.5f);
                targetCamFrame.sideLengthProportion = 1.0f - MainGridHeightProportion;
            }
            Camera targetCamera = TargetCamObject.GetComponent <Camera>();
            targetCamera.rect = new Rect(1.0f - panelCamWidth, 0.0f, panelCamWidth, 1.0f - MainGridHeightProportion);
            HideCamFeed(TargetCamObject);
        }
        if (PlayerCameraObject != null)
        {
            UIFrame playerCamFrame = CurrentFrameObject.GetComponent <UIFrame>();
            if (playerCamFrame != null)
            {
                playerCamFrame.panelFrameCentre     = new Vector2(panelCamWidth * 0.5f, MainGridHeightProportion + (1.0f - MainGridHeightProportion) * 0.5f);
                playerCamFrame.sideLengthProportion = 1.0f - MainGridHeightProportion;
            }
            Camera playerCamera = PlayerCameraObject.GetComponent <Camera>();
            playerCamera.rect = new Rect(0.0f, 0.0f, panelCamWidth, 1.0f - MainGridHeightProportion);
            HideCamFeed(PlayerCameraObject);
        }
    }
Esempio n. 23
0
        public FishingSystem(Map map)
        {
            this.map = map;

            Random ran = new Random();

            this.step = 1;
            this.fishingBarPercent     = 0;
            this.fishingProcessBack    = new UIFrame(new Point(7, 6), new Vector2(GlobalController.Player.RenderPosition.X - Define.UnitOFpixel, GlobalController.Player.RenderPosition.Y - Define.UnitOFpixel), new Rectangle(0, 0, 3 * Define.UnitOFpixel, Define.UnitOFpixel), 0.99f, Color.White);
            this.fishingProcessBar     = new UIFrame(new Point(7, 7), new Vector2(GlobalController.Player.RenderPosition.X - Define.UnitOFpixel, GlobalController.Player.RenderPosition.Y - Define.UnitOFpixel), new Rectangle(0, 0, 3 * Define.UnitOFpixel, Define.UnitOFpixel), 1f, Color.White);
            this.fishingProcessBarRect = new Rectangle(7 * Define.UnitOFpixel + 10, 7 * Define.UnitOFpixel + 8, 3 * Define.UnitOFpixel, 8);
            this.pressDirect           = true;
            this.fishLine                   = new List <Vector2>();
            this.hookRunLine                = new List <Vector2>();
            iLine                           = 0;
            hookAnimTime                    = 0;
            hookFrame                       = new Point(0, 24);
            this.hookRect                   = new Rectangle(0, 0, Define.UnitOFpixel, Define.UnitOFpixel);
            randomGetTime                   = ran.Next(2000, 8000);
            waitTime                        = 0;
            gettingFish                     = false;
            getWaitingTime                  = 0;
            this.fishingModelBarPercent     = 0;
            this.fishingModelProcessBack    = new UIFrame(new Point(12, 7), new Vector2(GlobalController.Player.RenderPosition.X - Define.UnitOFpixel, GlobalController.Player.RenderPosition.Y - Define.UnitOFpixel), new Rectangle(0, 0, Define.UnitOFpixel, 3 * Define.UnitOFpixel), 0.99f, Color.White);
            this.fishingModelProcessBar     = new UIFrame(new Point(11, 7), new Vector2(GlobalController.Player.RenderPosition.X - Define.UnitOFpixel, GlobalController.Player.RenderPosition.Y - Define.UnitOFpixel), new Rectangle(0, 0, Define.UnitOFpixel, 3 * Define.UnitOFpixel), 1f, Color.White);
            this.fishingModelProcessBarRect = new Rectangle(11 * Define.UnitOFpixel + 1, 7 * Define.UnitOFpixel + 1, 8, 3 * Define.UnitOFpixel);
            fishEscapeDirect                = -1;
            fishEscapeStrength              = 0;
            fishStengthDurTime              = 0;
            fishStengthTime                 = 0;
            strengthAccelerate              = 0;
            keyStrength                     = 0;
            strength                        = 0;
            direct                          = -1;
            fishLineStrength                = 0;
            playerStrength                  = 0;
            standardHookPos                 = new Vector2(-1, -1);
        }
Esempio n. 24
0
 public void Setup()
 {
     uiFrame = UIFrameUtility.CreateDefaultUIFrame();
 }
Esempio n. 25
0
        public void SetInstructions(Rectangle rect, string text, bool okButton)
        {
            m_Lines = Happiness.FormatLines(rect.Width - (m_iTextMarginLeftRight * 2), text, Assets.HelpFont);

            int buttonHeight = okButton ? m_iButtonHeight + m_iTextMarginTopBottom : 0;
            int autoHeight = ((m_Lines.Length + 1) * m_iTextLineHeight) + buttonHeight;
            m_InstructionRect = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height == 0 ? autoHeight : rect.Height);
            m_InstructionFrame = new UIFrame(1, m_InstructionRect);

            if( okButton )
                m_OKButton = new UIButton(0, "OK", Assets.HelpFont, new Rectangle(m_InstructionRect.Left + (m_InstructionRect.Width >> 1) - (m_iButtonWidth >> 1), m_InstructionRect.Bottom - (m_iButtonHeight + m_iTextMarginTopBottom), m_iButtonWidth, m_iButtonHeight), Assets.ScrollBar);
            else
                m_OKButton = null;
        }
Esempio n. 26
0
 // Start is called before the first frame update
 void Awake()
 {
     uiFrame       = UIFrame.Instance;
     rectTransform = GetComponent <RectTransform>();
 }
Esempio n. 27
0
 public void TearDown()
 {
     Object.Destroy(uiFrame.gameObject);
     uiFrame = null;
 }
Esempio n. 28
0
 void Start()
 {
     m_fill  = transform.FindChild("sliderFill").gameObject;
     m_frame = GetComponent <UIFrame>();
 }
Esempio n. 29
0
 private void Awake()
 {
     uiFrame = UIFrame.Instance;
 }
Esempio n. 30
0
 private void Awake()
 {
     uiFrame    = UIFrame.Instance;
     background = GetComponent <Image>();
 }
 protected void InitializeUI()
 {
     UIFrame = uiSettings.CreateUIInstance();
 }
Esempio n. 32
0
        public static UIBase[] ParseAttributesForUI(string html)
        {
            var options = Configuration.Default.WithCss();
            var parser  = new HtmlParser(options);

            AngleSharp.Dom.Html.IHtmlDocument doc = null;

            try
            {
                doc = parser.Parse(html);
            }
            catch (Exception)
            {
                return(null);
            }

            List <UIBase> attributes      = new List <UIBase>();
            List <UIBase> attributesNotIn = new List <UIBase>();

            int[] layout = { 0, 0, 0, 0 };

            // Get all the elements as a big flat list in list attributes.
            foreach (var item in doc.Body.Children)
            {
                ParseAttributesForUI(attributes, attributesNotIn, item, layout);
            }

            // try to find again
            foreach (var spec in attributesNotIn)
            {
                foreach (var item in attributes)
                {
                    var frame = item as UIFrame;
                    if (frame != null)
                    {
                        if (spec.IsIn(frame))
                        {
                            frame.AddChild(spec);
                        }
                    }
                }
            }

            // Group now all the root franes,
            List <UIFrame> rootframes = new List <UIFrame>();

            foreach (var candidate in attributes)
            {
                UIFrame frame_candidate = candidate as UIFrame;
                if (frame_candidate == null)
                {
                    continue;
                }
                foreach (var attribute in attributes)
                {
                    UIFrame frame = attribute as UIFrame;
                    if (frame == null)
                    {
                        continue; // not a frame so can not be root.
                    }
                    if (attribute == frame_candidate)
                    {
                        continue;                    // Is same object no need to test
                    }
                    if (frame_candidate.IsIn(frame)) // Test if the frame_candidate is part of
                    {                                //   this frame. If it is it can not be a root frame.
                        frame_candidate = null;
                        break;
                    }
                }
                if (frame_candidate != null)
                {
                    // Is a root frame
                    rootframes.Add(frame_candidate);
                }
            }

            // Now we have all the root frames.
            // remove thses frames from the attributes list
            foreach (var frame in rootframes)
            {
                attributes.Remove(frame);
            }

            // Now group all the remaining elements in the rootframes.
            UIBase elm = attributes.FirstOrDefault();

            while (elm != null)
            {
                foreach (var attribute in rootframes)
                {
                    UIFrame frame = attribute as UIFrame; // Could also be an none frame element as root.
                    if (frame == null)
                    {
                        continue;
                    }
                    if (elm.IsIn(frame))
                    {
                        frame.AddChild(elm);
                        attributes.Remove(elm);
                        elm = null;
                        break;
                    }
                }
                if (elm != null) // is a none frame that is a root.
                {
                    rootframes.Add((UIFrame)elm);
                    attributes.Remove(elm);
                }
                elm = attributes.FirstOrDefault();
            }

            UIFrame        noframe  = null;
            List <UIFrame> toremove = new List <UIFrame>();

            foreach (var item in rootframes)
            {
                UIFrame frame = item as UIFrame;
                if (frame.Children == null || frame.Children.Count() == 0)
                {
                    toremove.Add(item);
                }
                //rootframes.Remove(item);

                if (frame.NestedName == "NO_FRAME")
                {
                    noframe = frame;
                }
            }

            foreach (var item in toremove)
            {
                rootframes.Remove(item);
            }

            //rootframes.Remove(noframe);
            //rootframes.Add(noframe);

            //rootframes = rootframes.OrderBy(x => x.y).ToList();

            return(rootframes.OrderBy(x => x.y).ToArray());

            //return rootframes.ToArray();
        }