コード例 #1
0
    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;
    }
コード例 #2
0
    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);
    }