public void OnLevelChanged() { LayerList.BeginUpdate(); LayerList.Clear(); string active_layer = Program.engine.MainLevel.GetActiveLayer(); for (int i = 0; i < Program.engine.MainLevel.GetLayerCount(); ++i) { string text = Program.engine.MainLevel.GetLayerName(i); EXListViewItem item = new EXImageListViewItem(NexusEditor.Properties.Resources.layer); EXListViewSubItem name = new EXListViewSubItem(text); name.OnItemValueChanged = this.OnLayerNameChanged; name.UserData = item; item.AddSubItem(name); EXBoolListViewSubItem active = new EXBoolListViewSubItem(active_layer == text); active.OnItemValueChanged = this.OnActiveLayer; active.UserData = item; item.AddSubItem(active); EXBoolListViewSubItem show = new EXBoolListViewSubItem(Program.engine.MainLevel.IsLayerVisible(text)); show.OnItemValueChanged = this.OnShowLayer; show.UserData = item; item.AddSubItem(show); EXBoolListViewSubItem islock = new EXBoolListViewSubItem(Program.engine.MainLevel.IsLayerLocked(text)); islock.OnItemValueChanged = this.OnLockLayer; islock.UserData = item; item.AddSubItem(islock); LayerList.AddItem(item); } LayerList.EndUpdate(); //在右侧的列表中显示当前激活层中的所有actor UpdateActorList(Program.engine.MainLevel.GetActiveLayer()); OperationTooltip.Text = "就绪"; }