Skip to content

Commit

Permalink
0.6.0.21 - Fix Confirm/Cancel keyboard inputs ending name change early (
Browse files Browse the repository at this point in the history
#750)

- Fix confirm/cancel keyboard inputs ending name change early
  • Loading branch information
DragonRatTiger authored Nov 18, 2024
1 parent 3f5f7ea commit defd8b3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/de/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "Dan-Titel",
"HEYA_NAMEPLATE": "Namensschild-Titel",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Name: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/en/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "Dan Title",
"HEYA_NAMEPLATE": "Nameplate Title",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Name: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/es/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
"HEYA_DAN": "Título de Dan",
"HEYA_NAMEPLATE": "Título de la placa",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Name: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/fr/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "Titre Dan",
"HEYA_NAMEPLATE": "Titre",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Name: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/ja/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "段位称号",
"HEYA_NAMEPLATE": "名札称号",
"HEYA_NAME": "名前",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "名前:{0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/ko/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "단위 제목",
"HEYA_NAMEPLATE": "칭호 타이틀",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "이름: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/nl/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
"HEYA_DAN": "Dan Title",
"HEYA_NAMEPLATE": "Nameplate Title",
"HEYA_NAME": "Name",
"HEYA_NAME_INFO": "Type your name (Confirm to save, Cancel to discard changes):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Name: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/ru/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "Ранг дан",
"HEYA_NAMEPLATE": "Ранг таблички",
"HEYA_NAME": "Имя",
"HEYA_NAME_INFO": "Введите своё имя («Выбрать», чтобы сохранить; «Отмена», чтобы отменить изменения):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "Имя: {0}",
Expand Down
2 changes: 1 addition & 1 deletion OpenTaiko/Lang/zh/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"HEYA_DAN": "段位称号",
"HEYA_NAMEPLATE": "名牌称号",
"HEYA_NAME": "姓名",
"HEYA_NAME_INFO": "输入您的姓名(确认保存,取消放弃更改):",
"HEYA_NAME_INFO": "Type your name (Enter to save, Escape to discard changes):",

// {0}: Asset name
"HEYA_DESCRIPTION_NAME": "姓名:{0}",
Expand Down
36 changes: 24 additions & 12 deletions OpenTaiko/src/Stages/11.Heya/CStageHeya.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,10 @@ public override int Draw() {
if (this.tMove(-1)) {
OpenTaiko.Skin.soundChangeSFX.tPlay();
}
} else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) ||
OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) {
}
else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) ||
OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)))
{

#region [Decide]

Expand Down Expand Up @@ -677,14 +679,6 @@ public override int Draw() {
iCurrentMenu = CurrentMenu.ReturnToMenu;
this.tResetOpts();
}
else if (iCurrentMenu == CurrentMenu.Name) {
OpenTaiko.SaveFileInstances[iPlayer].data.Name = textInput.Text;
OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(iPlayer);

iCurrentMenu = CurrentMenu.ReturnToMenu;
this.tResetOpts();
}

if (ess == ESelectStatus.SELECTED)
OpenTaiko.Skin.soundDecideSFX.tPlay();
Expand All @@ -695,8 +689,9 @@ public override int Draw() {

#endregion
}
else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) ||
OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) {
else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) ||
OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)))
{

OpenTaiko.Skin.soundCancelSFX.tPlay();

Expand All @@ -714,6 +709,23 @@ public override int Draw() {

return 0;
}
else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) {
OpenTaiko.SaveFileInstances[iPlayer].data.Name = textInput.Text;
OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(iPlayer);

iCurrentMenu = CurrentMenu.ReturnToMenu;
this.tResetOpts();
OpenTaiko.Skin.soundDecideSFX.tPlay();
return 0;
}
else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) {
OpenTaiko.Skin.soundDecideSFX.tPlay();
iCurrentMenu = CurrentMenu.ReturnToMenu;
this.ttkInfoSection = null;
this.tResetOpts();
return 0;
}

#endregion

Expand Down

0 comments on commit defd8b3

Please sign in to comment.