public void ShowDetails(DsgVarListItem item, string namePrefix) { DetailsGridForm form = new DetailsGridForm($"{namePrefix} - {item.Type} {item.Id} - Details"); InitIcons(form.listView); form.AddColumn("Init Value", 80); form.AddColumn("Model Init", 80); // TODO: Testing just on vectors if (item.Type == DsgVarType.Vector) { Vector3 *value = (Vector3 *)item.Value; Vector3 *initValue = (Vector3 *)item.InitValue; Vector3 *modelValue = (Vector3 *)item.ModelValue; ListViewItem vectorX = new ListViewItem( new[] { "X", $"{value->x}", $"{initValue->x}", $"{modelValue->x}" }, (int)IconId.Float ); ListViewItem vectorY = new ListViewItem( new[] { "Y", $"{value->y}", $"{initValue->y}", $"{modelValue->y}" }, (int)IconId.Float ); ListViewItem vectorZ = new ListViewItem( new[] { "Z", $"{value->z}", $"{initValue->z}", $"{modelValue->z}" }, (int)IconId.Float ); form.AddItem(vectorX, vectorY, vectorZ); } MainFrame.Instance.ShowChildAtCursor(form); }
public Acp.XAI_tdfnEnumDsgVarCallback GetInitDsgVarsCallback(ListView list) { return((idx, type, value, initValue, modelInitValue) => { DsgVarListItem dsgVar = new DsgVarListItem(idx, type, value, initValue, modelInitValue); DsgVarList.Add(dsgVar); ListViewItem listItem = GetViewItem(dsgVar); list.Items.Add(listItem); return true; }); }
private ListViewItem GetViewItem(DsgVarListItem item) { if (item.ListItem == null) { string valueText = GetDsgVarString(item.Type, item.Value); string initValueText = GetDsgVarString(item.Type, item.InitValue); string modelInitText = GetDsgVarString(item.Type, item.ModelValue); IconId icon = GetDsgVarIcon(item.Type); item.ListItem = new ListViewItem( new[] { $"{item.Type}", $"{item.Id}", valueText, initValueText, modelInitText }, (int)icon ); item.ListItem.Tag = item; } return(item.ListItem); }