X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=blobdiff_plain;f=_UIImplementation.pde;h=1257f6fffd435068e0387f860174dedbbe2eeaf7;hp=3f0c630b8fa2f37c7c0ad39cc4498fd113a0c1ac;hb=3f16fd027656eaca0ed62f9c90c4da56385bb3bf;hpb=dde759833df1c0190d9d3a982a90c0a4f8d76a26 diff --git a/_UIImplementation.pde b/_UIImplementation.pde index 3f0c630..1257f6f 100644 --- a/_UIImplementation.pde +++ b/_UIImplementation.pde @@ -15,8 +15,9 @@ class UIBlendMode extends UIWindow { public UIBlendMode(float x, float y, float w, float h) { super(lx.ui, "BLEND MODE", x, y, w, h); List items = new ArrayList(); - for (LXTransition t : glucose.getTransitions()) { - items.add(new TransitionScrollItem(t)); + int i = 0; + for (LXTransition t : transitions) { + items.add(new TransitionScrollItem(t, i++)); } final UIScrollList tList; (tList = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 60)).setItems(items).addToContainer(this); @@ -30,11 +31,13 @@ class UIBlendMode extends UIWindow { class TransitionScrollItem extends UIScrollList.AbstractItem { private final LXTransition transition; - private String label; + private final int index; + private final String label; - TransitionScrollItem(LXTransition transition) { + TransitionScrollItem(LXTransition transition, int index) { this.transition = transition; - label = className(transition, "Transition"); + this.index = index; + this.label = className(transition, "Transition"); } public String getLabel() { @@ -42,7 +45,7 @@ class UIBlendMode extends UIWindow { } public boolean isSelected() { - return transition == glucose.getSelectedTransition(); + return index == activeTransition.getValuei(); } public boolean isPending() { @@ -50,7 +53,7 @@ class UIBlendMode extends UIWindow { } public void onMousePressed() { - glucose.setSelectedTransition(transition); + activeTransition.setValue(this.index); } }