package Ġcom . so yle . stories . desktop . config . drivers . character Ċ Ċ import Ġcom . so yle . stories . character . list . Character List State Ċ import Ġcom . so yle . stories . character . list . Character ListView Ċ import Ġcom . so yle . stories . character . rename . Rename Character Form Ċ import Ġcom . so yle . stories . character arc . character List . Character Arc Item ViewModel Ċ import Ġcom . so yle . stories . character arc . character List . Character Item ViewModel Ċ import Ġcom . so yle . stories . desktop . config . drivers . robot Ċ import Ġcom . so yle . stories . desktop . config . drivers . so yle stories . find MenuItem ById Ċ import Ġcom . so yle . stories . desktop . view . character . list . Character ListView Access . Companion . access Ċ import Ġcom . so yle . stories . desktop . view . character . list . Character ListView Access . Companion . drive Ċ import Ġcom . so yle . stories . desktop . view . project . workbench . get Open Dialog Ċ import Ġcom . so yle . stories . di . get Ċ import Ġcom . so yle . stories . domain . character . Character Ċ import Ġcom . so yle . stories . domain . theme . Theme Ċ import Ġcom . so yle . stories . project . Work Bench Ċ import Ġt orn ad of x . FX Ċ import Ġt orn ad of x . to Property Ċ Ċ fun ĠWork Bench . given Character List Tool HasBeen Opened (): ĠCharacter ListView Ġ= ĊĠĠĠ Ġget Character List Tool () Ġ?: Ġopen Character List Tool (). let Ġ{ Ġget Character List Tool Or Error () Ġ} Ċ Ċ fun ĠWork Bench . get Character List Tool Or Error (): ĠCharacter ListView Ġ= ĊĠĠĠ Ġget Character List Tool () Ġ?: Ġthrow ĠNoSuch ElementException (" Theme ĠList Ġhas Ġnot Ġbeen Ġopened ") Ċ Ċ fun ĠWork Bench . get Character List Tool (): ĠCharacter ListView ? Ġ{ ĊĠĠĠ Ġreturn Ġ( FX . get Components ( scope )[ Character ListView :: class ] Ġas ? ĠCharacter ListView )?. take If Ġ{ Ġit . current Stage ?. is Showing Ġ== Ġtrue Ġ} Ċ } Ċ Ċ fun ĠWork Bench . open Character List Tool () Ġ{ ĊĠĠĠ Ġfind MenuItem ById (" tools _ character list ") !! ĊĠĠĠĠĠĠĠ Ġ. apply Ġ{ Ġrobot . interact Ġ{ Ġfire () Ġ} Ġ} Ċ } Ċ Ċ fun ĠCharacter ListView . rename Character ( character Id : ĠCharacter . Id ): ĠRename Character Form ? Ġ{ ĊĠĠĠ Ġreturn Ġwith ( access ()) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitem Ġ= Ġget Character Item Or Error ( character Id ) ĊĠĠĠĠĠĠĠ Ġdrive Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġselect Item ( item ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrename Option Item Ġ= Ġwith ( options Button !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshow () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrename Option !! ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrename Option Item . fire () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġget Open Dialog < Rename Character Form >() ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠCharacter ListView . open Create Character Arc Dialog For ( character Id : ĠCharacter . Id ) Ġ{ ĊĠĠĠ Ġdrive Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitem Ġ= Ġget Character Item Or Error ( character Id ) ĊĠĠĠĠĠĠĠ Ġselect Item ( item ) ĊĠĠĠĠĠĠĠ Ġval Ġnew Character Arc Option Ġ= Ġwith ( options Button !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnew Character Arc Option !! ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġnew Character Arc Option . fire () ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠCharacter ListView . select Item ( character Item ViewModel : ĠCharacter Item ViewModel ) Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġscope . get < Character List State >() ĊĠĠĠ Ġstate . selected Character ListItem . set ( ĊĠĠĠĠĠĠĠ Ġstate . characters . find Ġ{ Ġit . character . value . character Id Ġ== Ġcharacter Item ViewModel . character Id Ġ} ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun ĠCharacter ListView . select Item ( character Arc Item ViewModel : ĠCharacter Arc Item ViewModel ) Ġ{ ĊĠĠĠ Ġval Ġstate Ġ= Ġscope . get < Character List State >() ĊĠĠĠ Ġstate . selected Character ListItem . set ( ĊĠĠĠĠĠĠĠ Ġstate . characters . as Sequence (). flatMap Ġ{ Ġit . arcs . as Sequence () Ġ}. find Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . arc . value . character Id Ġ== Ġcharacter Arc Item ViewModel . character Id Ġ&& Ġit . arc . value . theme Id Ġ== Ġcharacter Arc Item ViewModel . theme Id ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun ĠCharacter ListView . delete Character Arc ( character Id : ĠCharacter . Id , Ġtheme Id : ĠTheme . Id ) Ġ{ ĊĠĠĠ Ġdrive Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitem Ġ= Ġget Arc Item Or Error ( character Id , Ġtheme Id ) ĊĠĠĠĠĠĠĠ Ġselect Item ( item ) ĊĠĠĠĠĠĠĠ Ġval Ġdelete Option Item Ġ= Ġwith ( options Button !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelete Option !! ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġdelete Option Item . fire () ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠCharacter ListView . open Character Profile For ( character : ĠCharacter ) Ġ{ ĊĠĠĠ Ġdrive Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitem Ġ= Ġget Character Item ( character . id ) !! ĊĠĠĠĠĠĠĠ Ġselect Item ( item ) ĊĠĠĠĠĠĠĠ Ġval Ġprofile Option Item Ġ= Ġwith ( options Button !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprofile Option !! ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġprofile Option Item . fire () ĊĠĠĠ Ġ} Ċ }