Chart language selection

This commit is contained in:
Luke Hubmayer-Werner 2021-01-21 19:47:21 +10:30
parent 7a099f19ae
commit 4cd369013f
4 changed files with 29 additions and 11 deletions

View File

@ -242,6 +242,26 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="Label4" type="Label" parent="InputHandler"]
margin_top = 293.0
margin_right = 133.0
margin_bottom = 254.0
text = "Language"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BtnLanguage" type="OptionButton" parent="InputHandler"]
margin_left = 65.0
margin_top = 290.0
margin_right = 200.0
margin_bottom = 310.0
text = "Native"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VsyncButton" type="CheckButton" parent="InputHandler"] [node name="VsyncButton" type="CheckButton" parent="InputHandler"]
margin_top = 90.0 margin_top = 90.0
margin_right = 117.0 margin_right = 117.0

View File

@ -159,7 +159,7 @@ func draw_songtile(song_key, position, size, title_text:=false, difficulty=selec
if disabled: if disabled:
draw_string_centered(DiffNumFont, Vector2(position.x+size/2, position.y+size/2-16), 'No Chart!', diff_color) draw_string_centered(DiffNumFont, Vector2(position.x+size/2, position.y+size/2-16), 'No Chart!', diff_color)
if title_text: if title_text:
draw_string_centered(TitleFont, Vector2(position.x+size/2.0, position.y+size), Library.all_songs[song_key].title.n, diff_color.lightened(0.33)) draw_string_centered(TitleFont, Vector2(position.x+size/2.0, position.y+size), str(Library.all_songs[song_key].title), diff_color.lightened(0.33))
return rect return rect
func diff_f2str(difficulty: float): # Convert .5 to + func diff_f2str(difficulty: float): # Convert .5 to +
@ -230,7 +230,7 @@ func _draw_chart_select(center: Vector2) -> Array:
var r = draw_songtile(selected_song_key, Vector2(x, center.y), size, false, i_diff, width, not chart_exists) var r = draw_songtile(selected_song_key, Vector2(x, center.y), size, false, i_diff, width, not chart_exists)
touchrects.append({rect=r, chart_idx=i_diff, enabled=chart_exists}) touchrects.append({rect=r, chart_idx=i_diff, enabled=chart_exists})
x += size + spacer_x x += size + spacer_x
draw_string_centered(TitleFont, Vector2(center.x, center.y+size+32), Library.all_songs[selected_song_key].title.n) draw_string_centered(TitleFont, Vector2(center.x, center.y+size+32), str(Library.all_songs[selected_song_key].title))
draw_string_centered(TitleFont, Vector2(center.x-50, center.y+size+80), 'BPM:') draw_string_centered(TitleFont, Vector2(center.x-50, center.y+size+80), 'BPM:')
draw_string_centered(TitleFont, Vector2(center.x+50, center.y+size+80), str(song_data.BPM)) draw_string_centered(TitleFont, Vector2(center.x+50, center.y+size+80), str(song_data.BPM))
@ -278,7 +278,7 @@ func _draw_score_screen(center: Vector2) -> Array:
var judgement_text_height = 64 * judgement_text_scale var judgement_text_height = 64 * judgement_text_scale
draw_songtile(song_key, Vector2(x_songtile-size/2.0, y), size, false, selected_difficulty, 3) draw_songtile(song_key, Vector2(x_songtile-size/2.0, y), size, false, selected_difficulty, 3)
draw_string_centered(TitleFont, Vector2(x_songtile, y+size), Library.all_songs[song_key].title.n) draw_string_centered(TitleFont, Vector2(x_songtile, y+size), str(Library.all_songs[song_key].title))
var notestrs = ['Taps (%d):'%meta.num_taps, 'Holds (%d) Hit:'%meta.num_holds, 'Released:', 'Stars (%d):'%meta.num_slides, 'Slides:'] var notestrs = ['Taps (%d):'%meta.num_taps, 'Holds (%d) Hit:'%meta.num_holds, 'Released:', 'Stars (%d):'%meta.num_slides, 'Slides:']
var notetypes = [0, 1, -1, 2, -2] var notetypes = [0, 1, -1, 2, -2]
var note_spacing = [0.0, 1.25, 2.25, 3.5, 4.5] var note_spacing = [0.0, 1.25, 2.25, 3.5, 4.5]

View File

@ -145,6 +145,8 @@ const NORMAL_ARRAY_8 := PoolVector3Array([
DEFAULT_NORMAL, DEFAULT_NORMAL, DEFAULT_NORMAL, DEFAULT_NORMAL DEFAULT_NORMAL, DEFAULT_NORMAL, DEFAULT_NORMAL, DEFAULT_NORMAL
]) ])
var display_language = 'n'
var screen_filter_min_alpha := 0.2 var screen_filter_min_alpha := 0.2
var screen_filter := Color(0.0, 0.0, 0.0, screen_filter_min_alpha) var screen_filter := Color(0.0, 0.0, 0.0, screen_filter_min_alpha)
signal screen_filter_changed() signal screen_filter_changed()

View File

@ -15,22 +15,18 @@ class MultilangStr:
self.tl = translit self.tl = translit
if english and not english.empty(): if english and not english.empty():
self.en = english self.en = english
# func get_native() -> String:
# return n
# func get_translit() -> String:
# return tl if tl else n
# func get_english() -> String:
# return en if en else self.tl
func set_native(native) -> void: func set_native(native) -> void:
n = native n = native
if tl.empty(): if tl.empty():
tl = native set_translit(native)
func set_translit(translit) -> void: func set_translit(translit) -> void:
tl = translit tl = translit
if en.empty(): if en.empty():
en = translit set_english(translit)
func set_english(english) -> void: func set_english(english) -> void:
en = english en = english
func _to_string() -> String:
return self[GameTheme.display_language]
class Song: class Song:
var title: MultilangStr var title: MultilangStr