89 lines
No EOL
2.7 KiB
Text
89 lines
No EOL
2.7 KiB
Text
import "luxe: draw" for Draw, PathStyle
|
|
import "luxe: world" for Entity, Transform, UI, UIRenderMode
|
|
import "luxe: world" for UILayout, UILayoutBehave, UILayoutContain
|
|
import "luxe: ui/control" for Control
|
|
import "luxe: ui/panel" for UIPanel
|
|
import "luxe: ui/list" for UIList
|
|
import "luxe: ui/button" for UIButton
|
|
import "luxe: ui/image" for UIImage
|
|
import "luxe: assets" for Assets
|
|
import "luxe: ui/text" for UIText
|
|
import "luxe: render" for Material
|
|
|
|
import "globals" for Globals
|
|
import "blocks/ui/image_button" for ImageButton
|
|
import "math/observable" for Observable
|
|
import "blocks/ui/simple_text" for UISimpleText
|
|
import "blocks/ui" for Ui
|
|
|
|
class UiAdventure{
|
|
root{_root}
|
|
|
|
construct new(ent, ui){
|
|
_ent = ent
|
|
_ui = ui
|
|
|
|
setup()
|
|
}
|
|
|
|
setup(){
|
|
var ui_rect = Globals["UiRect"]
|
|
var game = Globals["Game"]
|
|
|
|
_root = Control.create(_ent)
|
|
Control.set_size(_root, ui_rect.width, ui_rect.height)
|
|
|
|
//list
|
|
var list = Control.create(_ent)
|
|
Control.child_add(_root, list)
|
|
Control.set_size(list, 0, 16)
|
|
UILayout.set_behave(_ent, list, UILayoutBehave.left | UILayoutBehave.right | UILayoutBehave.bottom)//|
|
|
UILayout.set_margin(_ent, list, 0, 0, 0, 0)
|
|
UILayout.set_contain(_ent, list, UILayoutContain.row | UILayoutContain.start) //|
|
|
|
|
var adventureButtons = Assets.image("assets/AdventureButtons")
|
|
var tiles = [10, 1]
|
|
var button
|
|
|
|
//back to info
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "Info")
|
|
ImageButton.set_tile_uv(button, tiles, [1, 0])
|
|
ImageButton.set_state_change(button) { |data|
|
|
if(data["press"]){
|
|
_ui.ui_mode = Ui.Info
|
|
}
|
|
}
|
|
|
|
//abort
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "Abort")
|
|
ImageButton.set_tile_uv(button, tiles, [0, 0])
|
|
|
|
//people
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "People")
|
|
ImageButton.set_tile_uv(button, tiles, [2, 0])
|
|
|
|
//stuff
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "Stuff")
|
|
ImageButton.set_tile_uv(button, tiles, [4, 0])
|
|
|
|
//direction
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "Direction")
|
|
ImageButton.set_tile_uv(button, tiles, [3, 0])
|
|
|
|
//go
|
|
button = _ui.list_button(list)
|
|
UIImage.set_image(button, adventureButtons)
|
|
ImageButton.set_tooltip(button, "Depart")
|
|
ImageButton.set_tile_uv(button, tiles, [5, 0])
|
|
}
|
|
} |