예제 #1
0
 void BackButtonPress(UIElement button)
 {
     if (m_CurrentItem.Parent == null)
     {
         return;                               //shouldn't ever be...
     }
     m_CurrentItem = m_CurrentItem.Parent;
     HITVM.Get().PlaySoundEvent(UISounds.PieMenuSelect);
     RenderMenu();
 }
예제 #2
0
        private void PieButtonClick(UIElement button)
        {
            int index = m_PieButtons.IndexOf((UIButton)button);

            if (index == -1)
            {
                return;              //bail! this isn't meant to happen!
            }
            var action = m_CurrentItem.Children.ElementAt(index).Value;

            HITVM.Get().PlaySoundEvent(UISounds.PieMenuSelect);

            if (action.Category)
            {
                m_CurrentItem = action;
                RenderMenu();
            }
            else
            {
                if (m_Obj == m_Parent.GotoObject)
                {
                    m_Parent.vm.SendCommand(new VMNetGotoCmd
                    {
                        Interaction = action.ID,
                        ActorUID    = m_Caller.PersistID,
                        x           = m_Obj.Position.x,
                        y           = m_Obj.Position.y,
                        level       = m_Obj.Position.Level
                    });
                }
                else
                {
                    m_Parent.vm.SendCommand(new VMNetInteractionCmd
                    {
                        Interaction = action.ID,
                        ActorUID    = m_Caller.PersistID,
                        CalleeID    = m_Obj.ObjectID,
                        Param0      = action.Param0
                    });
                }
                HITVM.Get().PlaySoundEvent(UISounds.QueueAdd);
                m_Parent.ClosePie();
            }
        }
예제 #3
0
        public UIPieMenu(List <VMPieMenuInteraction> pie, VMEntity obj, VMEntity caller, UILotControl parent)
        {
            if (FSOEnvironment.UIZoomFactor > 1.33f)
            {
                ScaleX = ScaleY = FSOEnvironment.UIZoomFactor * 0.75f;
            }
            TrueScale        = ScaleX * FSOEnvironment.DPIScaleFactor;
            m_PieButtons     = new List <UIButton>();
            this.m_Obj       = obj;
            this.m_Caller    = caller;
            this.m_Parent    = parent;
            this.ButtonStyle = new TextStyle
            {
                Font          = GameFacade.MainFont,
                VFont         = GameFacade.VectorFont,
                Size          = 12,
                Color         = new Color(0xA5, 0xC3, 0xD6),
                SelectedColor = new Color(0x00, 0xFF, 0xFF),
                CursorColor   = new Color(255, 255, 255)
            };

            HighlightStyle       = ButtonStyle.Clone();
            HighlightStyle.Color = Color.Yellow;

            lerpSpeed = 0.125f * (60.0f / FSOEnvironment.RefreshRate);
            m_Bg      = new UIImage(TextureGenerator.GetPieBG(GameFacade.GraphicsDevice));
            m_Bg.SetSize(0, 0); //is scaled up later
            this.AddAt(0, m_Bg);

            m_PieTree = new UIPieMenuItem()
            {
                Category = true
            };

            for (int i = 0; i < pie.Count; i++)
            {
                string[] depth = (pie[i].Name == null)?new string[] { "???" } :pie[i].Name.Split('/');

                var category = m_PieTree;                  //set category to root
                for (int j = 0; j < depth.Length - 1; j++) //iterate through categories
                {
                    if (category.ChildrenByName.ContainsKey(depth[j]))
                    {
                        category = category.ChildrenByName[depth[j]];
                    }
                    else
                    {
                        var newCat = new UIPieMenuItem()
                        {
                            Category = true,
                            Name     = depth[j],
                            Parent   = category
                        };
                        category.Children.Add(newCat);
                        category.ChildrenByName[depth[j]] = newCat;
                        category = newCat;
                    }
                }
                //we are in the category, put the interaction in here;

                var name     = depth[depth.Length - 1];
                var semiInd  = name.LastIndexOf(';');
                int colorMod = 0;
                if (semiInd > -1)
                {
                    int.TryParse(name.Substring(semiInd + 1), out colorMod);
                    name = name.Substring(0, semiInd);
                }

                var item = new UIPieMenuItem()
                {
                    Category = false,
                    Name     = name,
                    ColorMod = colorMod,
                    ID       = pie[i].ID,
                    Param0   = pie[i].Param0,
                    Global   = pie[i].Global
                };
                category.Children.Add(item);
                category.ChildrenByName[item.Name] = item;
            }

            m_CurrentItem = m_PieTree;
            m_PieButtons  = new List <UIButton>();
            RenderMenu();

            VMAvatar Avatar = (VMAvatar)caller;

            m_Head = new SimAvatar(Avatar.Avatar); //talk about confusing...
            m_Head.StripAllButHead();

            initSimHead();
        }
예제 #4
0
        private void PieButtonClick(UIElement button)
        {
            int index = m_PieButtons.IndexOf((UIButton)button);

            if (index == -1)
            {
                return;              //bail! this isn't meant to happen!
            }
            var action = m_CurrentItem.Children.ElementAt(index);

            HITVM.Get().PlaySoundEvent(UISounds.PieMenuSelect);

            if (action.Category)
            {
                m_CurrentItem = action;
                RenderMenu();
            }
            else
            {
                if (m_Obj == m_Parent.GotoObject)
                {
                    m_Parent.vm.SendCommand(new VMNetGotoCmd
                    {
                        Interaction = action.ID,
                        ActorUID    = m_Caller.PersistID,
                        x           = m_Obj.Position.x,
                        y           = m_Obj.Position.y,
                        level       = m_Obj.Position.Level
                    });
                }
                else
                {
                    if (Debug.IDEHook.IDE != null && ShiftDown)
                    {
                        if (m_Obj.TreeTable.InteractionByIndex.ContainsKey((uint)action.ID))
                        {
                            var    act      = m_Obj.TreeTable.InteractionByIndex[(uint)action.ID];
                            ushort ActionID = act.ActionFunction;

                            var function = m_Obj.GetBHAVWithOwner(ActionID, m_Parent.vm.Context);

                            Debug.IDEHook.IDE.IDEOpenBHAV(
                                function.bhav,
                                m_Obj.Object
                                );
                        }
                    }
                    else
                    {
                        m_Parent.vm.SendCommand(new VMNetInteractionCmd
                        {
                            Interaction = action.ID,
                            ActorUID    = m_Caller.PersistID,
                            CalleeID    = m_Obj.ObjectID,
                            Param0      = action.Param0,
                            Global      = action.Global
                        });
                    }
                }
                HITVM.Get().PlaySoundEvent(UISounds.QueueAdd);
                m_Parent.ClosePie();
            }
        }
예제 #5
0
        public UIPieMenu(List <VMPieMenuInteraction> pie, VMEntity obj, VMEntity caller, UILotControl parent)
        {
            if (FSOEnvironment.UIZoomFactor > 1.33f)
            {
                ScaleX = ScaleY = FSOEnvironment.UIZoomFactor * 0.75f;
            }
            TrueScale        = ScaleX * FSOEnvironment.DPIScaleFactor;
            m_PieButtons     = new List <UIButton>();
            this.m_Obj       = obj;
            this.m_Caller    = caller;
            this.m_Parent    = parent;
            this.ButtonStyle = new TextStyle
            {
                Font          = GameFacade.MainFont,
                Size          = 12,
                Color         = new Color(0xA5, 0xC3, 0xD6),
                SelectedColor = new Color(0x00, 0xFF, 0xFF),
                CursorColor   = new Color(255, 255, 255)
            };

            m_Bg = new UIImage(TextureGenerator.GetPieBG(GameFacade.GraphicsDevice));
            m_Bg.SetSize(0, 0); //is scaled up later
            this.AddAt(0, m_Bg);

            m_PieTree = new UIPieMenuItem()
            {
                Category = true
            };

            for (int i = 0; i < pie.Count; i++)
            {
                string[] depth = (pie[i].Name == null)?new string[] { "???" } :pie[i].Name.Split('/');

                var category = m_PieTree;                  //set category to root
                for (int j = 0; j < depth.Length - 1; j++) //iterate through categories
                {
                    if (category.Children.ContainsKey(depth[j]))
                    {
                        category = category.Children[depth[j]];
                    }
                    else
                    {
                        var newCat = new UIPieMenuItem()
                        {
                            Category = true,
                            Name     = depth[j],
                            Parent   = category
                        };
                        category.Children.Add(depth[j], newCat);
                        category = newCat;
                    }
                }
                //we are in the category, put the interaction in here;

                var item = new UIPieMenuItem()
                {
                    Category = false,
                    Name     = depth[depth.Length - 1],
                    ID       = pie[i].ID,
                    Param0   = pie[i].Param0
                };
                if (!category.Children.ContainsKey(item.Name))
                {
                    category.Children.Add(item.Name, item);
                }
            }

            m_CurrentItem = m_PieTree;
            m_PieButtons  = new List <UIButton>();
            RenderMenu();

            VMAvatar Avatar = (VMAvatar)caller;

            m_Head = new SimAvatar(Avatar.Avatar); //talk about confusing...
            m_Head.StripAllButHead();

            initSimHead();
        }
예제 #6
0
        public UIPieMenu(List<VMPieMenuInteraction> pie, VMEntity obj, VMEntity caller, UILotControl parent)
        {
            if (FSOEnvironment.UIZoomFactor>1.33f) ScaleX = ScaleY = FSOEnvironment.UIZoomFactor*0.75f;
            TrueScale = ScaleX *FSOEnvironment.DPIScaleFactor;
            m_PieButtons = new List<UIButton>();
            this.m_Obj = obj;
            this.m_Caller = caller;
            this.m_Parent = parent;
            this.ButtonStyle = new TextStyle
            {
                Font = GameFacade.MainFont,
                Size = 12,
                Color = new Color(0xA5, 0xC3, 0xD6),
                SelectedColor = new Color(0x00, 0xFF, 0xFF),
                CursorColor = new Color(255, 255, 255)
            };

            m_Bg = new UIImage(TextureGenerator.GetPieBG(GameFacade.GraphicsDevice));
            m_Bg.SetSize(0, 0); //is scaled up later
            this.AddAt(0, m_Bg);

            m_PieTree = new UIPieMenuItem()
            {
                Category = true
            };

            for (int i = 0; i < pie.Count; i++)
            {
                string[] depth = (pie[i].Name == null)?new string[] { "???" } :pie[i].Name.Split('/');

                var category = m_PieTree; //set category to root
                for (int j = 0; j < depth.Length-1; j++) //iterate through categories
                {
                    if (category.Children.ContainsKey(depth[j]))
                    {
                        category = category.Children[depth[j]];
                    }
                    else
                    {
                        var newCat = new UIPieMenuItem()
                        {
                            Category = true,
                            Name = depth[j],
                            Parent = category
                        };
                        category.Children.Add(depth[j], newCat);
                        category = newCat;
                    }
                }
                //we are in the category, put the interaction in here;

                var item = new UIPieMenuItem()
                {
                    Category = false,
                    Name = depth[depth.Length - 1],
                    ID = pie[i].ID,
                    Param0 = pie[i].Param0
                };
                if (!category.Children.ContainsKey(item.Name)) category.Children.Add(item.Name, item);
            }

            m_CurrentItem = m_PieTree;
            m_PieButtons = new List<UIButton>();
            RenderMenu();

            VMAvatar Avatar = (VMAvatar)caller;
            m_Head = new SimAvatar(Avatar.Avatar); //talk about confusing...
            m_Head.StripAllButHead();

            initSimHead();
        }
예제 #7
0
        private void PieButtonClick(UIElement button)
        {
            int index = m_PieButtons.IndexOf((UIButton)button);
            if (index == -1) return; //bail! this isn't meant to happen!
            var action = m_CurrentItem.Children.ElementAt(index).Value;
            HITVM.Get().PlaySoundEvent(UISounds.PieMenuSelect);

            if (action.Category) {
                m_CurrentItem = action;
                RenderMenu();
            } else {

                if (m_Obj == m_Parent.GotoObject)
                {
                    m_Parent.vm.SendCommand(new VMNetGotoCmd
                    {
                        Interaction = action.ID,
                        ActorUID = m_Caller.PersistID,
                        x = m_Obj.Position.x,
                        y = m_Obj.Position.y,
                        level = m_Obj.Position.Level
                    });
                }
                else
                {
                    if (Debug.IDEHook.IDE != null && ShiftDown) {
                        if (m_Obj.TreeTable.InteractionByIndex.ContainsKey((uint)action.ID)) {
                            var act = m_Obj.TreeTable.InteractionByIndex[(uint)action.ID];
                            ushort ActionID = act.ActionFunction;

                            var function = m_Obj.GetBHAVWithOwner(ActionID, m_Parent.vm.Context);

                            Debug.IDEHook.IDE.IDEOpenBHAV(
                                function.bhav,
                                m_Obj.Object
                            );
                        }
                    }
                    else
                    {
                        m_Parent.vm.SendCommand(new VMNetInteractionCmd
                        {
                            Interaction = action.ID,
                            ActorUID = m_Caller.PersistID,
                            CalleeID = m_Obj.ObjectID,
                            Param0 = action.Param0
                        });
                    }
                }
                HITVM.Get().PlaySoundEvent(UISounds.QueueAdd);
                m_Parent.ClosePie();

            }
        }
예제 #8
0
 void BackButtonPress(UIElement button)
 {
     if (m_CurrentItem.Parent == null) return; //shouldn't ever be...
     m_CurrentItem = m_CurrentItem.Parent;
     HITVM.Get().PlaySoundEvent(UISounds.PieMenuSelect);
     RenderMenu();
 }