示例#1
0
        void Display2ndColomn()
        {
            if (_c2type == C2Type.Nill)
            {
                return;
            }
            if (_c2type == C2Type.SetTarget)
            {
                BorderGroup.BeginBorder("Set Target:");
                ImGui.Checkbox("Show Own", ref _showOwnAsTarget);

                for (int i = 0; i < _allSensorContacts.Length; i++)
                {
                    var contact = _allSensorContacts[i];
                    if (ImGui.SmallButton("Set ##sens" + i))
                    {
                        SetTarget(contact.ActualEntityGuid);
                    }

                    ImGui.SameLine();
                    ImGui.Text(contact.Name);
                }

                if (_showOwnAsTarget)
                {
                    for (int i = 0; i < _ownEntites.Length; i++)
                    {
                        var contact = _ownEntites[i];
                        if (ImGui.SmallButton("Set##own" + i))
                        {
                            SetTarget(contact.Entity.Guid);
                        }
                        ImGui.SameLine();
                        ImGui.Text(contact.Name);
                    }
                }
                BorderGroup.EndBoarder();
            }

            if (_c2type == C2Type.SetWeapons)
            {
                BorderGroup.BeginBorder("Missile Launchers:");
                for (int i = 0; i < _missileLaunchers.Length; i++)
                {
                    if (ImGui.SmallButton(_missileLaunchers[i].Name + "##" + i))
                    {
                        var    wns   = new List <ComponentInstance>(_fcState[i].AssignedWeapons);
                        Guid[] wnids = new Guid[wns.Count + 1];
                        for (int k = 0; k < wns.Count; k++)
                        {
                            wnids[k] = wns[k].ID;
                        }
                        wnids[wns.Count] = _missileLaunchers[i].ID;
                        SetWeapons(wnids);
                    }
                    ImGui.Indent();
                    for (int j = 0; j < _mlstates[i].WeaponStats.Length; j++)
                    {
                        var    stat = _mlstates[i].WeaponStats[j];
                        string str  = stat.name + Stringify.Value(stat.value, stat.valueType);
                        ImGui.Text(str);
                    }
                    ImGui.Unindent();
                }
                BorderGroup.EndBoarder();
                ImGui.NewLine();
                BorderGroup.BeginBorder("Rail Guns:");
                for (int i = 0; i < _railGuns.Length; i++)
                {
                    if (ImGui.SmallButton(_railGuns[i].Name + "##" + i))
                    {
                        var    wns   = new List <ComponentInstance>(_fcState[i].AssignedWeapons);
                        Guid[] wnids = new Guid[wns.Count + 1];
                        for (int k = 0; k < wns.Count; k++)
                        {
                            wnids[k] = wns[k].ID;
                        }
                        wnids[wns.Count] = _railGuns[i].ID;
                        SetWeapons(wnids);
                    }
                    ImGui.Indent();
                    for (int j = 0; j < _rgstates[i].WeaponStats.Length; j++)
                    {
                        var    stat = _rgstates[i].WeaponStats[j];
                        string str  = stat.name + Stringify.Value(stat.value, stat.valueType);
                        ImGui.Text(str);
                    }
                    ImGui.Unindent();
                }
                BorderGroup.EndBoarder();
                ImGui.NewLine();
                BorderGroup.BeginBorder("Beam Weapons:");
                for (int i = 0; i < _beamWpns.Length; i++)
                {
                    if (ImGui.SmallButton(_beamWpns[i].Name + "##" + i))
                    {
                        var    wns   = new List <ComponentInstance>(_fcState[i].AssignedWeapons);
                        Guid[] wnids = new Guid[wns.Count + 1];
                        for (int k = 0; k < wns.Count; k++)
                        {
                            wnids[k] = wns[k].ID;
                        }
                        wnids[wns.Count] = _beamWpns[i].ID;
                        SetWeapons(wnids);
                    }
                    ImGui.Indent();
                    for (int j = 0; j < _beamstates[i].WeaponStats.Length; j++)
                    {
                        var    stat = _beamstates[i].WeaponStats[j];
                        string str  = stat.name + Stringify.Value(stat.value, stat.valueType);
                        ImGui.Text(str);
                    }
                    ImGui.Unindent();
                }
                BorderGroup.EndBoarder();
            }
        }