finally fix input fuckery
This commit is contained in:
parent
17f09faca5
commit
0744070143
3 changed files with 18 additions and 23 deletions
|
|
@ -48,7 +48,7 @@ class Ui{
|
|||
Control.set_size(root, ui_rect.width, ui_rect.height)
|
||||
|
||||
//list
|
||||
var list = UIList.create(_ui)
|
||||
var list = Control.create(_ui)
|
||||
Control.set_id(list, "info list")
|
||||
Control.child_add(root, list)
|
||||
//todo: make list horizontal?
|
||||
|
|
@ -70,7 +70,7 @@ class Ui{
|
|||
ui_mode = Ui.Planning
|
||||
}
|
||||
}
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
|
||||
//info
|
||||
button = list_button(1)
|
||||
|
|
@ -78,7 +78,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Stats")
|
||||
ImageButton.set_tile_uv(button, tiles, [2, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
|
||||
//read diary
|
||||
button = list_button(2)
|
||||
|
|
@ -86,7 +86,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Diary")
|
||||
ImageButton.set_tile_uv(button, tiles, [1, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
|
||||
//UIList.refresh(list) //uncomment this when list learns not to be vertical
|
||||
return root
|
||||
|
|
@ -100,9 +100,8 @@ class Ui{
|
|||
Control.set_size(root, ui_rect.width, ui_rect.height)
|
||||
|
||||
//list
|
||||
var list = UIList.create(_ui)
|
||||
var list = Control.create(_ui)
|
||||
Control.child_add(root, list)
|
||||
//todo: make list horizontal?
|
||||
Control.set_pos(list, 0, ui_rect.height-16)
|
||||
Control.set_size(list, ui_rect.width, 16)
|
||||
|
||||
|
|
@ -123,7 +122,7 @@ class Ui{
|
|||
ui_mode = Ui.Info
|
||||
}
|
||||
}
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//abort
|
||||
|
|
@ -132,7 +131,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Abort")
|
||||
ImageButton.set_tile_uv(button, tiles, [0, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//people
|
||||
|
|
@ -141,7 +140,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Adventurers")
|
||||
ImageButton.set_tile_uv(button, tiles, [2, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//stuff
|
||||
|
|
@ -150,7 +149,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Stuff")
|
||||
ImageButton.set_tile_uv(button, tiles, [4, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//direction
|
||||
|
|
@ -159,7 +158,7 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Direction")
|
||||
ImageButton.set_tile_uv(button, tiles, [3, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//go
|
||||
|
|
@ -168,11 +167,9 @@ class Ui{
|
|||
UIImage.set_image(button, adventureButtons)
|
||||
ImageButton.set_tooltip(button, "Depart")
|
||||
ImageButton.set_tile_uv(button, tiles, [5, 0])
|
||||
UIList.add(list, button)
|
||||
Control.child_add(list, button)
|
||||
list_id = list_id+1
|
||||
|
||||
//UIList.refresh(list) //uncomment this when list learns not to be vertical
|
||||
|
||||
return root
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,16 +70,14 @@ class Renderer {
|
|||
}
|
||||
|
||||
game_mouse(mouse_pos){
|
||||
//this is super inflexible, help :(
|
||||
var pixel_game_rect = Globals["GameRect"]
|
||||
|
||||
var game_rect = AABB.new(_texRect.min_x + pixel_game_rect.min_x * _pixel_size,
|
||||
_texRect.min_y + pixel_game_rect.min_y * _pixel_size,
|
||||
pixel_game_rect.width * _pixel_size, pixel_game_rect.width * _pixel_size)
|
||||
var window = AABB.new(0, 0, Render.window_w(), Render.window_h())
|
||||
//what a mess :/
|
||||
var screen = AABB.new(_texRect.min_x + pixel_game_rect.min_x * _pixel_size,
|
||||
Render.window_h() - (_texRect.min_y + pixel_game_rect.max_y * _pixel_size),
|
||||
pixel_game_rect.width * _pixel_size, pixel_game_rect.height * _pixel_size)
|
||||
|
||||
var point = M.inv_lerp(game_rect.min, game_rect.max, mouse_pos)
|
||||
//System.print(point)
|
||||
return point
|
||||
return M.remap(screen.min, screen.max, window.min, window.max, mouse_pos)
|
||||
}
|
||||
|
||||
ui_mouse(mouse_pos){
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ engine = {
|
|||
depth = 0
|
||||
}
|
||||
|
||||
ui.debug_vis = true
|
||||
//ui.debug_vis = true
|
||||
}
|
||||
Loading…
Reference in a new issue