Exemplo n.º 1
0
        internal void Add(DialogType id, NpcFunction.FunctionCallback callback)
        {
            ButtonCallback mycallback = new ButtonCallback();

            mycallback.callback = callback;
            __callbacks.Add((byte)id, mycallback);
        }
Exemplo n.º 2
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     base.InitChildren(parent, host, MyButtonCallback);
     if (u0 != 0.0 || v0 != 0.0 || (u1 != 0.0 || v1 != 0.0))
     {
         Init(host, ImageSrc, u0, v0, u1, v1, over_u0, over_v0, over_u1, over_v1, down_u0, down_v0, down_u1, down_v1, disabled_u0, disabled_v0, disabled_u1, disabled_v1);
         SetGrowableWidth(leftbordersize_pixels, rightbordersize_pixels, minimum_width_pixels);
         SetGrowableHeight(topbordersize_pixels, bottombordersize_pixels, minimum_height_pixels);
     }
     else
     {
         if (!parent.IsComboBoxElement() && !parent.IsListBoxElement())
         {
             u0          = 896f;
             v0          = 192f;
             u1          = 959f;
             v1          = byte.MaxValue;
             over_u0     = 896f;
             over_v0     = 256f;
             over_u1     = 959f;
             over_v1     = 319f;
             down_u0     = 896f;
             down_v0     = 320f;
             down_u1     = 959f;
             down_v1     = 383f;
             disabled_u0 = 960f;
             disabled_v0 = 128f;
             disabled_u1 = 1023f;
             disabled_v1 = 191f;
             Init(host, "guicontrols", u0, v0, u1, v1, over_u0, over_v0, over_u1, over_v1, down_u0, down_v0, down_u1, down_v1, disabled_u0, disabled_v0, disabled_u1, disabled_v1);
         }
         SetGrowableWidth(4, 4, 12);
         SetGrowableHeight(4, 4, 12);
     }
 }
Exemplo n.º 3
0
 public void SetupTranslated(string fieldName, ButtonCallback callback)
 {
     _key                    = fieldName;
     _name.text              = Localization.Translate(fieldName);;
     _callback               = callback;
     Localization.OnUpdated += OnUpdated;
 }
Exemplo n.º 4
0
    public ButtonListener RegisterReleaseListener(string buttonName, int order, ButtonCallback callback)
    {
        ButtonListener listener = new ButtonListener(buttonName, order, callback);

        AddListenerToQueue <ButtonListener, ButtonCallback>(registeredReleaseListeners, listener);
        return(listener);
    }
 //-------------------------------------------------------------------------------------------------------------
 // Sets the button callback.  See Exports.cs for details.
 //      -funcPtr:   The C++ function pointer.
 //-------------------------------------------------------------------------------------------------------------
 public void SetButtonCallback(IntPtr funcPtr)
 {
     // The call to GetDelegateForFunctionPointer() will effectively cast the raw C++ function pointer to the
     // delegate type declared above.  See here for details on how this works:
     // https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.getdelegateforfunctionpointer?view=netframework-4.7.2
     m_buttonCallback = Marshal.GetDelegateForFunctionPointer <ButtonCallback>(funcPtr);
 }
Exemplo n.º 6
0
 public Button(String name, ConsoleKey Key, ButtonCallback CallBack, bool Switchable = false)
 {
     this.Switchable = Switchable;
     this.name       = name;
     this.CallBack   = CallBack;
     this.key        = Key;
 }
Exemplo n.º 7
0
        internal override List <ButtonCallback> GetButtons()
        {
            List <ButtonCallback> buttons = new List <ButtonCallback>();
            ButtonCallback        create  = new ButtonCallback("Crear nuevo", Create_callback);

            buttons.Add(create);
            return(buttons);
        }
Exemplo n.º 8
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     base.InitChildren(parent, host, MyButtonCallback);
     this.host = host;
     NumBoxes  = NumBoxes;
     Color     = Color;
     Size      = Size;
     Refresh();
 }
Exemplo n.º 9
0
        internal override List <ButtonCallback> GetButtons()
        {
            buttonsList.Clear();
            ButtonCallback        compra = new ButtonCallback("Comprar", Buy_callback);
            List <ButtonCallback> c      = new List <ButtonCallback>();

            c.Add(compra);
            return(c);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Creates and attaches a button to the shared control panel.
        /// </summary>
        /// <param name="buttonName">The name of the button.</param>
        /// <param name="onChange">
        /// The callback method that will be called every time the button changes state.
        /// </param>
        /// <param name="buttonType">The type of button to create.</param>
        /// <param name="initialButtonState">The initial state of the button.</param>
        /// <returns>
        /// <b>true</b> if the button was created successfully; otherwise, <b>false</b>.
        /// </returns>
        public static bool CreateButton(
            string buttonName       = null,
            ButtonCallback onChange = null,
            ButtonType buttonType   = ButtonType.PushButton,
            bool initialButtonState = false)
        {
            _CvButtonCallback callback = onChange != null ? (state, userdata) => onChange(state > 0 ? true : false) : (_CvButtonCallback)null;

            return(NativeMethods.cvCreateButton(buttonName, callback, IntPtr.Zero, buttonType, initialButtonState ? 1 : 0) > 0);
        }
Exemplo n.º 11
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     base.InitChildren(parent, host, MyButtonCallback);
     foreach (Element2D child in ScollableChildframe.ChildList)
     {
         if (child is TreeNodeWidget)
         {
             ((TreeNodeWidget)child).TopLevel = true;
         }
     }
 }
Exemplo n.º 12
0
 public void Setup(UrlData data, ButtonCallback callback)
 {
     if (_name)
     {
         _name.text = data.UrlName;
     }
     // if (_icon) _icon.sprite = data.Icon;
     // if (_icon) _icon.color = data.Icon ? Color.white : Color.clear;
     _urlAdress = data.Adress;
     _callback  = callback;
 }
Exemplo n.º 13
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     Parent = parent;
     Init(host);
     lock (ChildList)
     {
         foreach (Element2D child in ChildList)
         {
             child.InitChildren(this, host, MyButtonCallback);
         }
     }
 }
Exemplo n.º 14
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     Parent = parent;
     Init(host, "guicontrols", u0, v0, u1, v1, columns, rows, no_frames, frame_time);
     lock (ChildList)
     {
         foreach (Element2D child in ChildList)
         {
             child.InitChildren(this, host, MyButtonCallback);
         }
     }
 }
Exemplo n.º 15
0
 public void Init(GUIHost host, ButtonCallback MyButtonCallback)
 {
     this.host  = host;
     DoOnUpdate = null;
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     Visible = true;
     Enabled = true;
     InitChildren(null, host, MyButtonCallback);
     Sprite.pixel_perfect = false;
 }
 public void RegisterCallback(ButtonCallback callback)
 {
     Start(); // make sure the interface is initialized.
     if (null == buttonCallbacks)
     {
         buttonCallbacks   = callback;
         rawButtonCallback = new OSVR.ClientKit.ButtonCallback(ButtonCb);
         iface.registerCallback(rawButtonCallback, System.IntPtr.Zero);
     }
     else
     {
         buttonCallbacks += callback;
     }
 }
Exemplo n.º 17
0
        public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            if (!parent.IsComboBoxElement() && !parent.IsListBoxElement() && (u0 == 0.0 && v0 == 0.0) && (u1 == 0.0 && v1 == 0.0))
            {
                SetToDefaultOptions(type_template);
            }

            base.InitChildren(parent, host, MyButtonCallback);
            if (parent.GetElementType() != ElementType.ComboBoxWidget)
            {
                SetCallback(MyButtonCallback);
            }

            SetGrowableWidth(16, 16, 48);
        }
Exemplo n.º 18
0
        public virtual void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            SetParent(parent);
            if (HasFocus)
            {
                SetAsFocused(host);
            }

            foreach (Element2D child in ChildList)
            {
                child.SetParent(this);
                child.InitChildren(this, host, MyButtonCallback);
            }
            Refresh();
        }
Exemplo n.º 19
0
        //Sends the interface of the category PreferredCategories[<category>]
        public static void SendSetWarningsUI(Players.Player player, int category = 0)
        {
            NetworkMenu menu = new NetworkMenu();

            menu.Identifier = "WarningUI";
            menu.Width      = 400;
            menu.Height     = 600;

            Label           label    = new Label("Category: ");
            DropDownNoLabel dropDown = new DropDownNoLabel("Khanx.Warning.categoryDropDown", PreferredCategories);

            //Default dropdown (ALWAYS INCLUDE OR GIVES ERROR)
            menu.LocalStorage.SetAs("Khanx.Warning.categoryDropDown", category);

            //Kenovis: NEEDS JTOKEN
            //JToken jToken = JToken.Parse("Khanx.Warning.ChangeCategory");

            ButtonCallback buttonCallback = new ButtonCallback("Khanx.Warning.ChangeCategory", new LabelData("Change category", UnityEngine.Color.black));

            List <(IItem, int)> horizontalRowItems = new List <(IItem, int)>();

            horizontalRowItems.Add((label, 75));
            horizontalRowItems.Add((dropDown, 125));
            horizontalRowItems.Add((buttonCallback, 125));

            HorizontalRow horizontalRow = new HorizontalRow(horizontalRowItems);

            menu.Items.Add(horizontalRow);
            menu.Items.Add(new EmptySpace(25));

            //Show icon & amount per category
            IEnumerable <ItemTypes.ItemType> itemsInCategory = ItemTypes.NotableTypes.Where(type => type.HasCategory(PreferredCategories[category]));

            Dictionary <ushort, int> warning = warnings.GetValueOrDefault(player.ID, new Dictionary <ushort, int>());

            foreach (ItemTypes.ItemType item in itemsInCategory)
            {
                ItemIcon   icon       = new ItemIcon(item.Name);
                InputField inputField = new InputField("Khanx.Warning." + item.Name + "Field", 50);

                //default value
                menu.LocalStorage.SetAs("Khanx.Warning." + item.Name + "Field", warning.GetValueOrDefault(item.ItemIndex, 0));

                menu.Items.Add(new HorizontalSplit(icon, inputField));
            }

            NetworkMenuManager.SendServerPopup(player, menu);
        }
Exemplo n.º 20
0
        public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            base.InitChildren(parent, host, MyButtonCallback);
            var index = 0;

            foreach (Element2D child in ChildList)
            {
                VerticalLayout.RowInfo rowInfo;
                rowInfo.element       = child;
                rowInfo.ispercent     = false;
                rowInfo.prefered_size = child.Height;
                info_list.Insert(index, rowInfo);
                ++index;
            }
            Recalc();
        }
Exemplo n.º 21
0
        public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            base.InitChildren(parent, host, MyButtonCallback);
            var index = 0;

            foreach (Element2D child in ChildList)
            {
                HorizontalLayout.ColumnInfo columnInfo;
                columnInfo.element       = child;
                columnInfo.ispercent     = false;
                columnInfo.prefered_size = child.Width;
                info_list.Insert(index, columnInfo);
                ++index;
            }
            RecalcChildSizes();
        }
Exemplo n.º 22
0
        public Button(IEmoji emoji, ButtonCallback callback, int position = int.MaxValue)
        {
            if (emoji == null)
            {
                throw new ArgumentNullException(nameof(emoji));
            }

            if (callback == null)
            {
                throw new ArgumentNullException(nameof(callback));
            }

            Emoji    = emoji;
            Callback = callback;
            Position = position;
        }
Exemplo n.º 23
0
        public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            Parent = parent;
            lock (ChildList)
            {
                foreach (Element2D child in ChildList)
                {
                    ScollableChildframe.AddChildElement(child);
                }

                ChildList.Clear();
                ScollableChildframe.InitChildren(this, host, MyButtonCallback);
            }
            Init(host);
            ScollableChildframe.Refresh();
        }
Exemplo n.º 24
0
        //
        // Method
        //

        /**
         * Constructor
         */
        public UButton(int priority, int id, string text, float x, float y, int width, int height, ButtonCallback callback)
            : base(priority, text, x, y, width, height)
        {
            this.callback = callback;
            this.id       = id;
            this.text     = text;

            enabled          = true;
            textColor        = DefaultTextColor;
            colorTextPressed = DefaultPressedTextColor;
            bgColor          = DefaultBgColor;
            colorHover       = DefaultHoverColor;
            colorDisabled    = DefaultDisabledColor;
            colorPressed     = DefaultPressedColor;
            font             = DefaultFont;
            textBrush        = DefaultTextBrush;
        }
Exemplo n.º 25
0
        private static void Left_Click(Players.Player player)
        {
            if (null == player)
            {
                return;
            }

            NetworkMenu menu = new NetworkMenu();

            menu.Identifier = "Avanced Forester";
            menu.Width      = 500;

            menu.LocalStorage.SetAs("header", Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.advancedforesterheader"));

            ButtonCallback cherryButton = new ButtonCallback("Khanx.AdvancedForester.0", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.cherryforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback taigaButton  = new ButtonCallback("Khanx.AdvancedForester.1", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.taigaforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback oliveButton  = new ButtonCallback("Khanx.AdvancedForester.2", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.oliveforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);

            HorizontalRow row1 = new HorizontalRow(new List <(IItem, int)> {
                (cherryButton, 150), (taigaButton, 150), (oliveButton, 150)
            });

            menu.Items.Add(row1);

            ButtonCallback redAutummButton    = new ButtonCallback("Khanx.AdvancedForester.3", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.autumredforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback orangeAutummButton = new ButtonCallback("Khanx.AdvancedForester.4", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.autummorangeforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback yellowAutummButton = new ButtonCallback("Khanx.AdvancedForester.5", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.autumyellowforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);

            HorizontalRow row2 = new HorizontalRow(new List <(IItem, int)> {
                (redAutummButton, 150), (orangeAutummButton, 150), (yellowAutummButton, 150)
            });

            menu.Items.Add(row2);

            ButtonCallback darkTemperateButton  = new ButtonCallback("Khanx.AdvancedForester.6", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.darktemperateforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback temperateButton      = new ButtonCallback("Khanx.AdvancedForester.7", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.temperateforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);
            ButtonCallback lightTemperateButton = new ButtonCallback("Khanx.AdvancedForester.8", new LabelData(Localization.GetSentence(player.LastKnownLocale, "popup.tooljob.lighttemperateforester"), UnityEngine.Color.black, UnityEngine.TextAnchor.MiddleCenter), -1, 25, ButtonCallback.EOnClickActions.ClosePopup);

            HorizontalRow row3 = new HorizontalRow(new List <(IItem, int)> {
                (darkTemperateButton, 150), (temperateButton, 150), (lightTemperateButton, 150)
            });

            menu.Items.Add(row3);

            NetworkMenuManager.SendServerPopup(player, menu);
        }
Exemplo n.º 26
0
 public WaitForUIButtons(System.Action <Button> aCallback, params Button[] aButtons)
 {
     m_Callback         = aCallback;
     m_Buttons.Capacity = aButtons.Length;
     foreach (var b in aButtons)
     {
         if (b == null)
         {
             continue;
         }
         var bc = new ButtonCallback {
             button = b
         };
         bc.listener = () => OnButtonPressed(bc.button);
         m_Buttons.Add(bc);
     }
     Reset();
 }
Exemplo n.º 27
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     Parent = parent;
     base.InitChildren(parent, host, MyButtonCallback);
     if (u0 == 0.0 && v0 == 0.0 && (u1 == 0.0 && v1 == 0.0))
     {
         texture = "guicontrols";
         u0      = 640f;
         v0      = 320f;
         u1      = 704f;
         v1      = 383f;
         leftbordersize_pixels   = 41;
         rightbordersize_pixels  = 8;
         minimumwidth            = 64;
         topbordersize_pixels    = 35;
         bottombordersize_pixels = 8;
         minimumheight           = 64;
     }
     Init(host, texture, u0, v0, u1, v1, leftbordersize_pixels, rightbordersize_pixels, minimumwidth, topbordersize_pixels, bottombordersize_pixels, minimumheight);
 }
Exemplo n.º 28
0
        public void OnConstructCommandTool(Players.Player p, NetworkMenu menu, string menuName)
        {
            if (menuName != "popup.tooljob.construction")
            {
                return;
            }
            menu.Items.Add((IItem) new EmptySpace(20));

            bool           unlocked = CommandToolManager.NPCAreaUnlocked(p, "pipliz.builder", out ScienceKey? _);
            ButtonCallback button   = new ButtonCallback("wingdings.replacer", new LabelData("wingdings.tooljob.replacer", ELabelAlignment.Default, 16, LabelData.ELocalizationType.Sentence), 200, 45, ButtonCallback.EOnClickActions.None, (JToken)null, 0.0f, 0.0f, true)
            {
                Enabled = unlocked
            };

            ButtonCallback button2 = new ButtonCallback("windings.shapes", new LabelData("wingdings.tooljob.shapes", ELabelAlignment.Default, 16, LabelData.ELocalizationType.Sentence), 200, 45, ButtonCallback.EOnClickActions.None, (JToken)null, 0.0f, 0.0f, true)
            {
                Enabled = unlocked
            };

            CommandToolManager.GenerateTwoColumnCenteredRow(menu, button, button2);
        }
Exemplo n.º 29
0
 public ButtonWidget(int ID, Element2D parent)
     : base(ID, parent)
 {
     textcolor          = new Color4(0.1843137f, 0.3294118f, 0.345098f, 1f);
     textovercolor      = new Color4(0.3686275f, 0.6588235f, 0.6901961f, 1f);
     textdowncolor      = new Color4(0.25f, 0.25f, 0.25f, 1f);
     textdisabledcolor  = new Color4(0.7f, 0.7f, 0.7f, 1f);
     white              = new Color4(1f, 1f, 1f, 1f);
     imageHasFocusColor = white;
     Color              = textcolor;
     down            = false;
     state           = State.Normal;
     buttoncallback  = null;
     ClickType       = ButtonType.Clickable;
     _can_click_off  = false;
     draggable_fully = false;
     dragged_fully   = false;
     dragged_x_fully = 0;
     dragged_y_fully = 0;
     IgnoreMouse     = false;
 }
Exemplo n.º 30
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     Parent = parent;
     if (parent.GetElementType() != ElementType.ComboBoxWidget)
     {
         Init(host, "guicontrols", u0, v0, u1, v1);
         SetGrowableWidth(3, 3, 32);
         SetTextWindowBorders(4, 4, 4, 4);
     }
     else
     {
         HexColor       = ((ComboBoxWidget)parent).HexColor;
         Size           = ((ComboBoxWidget)parent).Size;
         ToolTipMessage = parent.ToolTipMessage;
     }
     lock (ChildList)
     {
         foreach (Element2D child in ChildList)
         {
             child.InitChildren(this, host, MyButtonCallback);
         }
     }
 }
Exemplo n.º 31
0
 public void registerCallback(ButtonCallback cb, IntPtr /*void*/ userdata)
 {
     osvrRegisterButtonCallback(m_interface, cb, userdata);
 }
Exemplo n.º 32
0
 public void unregisterButtonCallback(string aLayoutName, ButtonCallback aCallback)
 {
     Layout layout = getLayout(aLayoutName);
     if (layout != null)
     {
         layout.unregisterButtonCallback(aCallback);
     }
 }
Exemplo n.º 33
0
		public static extern void bizswan_setbuttoncallback(IntPtr core, ButtonCallback bcb);
Exemplo n.º 34
0
 private static extern void set_callbacks(ButtonCallback bc);
Exemplo n.º 35
0
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //Button callbacks
    void SetCallback()
    {
        if(buttonType == ButtonType.MAIN_CHARACTERS) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonCharactersChecked;
        }
        else if(buttonType == ButtonType.MAIN_BACKGROUNDS) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonBackgroundsChecked;
        }
        else if(buttonType == ButtonType.MAIN_MUSIC) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonMusicsChecked;
        }
        else if(buttonType == ButtonType.MAIN_SHARE) {
            clickedCallback = ((GUIManagerChapters)mGUIManager).OnButtonShareClicked;
        }
        else if(buttonType == ButtonType.MAIN_DEL_ELEM) {
            clickedCallback = mGUIManager.RightButtonBar.OnButtonDeleteElementClicked;
        }
        else if(buttonType == ButtonType.ADD_ELEM) {
            clickedCallback = ((ButtonBarElements)mButtonBar).OnButtonAddElementClicked;
        }
        else if(buttonType == ButtonType.CHAPTER) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonChapterChecked;
        }
        else if(buttonType == ButtonType.CHAR) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonCharacterChecked;
        }
        else if(buttonType == ButtonType.BACKGROUND) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonBackgroundChecked;
        }
        else if(buttonType == ButtonType.MUSIC) {
            checkedCallback = ((GUIManagerChapters)mGUIManager).OnButtonMusicChecked;
        }
        else if(buttonType == ButtonType.MAIN_EDIT) {
            clickedCallback = mGUIManager.OnButtonEditClicked;
        }
        else if(buttonType == ButtonType.MAIN_PLAY) {
            clickedCallback = mGUIManager.OnButtonPlayClicked;
        }
        else if(buttonType == ButtonType.MAIN_HELP) {
            checkedCallback = mGUIManager.OnButtonHelpCheched;
        }
        else if(buttonType == ButtonType.BLOCK) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonBlockChecked;
        }
        else if(buttonType == ButtonType.EDIT_ANIM) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonAnimationsChecked;
        }
        else if(buttonType == ButtonType.EDIT_EXPR) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonExpressionsChecked;
        }
        else if(buttonType == ButtonType.EDIT_CAM) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonCamerasChecked;
        }
        else if(buttonType == ButtonType.ANIM) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonAnimationChecked;
        }
        //else if(buttonType == ButtonType.EXPR) {
        //	checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonExpressionChecked;
        //}
        else if(buttonType == ButtonType.CAM_PARAM) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonCameraChecked;
        }

        //TIME SECTION ////////////////////////////////////////////////////////////////////////////////////////////////////////

        else if(buttonType == ButtonType.EDIT_TIME) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_TIME) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeTimeChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeVoiceChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_TIME_DECR) {
            clickedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeTimeDecrClicked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_TIME_INCR) {
            clickedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeTimeIncrClicked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_TIME_SAVE) {
            clickedCallback = ((GUIManagerBlocks)mGUIManager).OnButtonTimeTimeSaveClicked;
        }

        //VOICE ////////////

        else if(buttonType == ButtonType.EDIT_TIME_VOICE_PLAY) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoicePlayChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_REC) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceRecChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX) {
            clickedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxClicked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_SAVE) {
            clickedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceSaveClicked;
        }

        //SOUND FILTERS ////////////////////////////////////////////////////////////////////////////////////////////////////////

        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_MONSTER) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_SMURF) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_ECHO) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_MONSTER_PRO) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_SMURF_PRO) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_ROBOT) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_DIST) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_NOISE) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_COMPRESS) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }
        else if(buttonType == ButtonType.EDIT_TIME_VOICE_FX_OFF) {
            checkedCallback = ((GUIManagerBlocks)mGUIManager).soundRecorder.OnButtonTimeVoiceFxEffectChecked;
        }

        //PLAYER ////////////////////////////////////////////////////////////////////////////////////////////////////////

        else if(buttonType == ButtonType.PLAYER_PLAY) {
            checkedCallback = ((Player_Main)mGUIManager).OnButtonPlayerPlayChecked;
        }
        else if(buttonType == ButtonType.PLAYER_EDIT) {
            clickedCallback = ((Player_Main)mGUIManager).OnButtonPlayerEditClicked;
        }

        //EXPORT ////////////////////////////////////////////////////////////////////////////////////////////////////////

        else if(buttonType == ButtonType.EXPORT_EDIT) {
            clickedCallback = ((Export_Main)mGUIManager).OnButtonExportEditClicked;
        }
    }
 public void RegisterCallback(ButtonCallback callback)
 {
     Start(); // make sure the interface is initialized.
     if (null == buttonCallbacks)
     {
         buttonCallbacks = callback;
         rawButtonCallback = new OSVR.ClientKit.ButtonCallback(ButtonCb);
         iface.registerCallback(rawButtonCallback, System.IntPtr.Zero);
     }
     else
     {
         buttonCallbacks += callback;
     }
 }
Exemplo n.º 37
0
        /// <summary>
        /// This function adds a button entry to a tweak bar. When the button is clicked by a user, the callback function provided to this function is called.
        /// </summary>
        /// <param name="bar">The tweak bar to which adding a new variable.</param>
        /// <param name="name">The name of the button. It will be displayed in the tweak bar if no label is specified for this button. It will also be used to refer to this button in other functions.</param>
        /// <param name="callback">The callback function that will be called by AntTweakBar when the button is clicked.</param>
        /// <param name="clientData">For your convenience, this is a supplementary pointer that will be passed to the callback function when it is called.</param>
        /// <param name="def">An optional definition string used to modify the behavior of this new entry.</param>
        public static void AddButton(IntPtr bar, String name, ButtonCallback callback, IntPtr clientData, String def)
        {
            if (bar == IntPtr.Zero) {
                throw new ArgumentOutOfRangeException("bar");
            } else if (name == null) {
                throw new ArgumentNullException("name");
            } else if (callback == null) {
                throw new ArgumentNullException("callback");
            }

            if (!NativeMethods.TwAddButton(bar, name, callback, clientData, def)) {
                throw new AntTweakBarException("TwAddButton failed.");
            }
        }
Exemplo n.º 38
0
 internal void Add(DialogType id, NpcFunction.FunctionCallback callback)
 {
     ButtonCallback mycallback = new ButtonCallback();
     mycallback.callback = callback;
     __callbacks.Add((byte)id, mycallback);
 }
Exemplo n.º 39
0
 public static extern int VrpnStart(string device,
                                       AnalogCallback analogCallback,
                                       ButtonCallback buttonCallback,
                                       TrackerCallback trackerCallback);
Exemplo n.º 40
0
 public void unregisterButtonCallback(ButtonCallback aCallback)
 {
     if (aCallback != null)
     {
         e_ButtonCallback -= aCallback;
     }
 }