Skip to content

Commit

Permalink
Merge pull request #276 from ArturM/master
Browse files Browse the repository at this point in the history
Default scene doesn't work on Godot 3.2
  • Loading branch information
StraToN committed Feb 27, 2020
2 parents ca675e9 + c02d733 commit 07e9da9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions device/globals/action_menu.gd
Expand Up @@ -58,8 +58,8 @@ func stop(show_tooltip=true):
if vm.tooltip and ProjectSettings.get_setting("escoria/ui/tooltip_follows_mouse") and show_tooltip:
vm.hover_rebuild()

func set_position(pos):
.set_position(_clamp(pos))
func set_position(pos, keep_margins=false):
.set_position(_clamp(pos), keep_margins)

func _ready():
var acts = get_node("actions")
Expand Down
8 changes: 4 additions & 4 deletions device/globals/global_vm.gd
Expand Up @@ -19,7 +19,7 @@ var customs = []

var event_queue = []

enum acceptable_inputs {INPUT_NONE INPUT_ALL INPUT_SKIP}
enum acceptable_inputs {INPUT_NONE, INPUT_ALL, INPUT_SKIP}
var accept_input = acceptable_inputs.INPUT_ALL

var state_return = 0
Expand Down Expand Up @@ -259,7 +259,7 @@ func hover_rebuild():
if not item.visible:
continue

assert item.rect
assert(item.rect)
if item.rect.has_point($"/root".get_mouse_position()):
vm.hover_push(item)

Expand Down Expand Up @@ -298,7 +298,7 @@ func camera_set_target(p_speed, p_target):
if not camera:
return

assert typeof(p_target) in [TYPE_VECTOR2, TYPE_ARRAY, TYPE_STRING, TYPE_NIL]
assert(typeof(p_target) in [TYPE_VECTOR2, TYPE_ARRAY, TYPE_STRING, TYPE_NIL])

var target = p_target

Expand All @@ -325,7 +325,7 @@ func camera_set_target(p_speed, p_target):
if not target:
report_errors("global_vm", ["Camera target not found: " + cam_target])
else:
assert typeof(target) == TYPE_VECTOR2
assert(typeof(target) == TYPE_VECTOR2)

# Set state for savegames
cam_target = p_target
Expand Down
4 changes: 2 additions & 2 deletions device/globals/interactive.gd
Expand Up @@ -29,7 +29,7 @@ func show_highlight():
return

highlight_tooltip = vm.tooltip.duplicate()
assert highlight_tooltip != vm.tooltip
assert(highlight_tooltip != vm.tooltip)

var tt_pos = $tooltip_pos.global_position
var tt_text = get_tooltip()
Expand All @@ -56,7 +56,7 @@ func hide_highlight():
if not highlight_tooltip:
return

assert highlight_tooltip.visible
assert(highlight_tooltip.visible)

highlight_tooltip.hide()
highlight_tooltip.free()
Expand Down
4 changes: 2 additions & 2 deletions device/globals/item.gd
Expand Up @@ -586,8 +586,8 @@ func _find_sprites(p = null):

func update_rect():
# Called from inventory.gd when items get sorted
assert self.inventory
assert area is TextureRect
assert(self.inventory)
assert(area is TextureRect)

# Now that we know we are TextureRect, create a Rect2 so we can check `.has_point()` when closing the menu
rect = Rect2(area.rect_global_position, area.rect_size)
Expand Down
2 changes: 1 addition & 1 deletion device/globals/main.gd
Expand Up @@ -32,7 +32,7 @@ func set_scene(p_scene, run_events=true):

# Ensure we don't have a regular event running when changing scenes
if vm.running_event:
assert vm.running_event.ev_name == "load"
assert(vm.running_event.ev_name == "load")

if "events_path" in p_scene and p_scene.events_path and run_events:
vm.load_file(p_scene.events_path)
Expand Down
4 changes: 2 additions & 2 deletions device/globals/npc.gd
Expand Up @@ -231,7 +231,7 @@ func show_highlight():
return

highlight_tooltip = vm.tooltip.duplicate()
assert highlight_tooltip != vm.tooltip
assert(highlight_tooltip != vm.tooltip)

var tt_pos = $"tooltip_pos".global_position
var tt_text = get_tooltip()
Expand All @@ -258,7 +258,7 @@ func hide_highlight():
if not highlight_tooltip:
return

assert highlight_tooltip.visible
assert(highlight_tooltip.visible)

highlight_tooltip.hide()
highlight_tooltip.free()
Expand Down
4 changes: 2 additions & 2 deletions device/globals/tooltip.gd
Expand Up @@ -133,7 +133,7 @@ func _clamp(tt_pos):

return tt_pos

func set_position(pos):
func set_position(pos, keep_margins=false):
rect_global_position= _clamp(pos)

func _input(ev):
Expand All @@ -148,4 +148,4 @@ func _ready():
if not highlight_only:
vm.register_tooltip(self)

set_process_input(false)
set_process_input(false)
2 changes: 1 addition & 1 deletion device/globals/trigger.gd
Expand Up @@ -87,7 +87,7 @@ func _physics_process(dt):
func _ready():
var conn_err

assert self is Area2D
assert(self is Area2D)

conn_err = connect("input_event", self, "area_input")
if conn_err:
Expand Down

0 comments on commit 07e9da9

Please sign in to comment.