private void SetLogicSceneEditorBrushState(_AtlObjInfo atlobj) { SceneSceneEditor.SetEditState(SCENESTATE_CELLLOGICAL); SceneSceneEditor.ClearLogicModifyState(); SceneSceneEditor.SetLogicModifyState(Convert.ToInt32(atlobj.strValues[4]), atlobj.strValues[3]); SceneSceneEditor.SetLogicCurrentColor(stringToColor(atlobj.strValues[1])); SceneSceneEditor.SetCurrentEditBrushIndex(Convert.ToInt32(atlobj.strValues[0])); }
private void buttonOK_Click(object sender, EventArgs e) { if (this.advTreePoly.SelectedNode == null || this.advTreePoly.SelectedNode.Level != 1) { MessageBox.Show("未选中任何多边形/笔刷结点"); return; } _AtlObjInfo selectedinfo = (_AtlObjInfo)this.advTreePoly.SelectedNode.Tag; if (this.advTreePoly.SelectedNode.Parent.Text == "多边形") { selectedinfo.strValues[0] = this.textBoxScript.Text; selectedinfo.strValues[5] = this.textBoxHeight.Text; int iNewMask = 0 + (this.checkBoxBlock.Checked ? LSTATE_BLOCKCHARACTER : 0) + (this.checkBoxPut.Checked ? LSTATE_PUTOBJECT : 0) + (this.checkBoxStall.Checked ? LSTATE_STALL : 0) + (this.checkBoxIndoor.Checked ? LSTATE_INDOOR : 0) + (this.checkBoxRest.Checked ? LSTATE_REST : 0) + (this.checkBoxRideHorse.Checked ? LSTATE_RIDEHORSE : 0); selectedinfo.strValues[3] = iNewMask.ToString(); selectedinfo.strValues[1] = this.textLogicName.Text; selectedinfo.strValues[4] = this.colorPicker.Style.BackColor1.Color.ToArgb().ToString(); SaveLogicInfoUI((_AtlObjInfo)this.advTreePoly.SelectedNode.Tag); } else if (this.advTreePoly.SelectedNode.Parent.Text == "笔刷") { int oldMask = Convert.ToInt32(selectedinfo.strValues[4]); string oldScript = selectedinfo.strValues[3]; selectedinfo.strValues[3] = this.textBoxScript.Text; //selectedinfo.strValues[5] = this.textBoxHeight.Text; int iNewMask = 0 + (this.checkBoxBlock.Checked ? LSTATE_BLOCKCHARACTER : 0) + (this.checkBoxPut.Checked ? LSTATE_PUTOBJECT : 0) + (this.checkBoxStall.Checked ? LSTATE_STALL : 0) + (this.checkBoxIndoor.Checked ? LSTATE_INDOOR : 0) + (this.checkBoxRest.Checked ? LSTATE_REST : 0) + (this.checkBoxRideHorse.Checked ? LSTATE_RIDEHORSE : 0); selectedinfo.strValues[4] = iNewMask.ToString(); selectedinfo.strValues[2] = this.textLogicName.Text; selectedinfo.strValues[1] = this.colorPicker.Style.BackColor1.Color.ToArgb().ToString(); SaveLogicInfoUI((_AtlObjInfo)this.advTreePoly.SelectedNode.Tag); SceneSceneEditor.SetLogicCurrentColor(stringToColor(selectedinfo.strValues[1])); // 中途更新笔刷数据,要把原来刷的也改了,不然会有问题。 SceneSceneEditor.ModifyCurrentCellInfo(SceneSceneEditor.TransToEngineFormat(oldMask), SceneSceneEditor.TransToEngineFormat(iNewMask), oldScript, selectedinfo.strValues[3]); SetLogicSceneEditorBrushState(selectedinfo); } this.advTreePoly.SelectedNode.Text = string.Format("{0}{1}", this.textLogicName.Text, this.textBoxScript.Text.Length > 0 ? " [√]" : string.Empty); this.buttonOK.Enabled = false; }