private void SceneSelector0OnEndDrag(GLUControl sender, GLUControl target) { if (!GLU.terminal.input.leftButtonReleased) { return; } // ButtonsView0.ClearItems(); GLUList <GLUListItem> il = new GLUList <GLUListItem>(); if (!selectionChanged) { Vector3 mp = GLU.terminal.input.cursorPosition; SceneSelector0.selection = GLURTSUnitsController.instance.Select(new GLURect( (int)mp.x - clickSelectionSize, (int)mp.y - clickSelectionSize, (int)mp.x + clickSelectionSize, (int)mp.y + clickSelectionSize)); } selectionChanged = false; foreach (GLURTSUnit u in GLURTSUnitsController.instance.units) { if (u.selected) { il.Add(new GLUListItem(u.name, u, "GLU/Controls/Textures/SceneView/unitIcon")); } } ButtonsView0.items = il; }
private void ButtonsView0OnItemInputPressed(GLUControl sender, Vector3 mp) { GLUListItem li = (sender as GLUControl).tag as GLUListItem; GLUList <GLUListItem> il = new GLUList <GLUListItem>() { li }; ButtonsView0.items = il; GLURTSUnitsController.instance.Select(li.obj as GLURTSUnit); SceneSelector0.selection.Clear(); SceneSelector0.selection.Add(li.obj as GLURTSUnit); }