diff --git a/Luxe/blocks/ui/adventure.wren b/Luxe/blocks/ui/adventure.wren index 9c59bed..2c75506 100644 --- a/Luxe/blocks/ui/adventure.wren +++ b/Luxe/blocks/ui/adventure.wren @@ -227,14 +227,10 @@ class UiAdventure{ Control.set_size(item, -1, 12) Control.set_allow_input(item, true) Control.set_id(item, "Person %(i) : %(Human.get_name(adventurer))") - System.print(Strings.get(Control.get_id(item))) Control.set_events(item) {|event| if(UI.event_cancelled(_ent, event.id)) return if(!Util.valid_event(event)) return if(event.type == UIEvent.press){ - System.print("entity: %(Strings.get(Control.get_id(item)))") - System.print("focussed: %(UI.get_focused(_ent))") - System.print("event: %(event)") _ui.ui_mode = Ui.Info _ui.info.page.value = UiInfo.human _game.focus.value = adventurer diff --git a/Luxe/blocks/ui/scroll_box.wren b/Luxe/blocks/ui/scroll_box.wren index 9fd11bb..c9f1e8b 100644 --- a/Luxe/blocks/ui/scroll_box.wren +++ b/Luxe/blocks/ui/scroll_box.wren @@ -50,6 +50,23 @@ class UiScrollBox{ UILayout.set_margin(ent, childContainer, 1, 1, 7, 2) //don't include border, fix bottom bug, freedom to side slider Control.set_clip(childContainer, true) UILayout.set_contain(ent, childContainer, UILayoutContain.column | UILayoutContain.start) //| + Control.set_allow_input(childContainer, true) + Control.set_events(childContainer){ |event| + if(event.type == UIEvent.press) { + Control.set_state_data(childContainer, true) + UI.capture(childContainer) + } + if(event.type == UIEvent.release) { + Control.set_state_data(childContainer, false) + UI.uncapture(childContainer) + } + if(event.type == UIEvent.move && Control.get_state_data(childContainer)){ + var state = Control.get_state_data(box) + var scrollPos = state["position"] + scrollPos = scrollPos + event.y_rel + 128 + set_position(box, scrollPos) + } + } state["childContainer"] = childContainer var alignmentChild = Control.create(ent) diff --git a/Luxe/math/event.wren b/Luxe/math/event.wren index 77284b5..e6ffef2 100644 --- a/Luxe/math/event.wren +++ b/Luxe/math/event.wren @@ -30,7 +30,6 @@ class Event{ } } else if(id is Fn){ var removed = false - System.print(_listeners.keys) for(index in _listeners.keys){ if(_listeners[index] == id){ //! this might lead to problems because I'm modifying the thing I'm iterating over