Ejemplo n.º 1
0
 void Map_GrhToPlaceChanged(object sender, EventArgs e)
 {
     try
     {
         Grh grh = GlobalState.Instance.Map.GrhToPlace;
         if (grh != null && grh.GrhData != null)
         {
             GrhTreeViewNode newNode = gtv.FindGrhDataNode(grh.GrhData);
             if (gtv.SelectedNode != newNode)
             {
                 gtv.SelectedNode = newNode;
             }
         }
     }
     catch (Exception ex)
     {
         Debug.Fail(ex.ToString());
     }
 }
Ejemplo n.º 2
0
 private void gtv_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (!e.Shift && !e.Alt)
     {
         int?num = e.KeyCode.GetNumericKeyAsValue();
         if (num.HasValue && num.Value > 0 && num.Value < 10)
         {
             if (e.Control)
             {
                 // Set hotkey
                 GrhTreeViewNode node = gtv.SelectedNode as GrhTreeViewNode;
                 if (node != null && node.GrhData != null)
                 {
                     GlobalState.Instance.HotkeyedGrhs[num.Value] = node.GrhData.Categorization.ToString();
                 }
             }
             else
             {
                 // Use hotkey
                 GlobalState.Instance.SetGrhFromHotkey(num.Value);
             }
         }
     }
 }