More work on dialogue, portraits, customizer and intro
This commit is contained in:
@@ -46,18 +46,23 @@ func generate_waypoints():
|
||||
waypoints = []
|
||||
|
||||
#Include the "end" in the count
|
||||
var num = quest.num_events()+1
|
||||
for i in range(1,num):
|
||||
var pct : float = i / float(num)
|
||||
add_waypoint( pct, quest.events[i-1])
|
||||
var num = quest.num_events()
|
||||
#add_waypoint(0, Quest.Event.new())
|
||||
#waypoints[0].
|
||||
for evt : Quest.Event in quest.events:
|
||||
add_waypoint( evt.progress_point, evt)
|
||||
#add_waypoint(1, Quest.Event.new())
|
||||
|
||||
func add_waypoint(pct : float, event : Quest.Event):
|
||||
var wp = waypoint_template.instantiate()
|
||||
|
||||
waypoints.append(wp)
|
||||
wp.percent = pct
|
||||
#TODO: Make events matter
|
||||
wp.event = event
|
||||
%Waypoints.add_child(wp)
|
||||
if event.hidden:
|
||||
wp.visible = false
|
||||
wp.global_position = %Waypoints.global_position + Vector2(pct * length - 16, -9)
|
||||
if bar.value / bar.max_value >= pct:
|
||||
wp.fill = true
|
||||
@@ -86,7 +91,10 @@ func setup(quest : Quest) -> void:
|
||||
|
||||
func progress_quest() -> void:
|
||||
var pct = time_elapsed / quest.length
|
||||
quest.progress = pct
|
||||
if next_waypoint < len(waypoints) and pct >= waypoints[next_waypoint].percent:
|
||||
if waypoints[next_waypoint].visible == false:
|
||||
waypoints[next_waypoint].visible = true
|
||||
start_event(waypoints[next_waypoint].event, (pct - waypoints[next_waypoint].percent) * quest.length)
|
||||
pct = waypoints[next_waypoint].percent
|
||||
waypoints[next_waypoint].blink(true)
|
||||
|
||||
Reference in New Issue
Block a user