Disable swipe hacks for now, enable mouse clicking on menu
This commit is contained in:
parent
835c49da11
commit
c77985f8cb
|
@ -74,8 +74,8 @@ var fps: float = 0.0
|
||||||
var audio_latency: float = 0.0
|
var audio_latency: float = 0.0
|
||||||
func _draw():
|
func _draw():
|
||||||
set_text('FPS: %.0f\nAudio Latency: %.2fms'%[fps, audio_latency*1000])
|
set_text('FPS: %.0f\nAudio Latency: %.2fms'%[fps, audio_latency*1000])
|
||||||
var swipe_origin = Vector2(300, 540)
|
# var swipe_origin = Vector2(300, 540)
|
||||||
draw_line(swipe_origin, swipe_origin+swipe_momentum, Color.red)
|
# draw_line(swipe_origin, swipe_origin+swipe_momentum, Color.red)
|
||||||
|
|
||||||
# draw points
|
# draw points
|
||||||
for i in touch_points:
|
for i in touch_points:
|
||||||
|
|
|
@ -21,13 +21,13 @@ var currently_playing := false
|
||||||
var selected_genre: int = 0
|
var selected_genre: int = 0
|
||||||
var selected_genre_vis: int = 0
|
var selected_genre_vis: int = 0
|
||||||
var selected_genre_delta: float = 0.0 # For floaty display scrolling
|
var selected_genre_delta: float = 0.0 # For floaty display scrolling
|
||||||
var target_song_idx: int = 0 setget set_target_song_idx
|
var target_song_idx: float = 0.0 setget set_target_song_idx
|
||||||
var target_song_delta: float = 0.0 # For floaty display scrolling
|
var target_song_delta: float = 0.0 # For floaty display scrolling
|
||||||
var selected_song_idx: int setget , get_song_idx
|
var selected_song_idx: int setget , get_song_idx
|
||||||
var selected_song_key: String setget , get_song_key
|
var selected_song_key: String setget , get_song_key
|
||||||
var selected_difficulty = ChartDifficulty.ADV
|
var selected_difficulty = ChartDifficulty.ADV
|
||||||
|
|
||||||
func set_target_song_idx(index: int):
|
func set_target_song_idx(index):
|
||||||
target_song_delta -= index - target_song_idx
|
target_song_delta -= index - target_song_idx
|
||||||
target_song_idx = index
|
target_song_idx = index
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func get_song_idx() -> int:
|
||||||
|
|
||||||
func get_song_key() -> String:
|
func get_song_key() -> String:
|
||||||
var songslist = genres[genres.keys()[selected_genre]]
|
var songslist = genres[genres.keys()[selected_genre]]
|
||||||
return songslist[self.target_song_idx % len(songslist)]
|
return songslist[int(round(self.target_song_idx)) % len(songslist)]
|
||||||
|
|
||||||
var scorescreen_song_key := ''
|
var scorescreen_song_key := ''
|
||||||
var scorescreen_score_data := {}
|
var scorescreen_score_data := {}
|
||||||
|
@ -117,8 +117,11 @@ func _ready():
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
# var swipe: Vector2 = $'../InputHandler'.swipe_momentum
|
||||||
|
# if abs(swipe.x) > 10:
|
||||||
|
# target_song_delta += swipe.x * 0.1 * delta
|
||||||
|
# else:
|
||||||
target_song_delta -= ease_curve.interpolate(clamp(target_song_delta, -2, 2)*0.5) * 10 * delta
|
target_song_delta -= ease_curve.interpolate(clamp(target_song_delta, -2, 2)*0.5) * 10 * delta
|
||||||
# target_song_delta += $'../InputHandler'.swipe_momentum.x * 1
|
|
||||||
if abs(target_song_delta) < 0.02: # Snap
|
if abs(target_song_delta) < 0.02: # Snap
|
||||||
target_song_delta = 0.0
|
target_song_delta = 0.0
|
||||||
|
|
||||||
|
@ -137,11 +140,10 @@ func _process(delta):
|
||||||
menu_mode_prev_fade_timer = max(0.0, menu_mode_prev_fade_timer - delta)
|
menu_mode_prev_fade_timer = max(0.0, menu_mode_prev_fade_timer - delta)
|
||||||
update()
|
update()
|
||||||
if (menu_mode == MenuMode.GAMEPLAY) and (menu_mode_prev_fade_timer <= 0.0) and not NoteHandler.running:
|
if (menu_mode == MenuMode.GAMEPLAY) and (menu_mode_prev_fade_timer <= 0.0) and not NoteHandler.running:
|
||||||
var songslist = genres[genres.keys()[selected_genre]]
|
NoteHandler.load_track(self.selected_song_key, Library.Song.default_difficulty_keys[selected_difficulty])
|
||||||
var song_key = songslist[self.target_song_idx % len(songslist)]
|
|
||||||
NoteHandler.load_track(song_key, Library.Song.default_difficulty_keys[selected_difficulty])
|
|
||||||
NoteHandler.running = true
|
NoteHandler.running = true
|
||||||
|
|
||||||
|
|
||||||
func draw_string_centered(font, position, string, color := GameTheme.COLOR_MENU_TEXT):
|
func draw_string_centered(font, position, string, color := GameTheme.COLOR_MENU_TEXT):
|
||||||
draw_string(font, Vector2(position.x - font.get_string_size(string).x/2.0, position.y + font.get_ascent()).round(), string, color)
|
draw_string(font, Vector2(position.x - font.get_string_size(string).x/2.0, position.y + font.get_ascent()).round(), string, color)
|
||||||
|
|
||||||
|
@ -499,7 +501,7 @@ func finished_song(song_key, score_data):
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if !visible:
|
if !visible:
|
||||||
return
|
return
|
||||||
if event is InputEventScreenTouch:
|
if (event is InputEventScreenTouch) or (event is InputEventMouseButton):
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
var pos = event.position - get_global_transform_with_canvas().get_origin()
|
var pos = event.position - get_global_transform_with_canvas().get_origin()
|
||||||
match menu_mode:
|
match menu_mode:
|
||||||
|
|
Loading…
Reference in New Issue