Skip to content

Commit

Permalink
Duplicate existing description when adding a new description part
Browse files Browse the repository at this point in the history
  • Loading branch information
iminashi committed Jul 6, 2024
1 parent a15fcc6 commit ba43fe6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion samples/DLCBuilder.Domain/EditFunctions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ let editTone state edit index =
{ tone with Volume = -volume }

| AddDescriptor ->
{ tone with ToneDescriptors = tone.ToneDescriptors |> Array.append [| ToneDescriptor.all[0].UIName |] }
let newToneDescriptor =
tone.ToneDescriptors
|> Array.tryHead
|> Option.defaultValue ToneDescriptor.all[0].UIName

{ tone with
ToneDescriptors = Array.insertAt 0 newToneDescriptor tone.ToneDescriptors }

| RemoveDescriptor ->
{ tone with ToneDescriptors = tone.ToneDescriptors[1..] }
Expand Down

0 comments on commit ba43fe6

Please sign in to comment.