protected override void OnAssignSlot(int id, Inventory.Entry entry) { base.OnAssignSlot(id, entry); if (entry == null || !entry.IsValid) { SplineManager.DestroyRoad(id); return; } SplineRoad splineRoad = SplineManager.GetRoadFromId(id); if (!splineRoad.IsValid) { splineRoad = SplineManager.CreateRoad(id); } SplineInventory.Entry entry2 = (SplineInventory.Entry)entry; splineRoad.Entry = entry2; splineRoad.Width = entry2.DefaultWidth; splineRoad.UpdateSpline(); }
private void AssignSplineId(int id, SplineInventory.Entry entry) { Win32.SetRedraw(this, false); UndoManager.RecordUndo(); if (!entry.IsValid) { SplineManager.DestroyRoad(id); } else { SplineRoad splineRoad = SplineManager.GetRoadFromId(id); if (!splineRoad.IsValid) { splineRoad = SplineManager.CreateRoad(id); } splineRoad.Entry = entry; splineRoad.UpdateSpline(); } UndoManager.CommitUndo(); this.UpdateList(); Win32.SetRedraw(this, true); this.Refresh(); }