Exemplo n.º 1
0
        public void DirectMessage(string body)
        {
            var formatted = String.Format(body, this.User.ScreenName, this.User.Name);

            InputModel.InputCore.SetText(InputSetting.CreateDirectMessage(
                                             this.Model.GetSuitableReplyAccount(), this.Status.User, formatted));
        }
Exemplo n.º 2
0
    private void Awake()
    {
        gameStageData = GameFacade.GetInstance().gameStageData;
        inputSetting  = GameFacade.GetInstance().inputSetting;

        playerBehaviour = GetComponent <PlayerBehaviour>();
    }
Exemplo n.º 3
0
 public void Init(InputSetting inputSetData, UnityAction onButton)
 {
     mKeyName.SetText(inputSetData.Type);
     mText.SetText(inputSetData.Key);
     mButton.RemoveAllCallback();
     mButton.AddCallback(onButton);
 }
Exemplo n.º 4
0
 public void Load(BinaryReader _reader)
 {
     try
     {
         int num1 = _reader.ReadInt32();
         for (int index1 = 0; index1 < num1; ++index1)
         {
             string         _controllerName = _reader.ReadString();
             ControllerType _controllerType = (ControllerType)_reader.ReadInt32();
             int            num2            = _reader.ReadInt32();
             this.DeleteControllerSetting(_controllerType, _controllerName);
             ControllerSetting controllerSetting = new ControllerSetting(_controllerName, _controllerType);
             for (int index2 = 0; index2 < num2; ++index2)
             {
                 InputSetting _inputSetting = new InputSetting(_reader.ReadInt32(), _reader.ReadInt32(), (ControllerType)_reader.ReadInt32(), (ControllerElementType)_reader.ReadInt32(), _reader.ReadInt32(), (AxisRange)_reader.ReadInt32(), (KeyCode)_reader.ReadInt32(), (ModifierKeyFlags)_reader.ReadInt32(), _reader.ReadInt32(), (Pole)_reader.ReadInt32(), _reader.ReadBoolean(), _reader.ReadInt32());
                 controllerSetting.AddElement(_inputSetting);
             }
             this.controllerList.Add(controllerSetting);
         }
         Debug.Log((object)"ロードに成功しました:Load(BinaryReader _reader)");
     }
     catch (Exception ex)
     {
         Debug.LogException(ex);
     }
 }
Exemplo n.º 5
0
 private void Reply()
 {
     if (this.IsSelected)
     {
         this.Parent.ReplySelecteds();
         return;
     }
     InputModel.InputCore.SetText(InputSetting.CreateReply(this.Status));
 }
        /// <summary>
        /// 储存当前配置到存档文件
        /// </summary>
        public static void SaveSettings()
        {
            InputSetting setting = new InputSetting();

            setting.SaveKeymap = CurrrentKeymap;

            SaveManager settingSaved = new SaveManager(Application.persistentDataPath, "InputSetting.save");

            settingSaved.SetData(setting);
        }
    private void Awake()
    {
        m_InputSetting = new InputSetting();
        m_InputSetting.Player.SetCallbacks(this);

        for (int i = 0; i < 10; ++i)
        {
            m_NumberKeyEvent.Add(new List <Action <InputActionPhase> >());
        }
    }
Exemplo n.º 8
0
        private void SetupInputManager(GridEditableItem editableItem)
        {
            // style and set URL column's textbox as required
            var textBox =
                ((GridTextBoxColumnEditor)editableItem.EditManager.GetColumnEditor("URL")).TextBoxControl;

            InputSetting inputSetting = RadInputManager1.GetSettingByBehaviorID("TextBoxSetting1");

            inputSetting.TargetControls.Add(new TargetInput(textBox.UniqueID, true));
            inputSetting.InitializeOnClient    = true;
            inputSetting.Validation.IsRequired = true;
        }
        public MainForm()
        {
            // 初始化UI的界面
            InitializeComponent();

            // 读取UI设置
            InputSetting inputSetting = new InputSetting();

            inputSetting.ReadSettingFromFile();

            // 设置UI文字
            SetUIString();
        }
Exemplo n.º 10
0
        public void ReplySelecteds()
        {
            var users = SelectedStatuses
                        .Select(s => "@" + s.User.ScreenName)
                        .Distinct()
                        .JoinString(" ");
            var accs = CurrentAccounts.Select(id => Setting.Accounts.Get(id))
                       .Where(a => a != null)
                       .ToArray();

            InputModel.InputCore.SetText(InputSetting.Create(accs, users + " "));
            DeselectAll();
        }
Exemplo n.º 11
0
        public void QuotePermalink()
        {
            if (IsDirectMessage)
            {
                // disable on direct messages
                return;
            }
            var setting = InputSetting.Create(this.Model.GetSuitableReplyAccount(),
                                              " " + this.Status.Permalink);

            setting.CursorPosition = CursorPosition.Begin;
            InputModel.InputCore.SetText(setting);
        }
Exemplo n.º 12
0
        public void Quote()
        {
            if (IsDirectMessage)
            {
                // disable on direct messages
                return;
            }
            var setting = InputSetting.CreateReply(this.Status,
                                                   " RT @" + this.User.ScreenName + ": " + this.Status.GetEntityAidedText(true),
                                                   false);

            setting.CursorPosition = CursorPosition.Begin;
            InputModel.InputCore.SetText(setting);
        }
        /// <summary>
        /// 从存档文件中读取配置
        /// </summary>
        public static void LoadSettings()
        {
            InputSetting setting = new InputSetting();

            SaveManager settingSaved = new SaveManager(Application.persistentDataPath, "InputSetting.save");

            settingSaved.GetData(ref setting);


            if (setting.SaveKeymap.Keys.Count == DefaultKeymap.Keys.Count)
            {
                CurrrentKeymap = setting.SaveKeymap;
            }
            else
            {
                throw new System.ArrayTypeMismatchException("The saved key functions mismatch current key functions");
            }
        }
Exemplo n.º 14
0
 private void Reply(string body)
 {
     // from key assign
     if (String.IsNullOrEmpty(body))
     {
         this.Reply();
         return;
     }
     try
     {
         var formatted = String.Format(body, this.User.ScreenName, this.User.Name);
         InputModel.InputCore.SetText(InputSetting.CreateReply(this.Status, formatted, false));
     }
     catch (Exception ex)
     {
         BackstageModel.RegisterEvent(new OperationFailedEvent("返信フォーマット エラー(フォーマット: " + body + ")", ex));
     }
 }
Exemplo n.º 15
0
 void _InitItems()
 {
     mItemRoot.DestroyAllChild();
     mInputSettings.ForEach(setData =>
     {
         mSetItemTem
         .Instantiate()
         .Parent(mItemRoot)
         .LocalIdentity()
         .ApplySelfTo(setItem =>
         {
             setItem.Init(setData, new UnityEngine.Events.UnityAction(() =>
             {
                 mSelInputItem = setItem;
                 mSelInputData = setData;
             }));
         }).Show();
     });
 }
Exemplo n.º 16
0
 public void UpdateView(InputSetting inputSetData)
 {
     mKeyName.SetText(inputSetData.Type);
     mText.SetText(inputSetData.Key);
 }
Exemplo n.º 17
0
 public void SetTextToInputBox()
 {
     InputModel.InputCore.SetText(InputSetting.Create(SelectedText));
 }
Exemplo n.º 18
0
 public void AddElement(InputSetting _inputSetting)
 {
     this.elements.Add(_inputSetting);
 }
Exemplo n.º 19
0
 public ComboInput(InputSetting _input)
 {
     input = _input;
 }
Exemplo n.º 20
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        InputInfoElement pDrawTarget = EditorCodeHelper.GetTargetObjectOfProperty(property) as InputInfoElement;

        position.height     = EditorCodeHelper.singleLineHeight;
        property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, "Input: " + pDrawTarget.IRelateByOther_GetDisplayName());
        if (property.isExpanded == false)
        {
            return;
        }
        position.y += EditorCodeHelper.singleLineHeight;

        EditorCodeHelper.PropertyField(position, property.FindPropertyRelative(nameof(pDrawTarget.eInputInfoType)), "InputType");
        position.y += EditorCodeHelper.singleLineHeight;

        if (pDrawTarget.eInputInfoType == InputInfoElement.EInputInfoType.GetAxis)
        {
            var listInput = InputSetting.GetInput_ValueDropDownList();
            pDrawTarget.strInputAxisName = EditorCodeHelper.DrawEnumPopup(position, "Select Input", pDrawTarget.strInputAxisName, listInput);
            position.y += EditorCodeHelper.singleLineHeight;
        }
        else if (pDrawTarget.IsMouseInput())
        {
            EditorCodeHelper.PropertyField(position, property.FindPropertyRelative(nameof(pDrawTarget.eMouseButtonType)), "Mouse");
            position.y += EditorCodeHelper.singleLineHeight;
        }
        else
        {
            float fOriginX     = position.x;
            float fOriginWidth = position.width;
            position.width *= 0.5f;
            position.x     += position.width;

            var pKeyCodeProperty = property.FindPropertyRelative(nameof(pDrawTarget.eKeyCode));
            if (pKeyCodeProperty.isExpanded) // Is Recording..
            {
                if (UpdateKeyCode(property, pDrawTarget))
                {
                    pKeyCodeProperty.isExpanded = false;
                }

                if (GUI.Button(position, "Cancel Recording.."))
                {
                    pKeyCodeProperty.isExpanded = false;
                }
            }
            else
            {
                if (GUI.Button(position, "Record KeyCode"))
                {
                    pKeyCodeProperty.isExpanded = true;
                }
            }

            position.x     = fOriginX;
            position.width = fOriginWidth;
            position.y    += EditorCodeHelper.singleLineHeight;

            pKeyCodeProperty.intValue = (int)pDrawTarget.eKeyCode;
            EditorCodeHelper.PropertyField(position, pKeyCodeProperty, "KeyCode");
            position.y += EditorCodeHelper.singleLineHeight;
        }

        EditorCodeHelper.PropertyField(position, property.FindPropertyRelative(nameof(pDrawTarget.bAlwaysInput)), "Is Always Input");
        position.y += EditorCodeHelper.singleLineHeight;
    }
Exemplo n.º 21
0
 public void DirectMessage()
 {
     InputModel.InputCore.SetText(
         InputSetting.CreateDirectMessage(this.Model.GetSuitableReplyAccount(),
                                          this.Status.User));
 }