import { Action } from "../undostack" ; import { GraphicsItem } from "../scene/graphicsitem" ; import { Vector2 , Rect } from "../scene/view" ; import { FrameGraphicsItem } from "../scene/framegraphicsitem" ; import { Editor } from "../editor" ; export class ChangeTextureChannelAction extends Action { ui : ( ) => void ; editor : Editor ; node1 : string ; node2 : string ; channel1 : string ; channel2 : string ; constructor ( ui , editor , node1 , channel1 , node2 , channel2 ) { super ( ) ; this . ui = ui ; this . editor = editor ; this . channel1 = channel1 ; this . channel2 = channel2 ; this . node1 = node1 ; this . node2 = node2 ; } undo ( ) { if ( this . channel1 ) { this . editor . assignNodeToTextureChannel ( this . node1 , this . channel1 ) ; } else { this . editor . clearTextureChannel ( this . node1 ) ; } if ( this . channel2 != null && this . node2 != null ) { this . editor . assignNodeToTextureChannel ( this . node2 , this . channel2 ) ; } if ( this . ui ) this . ui ( ) ; } redo ( ) { if ( this . channel2 == null ) { this . editor . clearTextureChannel ( this . node1 ) ; } else { this . editor . assignNodeToTextureChannel ( this . node1 , this . channel2 ) ; } if ( this . ui ) this . ui ( ) ; } }