예제 #1
0
 private void M_GlobalHook_KeyDown(object sender, KeyEventArgs e)
 {
     foreach (var child in CurrentNode.Nodes)
     {
         if (((VSS.VSS_Entry)child).Hotkey == e.KeyCode && !e.Handled)
         {
             e.SuppressKeyPress = true;
             e.Handled          = true;
             if (child.GetType() == typeof(VSS.VSS_Entry_Group))
             {
                 var cast = (VSS.VSS_Entry_Group)child;
                 this.preview.Clear();
                 CurrentNode = cast;
                 AddDisplayElement(CurrentNode);
             }
             else
             {
                 this.preview.Clear();
                 PlaySound(((VSS.VSS_Entry_Sound)child).Filepath);
                 CurrentNode = VSSdb;
                 AddDisplayElement(CurrentNode);
             }
         }
     }
 }
예제 #2
0
 private void AddDisplayElement(VSS.VSS_Entry_Group NodeToDrawFrom)
 {
     foreach (var child in NodeToDrawFrom.Nodes)
     {
         var cast = (VSS.VSS_Entry)child;
         this.preview.AddElement(cast.Hotkey, cast.Description);
     }
     preview.UpdateView();
 }
예제 #3
0
 public VSS_BindingsEditor(VSS_Entry_Group VSS_RootNode)
 {
     InitializeComponent();
     this.VSS_Tree.Nodes.Clear();
     this.VSS_RootEntry                    = VSS_RootNode;
     this.VSS_RootEntry.Name               = "ROOTNODE";
     this.VSS_RootEntry.ImageIndex         = 0;
     this.VSS_RootEntry.SelectedImageIndex = 0;
     this.VSS_RootEntry.StateImageIndex    = 0;
     this.VSS_Tree.Nodes.Add(VSS_RootEntry);
     TB_Key.Text = VSS_RootEntry.Hotkey.ToString();
 }
예제 #4
0
 public VSS_PreviewWindow(PrivateSettings _programSettings, VSS.VSS_Entry_Group VSSdb)
 {
     InitializeComponent();
     m_GlobalHook          = Gma.System.MouseKeyHook.Hook.GlobalEvents();
     directWaveOut         = new DirectSoundOut(60);
     this._programSettings = _programSettings;
     this.VSSdb            = new VSS.VSS_Entry_Group("ROOTNODE", Keys.NoName);
     this.VSSdb.Nodes.Add(VSSdb);
     this.CurrentNode = VSSdb;
     UpdateColors();
     preview = new VSS_Preview(pictureBoxVSSPreview, Color.Black, Color.Yellow, 24, Color.White, 18, Color.WhiteSmoke, 4);
     SetToRoot();
     m_GlobalHook.KeyDown += M_GlobalHook_KeyDown;
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            _programSettings = PrivateSettings.LoadSettings();
            UpdateColors();
            connectOnStartupToolStripMenuItem.Checked = _programSettings.Autostart;
            int valrr = Convert.ToInt32(100 * _programSettings.Volume);

            trackBar_Volume.Value = valrr;
            L_Volume.Text         = trackBar_Volume.Value.ToString() + "%";
            soundDb = new SoundBase(Path.Combine("SoundDBs", "sounds.xml"), _programSettings);
            VSSdb   = SoundStorage.VSSStorageXML.LoadVSSBase(Path.Combine("SoundDBs", "VSS.xml"));

            if (_programSettings.Autostart)
            {
                StartBot();
            }
        }
예제 #6
0
 private void SetToRoot()
 {
     CurrentNode = VSSdb;
     AddDisplayElement(CurrentNode);
 }