Skip to content

Commit

Permalink
fix cpm/accuracy crashed when reset stats and add another exercise le…
Browse files Browse the repository at this point in the history
…sson
  • Loading branch information
stmSi committed Jun 18, 2024
1 parent 0e2b620 commit c57c0e6
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 54 deletions.
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000005.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("", "", "", "")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=false
message="နောက်ထပ် အလွယ်ကူသော အက္ခရာ
\"ဆ တ သ စ\"
Expand Down
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000006.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("", "", "", "")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=true
message=""
hide_keyboard=false
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000008.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("ဆတသစ", "စတသဆ", "သတဆစ", "တသဆစ", "ဆစတသ", "စတဆသ", "သစတဆ", "ဆတသစ")
repeats=1.0
allow_mistakes=80.0
repeats=1
allow_mistakes=80
randomize=true
message="Keyboard ဖျောက်ပြီး စမ်း ရိုက်ကြည့် ရအောင်
မြန်ဖို့မလို မှန်မှန်သာ ရိုက်ပါ။"
Expand Down
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000009.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("စမင", "ဆတ", "ကတ", "သတက", "ကသ", "မစင", "ကတသ", "မနတဆကငသစ", "ကမနငတသဆစ", "စသငကဆတနမ", "ဆစတသနငမက", "တသနငမကဆစ", "စတသငက", "တဆငနမ", "နငမကတသဆစ", "သတဆစမကနင", "ဆကတငနသမစ", "ဆတစသကငမန")
repeats=1.0
allow_mistakes=80.0
repeats=1
allow_mistakes=80
randomize=true
message="လေ့လာပြီးသော
\"ဆ တ န မ က င သ စ\"
Expand Down
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000010.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("နိ", "မိ", "တိ", "ဆိ", "ကိ", "ငိ", "သိ", "စိ", "တိတိ", "သိသိ", "ကိတိ", "ကတိ", "သတိ", "တိကိသိစိ", "နိစိသိကိ", "ဆိသိကိနိ", "ကသိတိနိ")
repeats=1.0
allow_mistakes=80.0
repeats=1
allow_mistakes=80
randomize=false
message="\" ိ \" ကို သုံးပြီး လေ့ကျင့်ပြီးသား အက္ခရာများနဲ့ လေ့ကျင့်ရအောင်"
hide_keyboard=false
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000012.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("သိ", "ငင်", "တင်", "သမ်", "သိမ်", "တိမ်", "ကိမ်", "စမ်", "နန်", "မန်", "တန်", "သိမ်မိန်", "တိမ်သိတ်", "ဆိတ်သတ်", "တိတ်သက်", "သင်ကန်", "သန်တင်")
repeats=1.0
allow_mistakes=80.0
repeats=1
allow_mistakes=80
randomize=false
message="အကုန် ပေါင်းပြီး ပြန် လေ့ကျင့်ရအောင်"
hide_keyboard=false
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000013.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("", "", "", "")
repeats=3.0
allow_mistakes=80.0
repeats=3
allow_mistakes=80
randomize=false
hide_keyboard=false
message="\" လ ည အ ပ \" လေးလုံးကို လေ့ကျင့်ရအောင်"
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000015.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("ဆိုင်", "တိုင်", "သူ", "တုပ", "အမူ", "အကူ", "အတူ", "ကူး", "ကင်း", "တိုင်း", "လည်း", "သိမ်း", "တိမ်း", "နန်း", "တန်း", "ဆန်း", "သန်း", "ငူ", "နုတ်နုတ်", "နုတ်နုတ်စင်းသည်")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=false
hide_keyboard=false
message="\" ု ူ း \" သုံးလုံး လေ့လာရအောင်"
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000016.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("ကား", "သား", "စား", "ငါ", "ငါး", "ဆား", "ပါ", "တင်ပါး", "အား", "သိုင်းသမား", "ကစား", "စကား", "တာ", "ခါး", "တား", "စပါး")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=false
hide_keyboard=false
message="\" ာ ါ \" နှစ်မျိုး လေ့လာရအောင်"
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000017.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("", "ဖိုးဖိုး", "ဖား", "ဖုတ်", "ဖိမိ", "", "ထိုင်", "ထိထိမိမိ", "ထိုးသား", "ထားထားပါ", "ထိထိမိမိ", "ဖိမိထိမိ", "ထမင်းစား", "ထူး", "ထား", "", "ခင်ခင်မင်မင်", "ခါးနာ", "ထမင်းခူး", "", "လိမ်", "လူးလိမ့်", "လင်းလက်ထင်းထိန်", "လိမ်လိမ်မာမာ", "", "ထခဖလ", "ခလဖလ", "လလထဖခခဖထ")
repeats=1.0
allow_mistakes=80.0
repeats=1
allow_mistakes=80
randomize=false
hide_keyboard=false
message="\" ဖ ထ ခ လ ည\" များလေ့လာရအောင်"
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000018.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("စုံစုံလင်လင်", "နိုင်ငံ", "ပြည်", "ခြင်", "ခြား", "စမ်းမြမြ", "လူ့", "အချို့", "ကြိုတင်", "အမြင့်", "ဖြည်ထုတ်", "ဖြည်းဖြည်း", "ပိုင့်", "အခြား", "စိမ့်စိမ့်", "အံ့", "အဆိုးအမြင့်", "ကြီးကြီးမားမား", "ကြီးမြင့်")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=false
hide_keyboard=false
message="နောက်ထပ် \" ့ ံ ြ \" များ ဆက်လက်လေ့လာရအောင်"
4 changes: 2 additions & 2 deletions Texts/Lessons/Basic/00000019.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Exercise]

texts=PackedStringArray("", "", "", "", "ဒို့", "ဒိုင်", "ဒါ", "ဒီ", "ဓိ", "အဓိက", "ဓာတ်", "ဒိုးမတ်", "ဓာတ်ဆီဆိုင်", "ဒီး", "ဓာတ်ကြီး", "", "", "", "", "ဗိုလ်", "ဗိုက်", "ဗိုလ်ကြီး", "ဗန်း", "ဗဟုသုတ", "ဗဟို")
repeats=2.0
allow_mistakes=80.0
repeats=2
allow_mistakes=80
randomize=false
hide_keyboard=false
message="အက္ခရာ အသစ်လေးလုံး \"ဗ ဒ ဓ ဂ\" ဆက်လက်လေ့လာရအောာင်။"
4 changes: 2 additions & 2 deletions Texts/Lessons/Extra/00000015.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Exercise]

texts=PackedStringArray("ဖိုးသာထူး", "ဖိုးသာထူး ဖိုးသာထူး၊", "အလွန်ဝတဲ့ ဖိုးသာထူး။", "ဖိုးသာထူး ဝမ်းပူပူ၊", "ဖိုးဝကြီးနဲ့တူ။", "တူပါသကွဲ့ မယုံငြား၊", "သည်မှာ ကြည့်ပါသလား။", "တောင် တောရယ် သာ", "မာလာက ငုံဖူး။", "တစ်ပင်ကို နှစ်ပင်ယှက်တယ်၊", "ကျေးငှက်က မြူး။")
repeats=0.0
allow_mistakes=80.0
repeats=0
allow_mistakes=80
randomize=false
hide_keyboard=false
6 changes: 3 additions & 3 deletions Texts/Lessons/Extra/00000050.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Exercise]

texts=PackedStringArray("နွေဦးကာက မြူထသောအခါ")
repeats=0.0
allow_mistakes=80.0
texts=PackedStringArray("နွေဦးကာက မြူထသောအခါ", "ရင်းထောင်ရင်းဆွဲ၊ ဆောင်မြဲအိုးလွယ်ကာ", "ဓားနှီးထက်စွာ၊ ခါးမှာချပ်လျက်", "ထန်းပွင့်ထန်းခိုင်၊ ရွှန်းမြိုင်မြိုင်", "ကလိုင်သာလွယ်လို့ တက်သည်နှင့်လေး။", "ထန်းပင်ထန်းလက်၊ ထန်းရွက်ကယ်ဝေဝေ", "စင်အောင်ခုတ်ထစ်၊ နုမျစ်ကယ်ထန်းဦးရေ", "မယားငယ်ဆွေ။ ထန်းရေသိမ်းဆည်း", "သားမြေးဟစ်ကြော်၊ ခွေးဝက်ကယ်ခေါ်", "ထန်းလျှော်သာ ယုန်ပိုက်စည်းငယ်နှင့်လေး။", "ခေါ်သံရိုက်ဟည်း၊ လူလည်းကြော်ငြာ", "ခွေးဟစ်လူဟစ်၊ ခတ်ပစ်ကယ်ခြောက်သောခါ", "ပုတတ်ကယ်ယုန်ခါ၊ တောမှာရှိကြ", "ငုံး ကြက်ကယ် ဖွတ် မြွေ၊ ဝံပုလွေ", "မနေထွက်လာကြသည်တည့်လေး။", "ဝမ်းသာအားရ၊ မယားကတစ်သွယ်", "ဟင်းရွက်ဆိုးကောင်း၊ သောင်းပြောင်းရော၍လွယ်", "လင်ကတစ်သွယ်၊ ယုန်ငယ်ကစ", "တောသတ္တဝါ၊ တွေ့တိုင်းကိုသာ", "အိတ်မှာသာယူ၍ ချသည်နှင့်လေး။", "သို့နှင့်ရောက်က၊ ခဏအောင့်လျှင်", "တံစို့တက်နှင့်၊ ထန်းလျက်ဖိုမှာကင်", "ဟင်းအိုးဆူလျှင်၊ အကင်ခတ်ပြီး", "အိုးကင်းနှင့်လျှော်၊ ရေနှင့်ကြော်", "မိုးမျှော်ငရုတ်သီးငယ်နှင့်လေး။", "နှီးဒေါင်းလန်းကြီး၊ ခူးပြီးသောခါ", "သမီးနှင့်သား၊ များလို့မဝင်သာ", "ဒူးတစ်ဖက်ဟာ၊ တွန်းကာဖယ်လျက်", "သူ့ထက်ငါလေ၊ စားတော့မည်စေ", "စားပေသာလှ အုန်းခွက်ကယ်နှင့်လေး။", "ငုံ့လျက်ကိုယ်စီသာ၊ ဆုပ်ကာလွေးတော့သည်။", "ပြီးလျှင်ရေမရှာ၊ ခွေးသာကျွေးတော့သည်။")
repeats=0
allow_mistakes=80
randomize=false
hide_keyboard=false
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config_version=5
[application]

config/name="Ultimate Myanmar Typing Wizard"
config/tags=PackedStringArray("project")
run/main_scene="res://src/main.tscn"
config/project_settings_override="user://override.cfg"
config/features=PackedStringArray("4.3", "Mobile")
Expand Down
13 changes: 13 additions & 0 deletions src/Keyboard/keyboard.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ offset_left = -64.0
offset_top = -40.0
offset_right = -12.0
offset_bottom = 16.0
text = "Backspace"

[node name="qwerty" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
Expand All @@ -148,6 +149,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_dr5yv")
[node name="Char" parent="VBoxContainer/qwerty/tab/Panel" index="2"]
offset_left = -55.0
offset_right = -3.0
text = "Tab"

[node name="qwerty" type="Control" parent="VBoxContainer/qwerty"]
layout_mode = 2
Expand All @@ -170,6 +172,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_ng5ll")
[node name="Char" parent="VBoxContainer/asdfgh/CapsLock/Panel" index="2"]
offset_left = -56.0
offset_right = -4.0
text = "CapsLock"

[node name="asdfgh" type="Control" parent="VBoxContainer/asdfgh"]
layout_mode = 2
Expand All @@ -187,6 +190,7 @@ offset_left = -61.0
offset_top = -41.0
offset_right = -9.0
offset_bottom = 15.0
text = "Enter"

[node name="zxcvb" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
Expand All @@ -206,6 +210,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_8djne")
[node name="Char" parent="VBoxContainer/zxcvb/LShift/Panel" index="2"]
offset_left = -59.0
offset_right = -7.0
text = "Shift"

[node name="zxcvb" type="Control" parent="VBoxContainer/zxcvb"]
layout_mode = 2
Expand All @@ -221,6 +226,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_jjy0n")
[node name="Char" parent="VBoxContainer/zxcvb/RShift/Panel" index="2"]
offset_left = -58.0
offset_right = -6.0
text = "Shift"

[node name="ctrl_win_alt_space_alt_win_menu_ctrl" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
Expand All @@ -236,6 +242,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_bbdjs")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/ctrl/Panel" index="2"]
offset_left = -54.0
offset_right = -2.0
text = "Ctrl"

[node name="win" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl" instance=ExtResource("1_ik4w2")]
custom_minimum_size = Vector2(120, 80)
Expand All @@ -248,6 +255,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_apsic")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/win/Panel" index="2"]
offset_left = -47.0
offset_right = 5.0
text = "Win"

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/win"]
modulate = Color(1, 1, 1, 0.705882)
Expand Down Expand Up @@ -278,6 +286,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_aoubn")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/alt/Panel" index="2"]
offset_left = -57.0
offset_right = -5.0
text = "Alt"

[node name="space" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl" instance=ExtResource("1_ik4w2")]
unique_name_in_owner = true
Expand Down Expand Up @@ -305,6 +314,7 @@ grow_vertical = 0
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/space/Panel" index="2"]
offset_left = -57.0
offset_right = -5.0
text = ""

[node name="line" type="Panel" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/space"]
unique_name_in_owner = true
Expand Down Expand Up @@ -334,6 +344,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_aoubn")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/alt2/Panel" index="2"]
offset_left = -56.0
offset_right = -4.0
text = "Alt"

[node name="win2" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl" instance=ExtResource("1_ik4w2")]
custom_minimum_size = Vector2(120, 80)
Expand All @@ -346,6 +357,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_apsic")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/win2/Panel" index="2"]
offset_left = -54.0
offset_right = -2.0
text = "Win"

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/win2"]
modulate = Color(1, 1, 1, 0.705882)
Expand Down Expand Up @@ -376,6 +388,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_bbdjs")
[node name="Char" parent="VBoxContainer/ctrl_win_alt_space_alt_win_menu_ctrl/ctrl2/Panel" index="2"]
offset_left = -57.0
offset_right = -5.0
text = "Ctrl"

[node name="ColorHint" type="HBoxContainer" parent="VBoxContainer"]
unique_name_in_owner = true
Expand Down
2 changes: 2 additions & 0 deletions src/Stats/AccuracyProgressRadical.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var accuracy := 0.0
func _ready() -> void:
var stats : Array[StatisticEntry]= UserProfileManager.load_stats()
texture_progress_bar.value = 0
if stats.size() == 0:
return
var stat := stats[stats.size() - 1]

accuracy = stat.accuracy
Expand Down
6 changes: 4 additions & 2 deletions src/Stats/cpm_progress_radical.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class_name CPMProgressRadical

var cpm: int

@export var average_cpm: int = 180
@export var professional_cpm: int = 320
@export var average_cpm: int = 150
@export var professional_cpm: int = 250

@export var lower_average_cpm_color: Color = Color.DARK_CYAN
@export var above_average_cpm_color: Color = Color.MEDIUM_SPRING_GREEN
Expand All @@ -16,6 +16,8 @@ var cpm: int

func _ready() -> void:
var stats := UserProfileManager.load_stats()
if stats.size() == 0:
return
var stat := stats[stats.size() - 1]
cpm = stat.char_per_min
show_cpm()
Expand Down
46 changes: 23 additions & 23 deletions src/Themes/main.tres

Large diffs are not rendered by default.

0 comments on commit c57c0e6

Please sign in to comment.