1
0
mirror of synced 2024-11-27 17:00:50 +01:00

apply cleanup

This commit is contained in:
0auBSQ 2024-07-26 21:33:24 +09:00
parent 75d3fd0da8
commit 756a9370b0
2 changed files with 1232 additions and 1474 deletions

View File

@ -1,22 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using FDK;
using static TJAPlayer3.CActSelect曲リスト;
using Rectangle = System.Drawing.Rectangle;
using RectangleF = System.Drawing.RectangleF;
using Color = System.Drawing.Color;
using Rectangle = System.Drawing.Rectangle;
namespace TJAPlayer3
{
class CStageHeya : CStage
{
public CStageHeya()
{
namespace TJAPlayer3 {
class CStageHeya : CStage {
public CStageHeya() {
base.eStageID = EStage.Heya;
base.ePhaseID = CStage.EPhase.Common_NORMAL;
@ -26,8 +15,7 @@ namespace TJAPlayer3
}
public override void Activate()
{
public override void Activate() {
if (base.IsActivated)
return;
@ -78,10 +66,8 @@ namespace TJAPlayer3
this.sDanTitles[0] = "新人";
int idx = 1;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles != null)
{
foreach (var item in TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles)
{
if (TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles != null) {
foreach (var item in TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles) {
this.sDanTitles[idx] = item.Key;
if (item.Value.isGold == true)
this.ttkDanTitles[idx] = new TitleTextureKey($"<g.#FFE34A.#EA9622>{item.Key}</g>", this.pfHeyaFont, Color.Gold, Color.Black, 1000);
@ -107,13 +93,10 @@ namespace TJAPlayer3
this.titlesKeys[0] = 0; // Regular nameplate unlockable start by 1 (Important)
idx = 1;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null)
{
foreach (var _ref in TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds)
{
if (TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null) {
foreach (var _ref in TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds) {
var item = TJAPlayer3.Databases.DBNameplateUnlockables.data?[_ref];
if (item != null)
{
if (item != null) {
this.ttkTitles[idx] = new TitleTextureKey(item.nameplateInfo.cld.GetString(""), this.pfHeyaFont, Color.Black, Color.Transparent, 1000);
this.titlesKeys[idx] = _ref;
idx++;
@ -135,8 +118,7 @@ namespace TJAPlayer3
ttkPuchiCharaNames = new TitleTextureKey[iPuchiCharaCount];
ttkPuchiCharaAuthors = new TitleTextureKey[iPuchiCharaCount];
for (int i = 0; i < iPuchiCharaCount; i++)
{
for (int i = 0; i < iPuchiCharaCount; i++) {
var textColor = HRarity.tRarityToColor(TJAPlayer3.Tx.Puchichara[i].metadata.Rarity);
ttkPuchiCharaNames[i] = new TitleTextureKey(TJAPlayer3.Tx.Puchichara[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000);
ttkPuchiCharaAuthors[i] = new TitleTextureKey(TJAPlayer3.Tx.Puchichara[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000);
@ -151,8 +133,7 @@ namespace TJAPlayer3
ttkCharacterAuthors = new TitleTextureKey[iCharacterCount];
ttkCharacterNames = new TitleTextureKey[iCharacterCount];
for (int i = 0; i < iCharacterCount; i++)
{
for (int i = 0; i < iCharacterCount; i++) {
var textColor = HRarity.tRarityToColor(TJAPlayer3.Tx.Characters[i].metadata.Rarity);
ttkCharacterNames[i] = new TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000);
ttkCharacterAuthors[i] = new TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000);
@ -170,28 +151,24 @@ namespace TJAPlayer3
base.Activate();
}
public override void DeActivate()
{
public override void DeActivate() {
TJAPlayer3.tDisposeSafely(ref Background);
base.DeActivate();
}
public override void CreateManagedResource()
{
public override void CreateManagedResource() {
base.CreateManagedResource();
}
public override void ReleaseManagedResource()
{
public override void ReleaseManagedResource() {
base.ReleaseManagedResource();
}
public override int Draw()
{
public override int Draw() {
//ctChara_Normal.t進行Loop();
ctChara_In.Tick();
@ -203,17 +180,13 @@ namespace TJAPlayer3
#region [Main menu (Side bar)]
for (int i = 0; i < this.ttkMainMenuOpt.Length; i++)
{
for (int i = 0; i < this.ttkMainMenuOpt.Length; i++) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkMainMenuOpt[i]);
if (iCurrentMenu != -1 || iMainMenuCurrent != i)
{
if (iCurrentMenu != -1 || iMainMenuCurrent != i) {
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
}
else
{
} else {
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
}
@ -226,8 +199,7 @@ namespace TJAPlayer3
#region [Background center]
if (iCurrentMenu >= 0)
{
if (iCurrentMenu >= 0) {
TJAPlayer3.Tx.Heya_Center_Menu_Background?.t2D描画(0, 0);
}
@ -238,14 +210,12 @@ namespace TJAPlayer3
float renderRatioX = 1.0f;
float renderRatioY = 1.0f;
if (TJAPlayer3.Skin.Characters_Resolution[iCharacterCurrent] != null)
{
if (TJAPlayer3.Skin.Characters_Resolution[iCharacterCurrent] != null) {
renderRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[iCharacterCurrent][0];
renderRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[iCharacterCurrent][1];
}
if (TJAPlayer3.Tx.Characters_Heya_Render[iCharacterCurrent] != null)
{
if (TJAPlayer3.Tx.Characters_Heya_Render[iCharacterCurrent] != null) {
TJAPlayer3.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.X = renderRatioX;
TJAPlayer3.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.Y = renderRatioY;
}
@ -259,20 +229,15 @@ namespace TJAPlayer3
#region [Petit chara]
if (iCurrentMenu == 0)
{
for (int i = -(TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2); i < (TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++)
{
if (iCurrentMenu == 0) {
for (int i = -(TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2); i < (TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) {
int pos = (iPuchiCharaCount * 5 + iPuchiCharaCurrent + i) % iPuchiCharaCount;
if (i != 0)
{
if (i != 0) {
TJAPlayer3.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
}
else
{
} else {
TJAPlayer3.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
@ -283,8 +248,7 @@ namespace TJAPlayer3
int puriColumn = pos % 5;
int puriRow = pos / 5;
if (TJAPlayer3.Tx.Puchichara[pos].tx != null)
{
if (TJAPlayer3.Tx.Puchichara[pos].tx != null) {
float puchiScale = TJAPlayer3.Skin.Resolution[1] / 1080.0f;
TJAPlayer3.Tx.Puchichara[pos].tx.vcScaleRatio.X = puchiScale;
@ -302,16 +266,14 @@ namespace TJAPlayer3
#region [Database related values]
if (ttkPuchiCharaNames[pos] != null)
{
if (ttkPuchiCharaNames[pos] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkPuchiCharaNames[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Name_Offset[0],
scroll.Item2 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Name_Offset[1]);
}
if (ttkPuchiCharaAuthors[pos] != null)
{
if (ttkPuchiCharaAuthors[pos] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkPuchiCharaAuthors[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Authors_Offset[0],
@ -332,23 +294,18 @@ namespace TJAPlayer3
#region [Character]
if (iCurrentMenu == 1)
{
for (int i = -(TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2); i < (TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++)
{
if (iCurrentMenu == 1) {
for (int i = -(TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2); i < (TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) {
int pos = (iCharacterCount * 5 + iCharacterCurrent + i) % iCharacterCount;
float charaRatioX = 1.0f;
float charaRatioY = 1.0f;
if (i != 0)
{
if (i != 0) {
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray));
}
else
{
} else {
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
@ -356,14 +313,12 @@ namespace TJAPlayer3
var scroll = DrawBox_Slot(i + (TJAPlayer3.Skin.Heya_Center_Menu_Box_Count / 2));
if (TJAPlayer3.Skin.Characters_Resolution[pos] != null)
{
if (TJAPlayer3.Skin.Characters_Resolution[pos] != null) {
charaRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[pos][0];
charaRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[pos][1];
}
if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null)
{
if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null) {
TJAPlayer3.Tx.Characters_Heya_Preview[pos].vcScaleRatio.X = charaRatioX;
TJAPlayer3.Tx.Characters_Heya_Preview[pos].vcScaleRatio.Y = charaRatioY;
}
@ -375,16 +330,14 @@ namespace TJAPlayer3
#region [Database related values]
if (ttkCharacterNames[pos] != null)
{
if (ttkCharacterNames[pos] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkCharacterNames[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Name_Offset[0],
scroll.Item2 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Name_Offset[1]);
}
if (ttkCharacterAuthors[pos] != null)
{
if (ttkCharacterAuthors[pos] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkCharacterAuthors[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Center_Menu_Box_Authors_Offset[0],
@ -403,30 +356,24 @@ namespace TJAPlayer3
#region [Dan title]
if (iCurrentMenu == 2)
{
for (int i = -(TJAPlayer3.Skin.Heya_Side_Menu_Count / 2); i < (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2) + 1; i++)
{
if (iCurrentMenu == 2) {
for (int i = -(TJAPlayer3.Skin.Heya_Side_Menu_Count / 2); i < (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2) + 1; i++) {
int pos = (this.ttkDanTitles.Length * 5 + iDanTitleCurrent + i) % this.ttkDanTitles.Length;
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkDanTitles[pos]);
if (i != 0)
{
if (i != 0) {
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
else
{
} else {
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
}
int danGrade = 0;
if (pos > 0)
{
if (pos > 0) {
danGrade = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[pos]].clearStatus;
}
@ -450,21 +397,16 @@ namespace TJAPlayer3
#region [Title plate]
if (iCurrentMenu == 3)
{
for (int i = -(TJAPlayer3.Skin.Heya_Side_Menu_Count / 2); i < (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2) + 1; i++)
{
if (iCurrentMenu == 3) {
for (int i = -(TJAPlayer3.Skin.Heya_Side_Menu_Count / 2); i < (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2) + 1; i++) {
int pos = (this.ttkTitles.Length * 5 + iTitleCurrent + i) % this.ttkTitles.Length;
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkTitles[pos]);
if (i != 0)
{
if (i != 0) {
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
else
{
} else {
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White);
}
@ -476,15 +418,13 @@ namespace TJAPlayer3
int _titleid = -1;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null &&
TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[pos]))
{
TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[pos])) {
var _dc = TJAPlayer3.Databases.DBNameplateUnlockables.data[this.titlesKeys[pos]];
iType = _dc.nameplateInfo.iType;
_rarity = HRarity.tRarityToLangInt(_dc.rarity);
_titleid = this.titlesKeys[pos];
//iType = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles[this.titlesKeys[pos]].iType;
}
else if (pos == 0)
} else if (pos == 0)
iType = 0;
/*
@ -509,8 +449,7 @@ namespace TJAPlayer3
#region [Description area]
if (iCurrentMenu >= 0)
{
if (iCurrentMenu >= 0) {
#region [Unlockable information zone]
if (this.ttkInfoSection != null && this.ttkInfoSection.str文字 != "")
@ -524,8 +463,7 @@ namespace TJAPlayer3
#region [Asset description]
if (this.ttkInfoSection == null || this.ttkInfoSection.str文字 == "")
{
if (this.ttkInfoSection == null || this.ttkInfoSection.str文字 == "") {
if (iCurrentMenu == 0) CHeyaDisplayAssetInformations.DisplayPuchicharaInfo(this.pfHeyaFont, TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent]);
if (iCurrentMenu == 1) CHeyaDisplayAssetInformations.DisplayCharacterInfo(this.pfHeyaFont, TJAPlayer3.Tx.Characters[iCharacterCurrent]);
}
@ -537,16 +475,14 @@ namespace TJAPlayer3
#region [General Chara animations]
if (!ctChara_In.IsStarted)
{
if (!ctChara_In.IsStarted) {
TJAPlayer3.Skin.soundHeyaBGM.tPlay();
ctChara_In.Start(0, 180, 1.25f, TJAPlayer3.Timer);
}
#region [ ]
if (ctChara_In.CurrentValue != 90)
{
if (ctChara_In.CurrentValue != 90) {
float CharaX = 0f, CharaY = 0f;
CharaX = -200 + (float)Math.Sin(ctChara_In.CurrentValue / 2 * (Math.PI / 180)) * 200f;
@ -586,57 +522,39 @@ namespace TJAPlayer3
#region [ Inputs ]
if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange))
{
if (this.tMove(1))
{
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)) {
if (this.tMove(1)) {
TJAPlayer3.Skin.soundChangeSFX.tPlay();
}
}
else if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange))
{
if (this.tMove(-1))
{
} else if (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)) {
if (this.tMove(-1)) {
TJAPlayer3.Skin.soundChangeSFX.tPlay();
}
}
else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide))
{
} else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide)) {
#region [Decide]
ESelectStatus ess = ESelectStatus.SELECTED;
// Return to main menu
if (iCurrentMenu == -1 && iMainMenuCurrent == 0)
{
if (iCurrentMenu == -1 && iMainMenuCurrent == 0) {
TJAPlayer3.Skin.soundHeyaBGM.tStop();
this.eフェードアウト完了時の戻り値 = E戻り値.;
this.actFOtoTitle.tフェードアウト開始();
base.ePhaseID = CStage.EPhase.Common_FADEOUT;
}
else if (iCurrentMenu == -1)
{
} else if (iCurrentMenu == -1) {
iCurrentMenu = iMainMenuCurrent - 1;
if (iCurrentMenu == 0)
{
if (iCurrentMenu == 0) {
this.tUpdateUnlockableTextChara();
this.tUpdateUnlockableTextPuchi();
}
}
else if (iCurrentMenu == 0)
{
} else if (iCurrentMenu == 0) {
ess = this.tSelectPuchi();
if (ess == ESelectStatus.SELECTED)
{
if (ess == ESelectStatus.SELECTED) {
//PuchiChara.tGetPuchiCharaIndexByName(p);
//TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent;
//TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
@ -646,9 +564,7 @@ namespace TJAPlayer3
iCurrentMenu = -1;
this.tResetOpts();
}
else if (ess == ESelectStatus.SUCCESS)
{
} else if (ess == ESelectStatus.SUCCESS) {
//TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
//TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer);
TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
@ -656,14 +572,10 @@ namespace TJAPlayer3
TJAPlayer3.SaveFileInstances[iPlayer].tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]);
}
}
else if (iCurrentMenu == 1)
{
} else if (iCurrentMenu == 1) {
ess = this.tSelectChara();
if (ess == ESelectStatus.SELECTED)
{
if (ess == ESelectStatus.SELECTED) {
//TJAPlayer3.Tx.Loading?.t2D描画(18, 7);
// Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M)
@ -682,23 +594,17 @@ namespace TJAPlayer3
iCurrentMenu = -1;
this.tResetOpts();
}
else if (ess == ESelectStatus.SUCCESS)
{
} else if (ess == ESelectStatus.SUCCESS) {
TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Add(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]);
DBSaves.RegisterStringUnlockedAsset(TJAPlayer3.SaveFileInstances[iPlayer].data.SaveId, "unlocked_characters", TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]);
TJAPlayer3.SaveFileInstances[iPlayer].tSpendCoins(TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.Values[0]);
// Play modal animation here ?
}
}
else if (iCurrentMenu == 2)
{
} else if (iCurrentMenu == 2) {
bool iG = false;
int cs = 0;
if (iDanTitleCurrent > 0)
{
if (iDanTitleCurrent > 0) {
iG = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].isGold;
cs = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].clearStatus;
}
@ -713,28 +619,20 @@ namespace TJAPlayer3
iCurrentMenu = -1;
this.tResetOpts();
}
else if (iCurrentMenu == 3)
{
} else if (iCurrentMenu == 3) {
TJAPlayer3.SaveFileInstances[iPlayer].data.Title = this.ttkTitles[iTitleCurrent].str文字;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null
&& TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[iTitleCurrent]))
{
&& TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[iTitleCurrent])) {
var _dc = TJAPlayer3.Databases.DBNameplateUnlockables.data[this.titlesKeys[iTitleCurrent]];
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = _dc.nameplateInfo.iType;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleId = this.titlesKeys[iTitleCurrent];
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleRarityInt = HRarity.tRarityToLangInt(_dc.rarity);
}
else if (iTitleCurrent == 0)
{
} else if (iTitleCurrent == 0) {
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = 0;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleId = -1;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleRarityInt = 1;
}
else
{
} else {
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = -1;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleId = -1;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleRarityInt = 1;
@ -757,23 +655,17 @@ namespace TJAPlayer3
TJAPlayer3.Skin.SoundBanapas.tPlay(); // To change with a more appropriate sfx sooner or later
#endregion
}
else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel))
{
} else if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) ||
TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) {
TJAPlayer3.Skin.soundCancelSFX.tPlay();
if (iCurrentMenu == -1)
{
if (iCurrentMenu == -1) {
TJAPlayer3.Skin.soundHeyaBGM.tStop();
this.eフェードアウト完了時の戻り値 = E戻り値.;
this.actFOtoTitle.tフェードアウト開始();
base.ePhaseID = CStage.EPhase.Common_FADEOUT;
}
else
{
} else {
iCurrentMenu = -1;
this.ttkInfoSection = null;
this.tResetOpts();
@ -785,11 +677,9 @@ namespace TJAPlayer3
#endregion
switch (base.ePhaseID)
{
switch (base.ePhaseID) {
case CStage.EPhase.Common_FADEOUT:
if (this.actFOtoTitle.Draw() == 0)
{
if (this.actFOtoTitle.Draw() == 0) {
break;
}
return (int)this.eフェードアウト完了時の戻り値;
@ -799,8 +689,7 @@ namespace TJAPlayer3
return 0;
}
public enum E戻り値 : int
{
public enum E戻り値 : int {
,
,
@ -830,8 +719,7 @@ namespace TJAPlayer3
private int iCurrentMenu;
private void tResetOpts()
{
private void tResetOpts() {
// Retrieve titles if they exist
//var _titles = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles;
var _titles = TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedNameplateIds;
@ -860,8 +748,7 @@ namespace TJAPlayer3
private bool tMove(int off)
{
private bool tMove(int off) {
if (ScrollCounter.CurrentValue < ScrollCounter.EndValue
&& (TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow)
|| TJAPlayer3.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow)))
@ -872,17 +759,13 @@ namespace TJAPlayer3
if (iCurrentMenu == -1)
iMainMenuCurrent = (this.ttkMainMenuOpt.Length + iMainMenuCurrent + off) % this.ttkMainMenuOpt.Length;
else if (iCurrentMenu == 0)
{
else if (iCurrentMenu == 0) {
iPuchiCharaCurrent = (iPuchiCharaCount + iPuchiCharaCurrent + off) % iPuchiCharaCount;
tUpdateUnlockableTextPuchi();
}
else if (iCurrentMenu == 1)
{
} else if (iCurrentMenu == 1) {
iCharacterCurrent = (iCharacterCount + iCharacterCurrent + off) % iCharacterCount;
tUpdateUnlockableTextChara();
}
else if (iCurrentMenu == 2)
} else if (iCurrentMenu == 2)
iDanTitleCurrent = (this.ttkDanTitles.Length + iDanTitleCurrent + off) % this.ttkDanTitles.Length;
else if (iCurrentMenu == 3)
iTitleCurrent = (this.ttkTitles.Length + iTitleCurrent + off) % this.ttkTitles.Length;
@ -892,8 +775,7 @@ namespace TJAPlayer3
return true;
}
private (int, int) DrawBox_Slot(int i)
{
private (int, int) DrawBox_Slot(int i) {
double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI));
int nextIndex = i + ScrollMode;
@ -907,8 +789,7 @@ namespace TJAPlayer3
return (x, y);
}
private (int, int) DrawSide_Menu(int i)
{
private (int, int) DrawSide_Menu(int i) {
double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI));
int nextIndex = i + ScrollMode;
@ -929,8 +810,7 @@ namespace TJAPlayer3
* SUCCESS : Purchase succeed (without selection)
* SELECTED : Selection succeed
*/
private enum ESelectStatus
{
private enum ESelectStatus {
FAILED,
SUCCESS,
SELECTED
@ -939,31 +819,26 @@ namespace TJAPlayer3
#region [Chara unlockables]
private void tUpdateUnlockableTextChara()
{
private void tUpdateUnlockableTextChara() {
#region [Check unlockable]
if (TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock != null
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]))
{
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent])) {
string _cond = "???";
if (HRarity.tRarityToModalInt(TJAPlayer3.Tx.Characters[iCharacterCurrent].metadata.Rarity)
< HRarity.tRarityToModalInt("Epic"))
_cond = TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage();
this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000);
}
else
} else
this.ttkInfoSection = null;
#endregion
}
private ESelectStatus tSelectChara()
{
private ESelectStatus tSelectChara() {
// Add "If unlocked" to select directly
if (TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock != null
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]))
{
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent])) {
(bool, string?) response = TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMetWrapper(TJAPlayer3.SaveFile);
//TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });
@ -984,32 +859,27 @@ namespace TJAPlayer3
#endregion
#region [Puchi unlockables]
private void tUpdateUnlockableTextPuchi()
{
private void tUpdateUnlockableTextPuchi() {
#region [Check unlockable]
if (TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock != null
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
{
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent])) {
string _cond = "???";
if (HRarity.tRarityToModalInt(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].metadata.Rarity)
< HRarity.tRarityToModalInt("Epic"))
_cond = TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage();
this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000);
}
else
} else
this.ttkInfoSection = null;
#endregion
}
private ESelectStatus tSelectPuchi()
{
private ESelectStatus tSelectPuchi() {
// Add "If unlocked" to select directly
if (TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock != null
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
{
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent])) {
(bool, string?) response = TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMetWrapper(TJAPlayer3.SaveFile);
//tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });

View File

@ -1,16 +1,8 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FDK;
namespace TJAPlayer3
{
class CActNewHeya : CActivity
{
namespace TJAPlayer3 {
class CActNewHeya : CActivity {
public bool IsOpend { get; private set; }
private CCachedFontRenderer MenuFont;
@ -34,15 +26,13 @@ namespace TJAPlayer3
private int CurrentPlayer;
private enum SelectableInfo
{
private enum SelectableInfo {
PlayerSelect,
ModeSelect,
Select
}
private enum ModeType
{
private enum ModeType {
None = -1,
PuchiChara,
Chara,
@ -54,11 +44,9 @@ namespace TJAPlayer3
private ModeType CurrentMode = ModeType.None;
private void SetState(SelectableInfo selectableInfo)
{
private void SetState(SelectableInfo selectableInfo) {
CurrentState = selectableInfo;
switch(selectableInfo)
{
switch (selectableInfo) {
case SelectableInfo.PlayerSelect:
CurrentIndex = 1;
CurrentMaxIndex = TJAPlayer3.ConfigIni.nPlayerCount + 1;
@ -69,16 +57,14 @@ namespace TJAPlayer3
break;
case SelectableInfo.Select:
CurrentMode = (ModeType)(CurrentIndex - 1);
switch(CurrentMode)
{
switch (CurrentMode) {
case ModeType.Chara:
CurrentMaxIndex = TJAPlayer3.Skin.Characters_Ptn;
break;
case ModeType.PuchiChara:
CurrentMaxIndex = TJAPlayer3.Skin.Puchichara_Ptn;
break;
case ModeType.DanTitle:
{
case ModeType.DanTitle: {
int amount = 1;
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles != null)
amount += TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles.Count;
@ -89,10 +75,8 @@ namespace TJAPlayer3
this.ttkDanTitles[0] = new CActSelect曲リスト.TitleTextureKey("新人", this.MenuFont, Color.White, Color.Black, 1000);
int idx = 1;
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles != null)
{
foreach (var item in TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles)
{
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles != null) {
foreach (var item in TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles) {
if (item.Value.isGold == true)
this.ttkDanTitles[idx] = new CActSelect曲リスト.TitleTextureKey(item.Key, this.MenuFont, Color.Gold, Color.Black, 1000);
else
@ -104,8 +88,7 @@ namespace TJAPlayer3
CurrentMaxIndex = amount;
}
break;
case ModeType.SubTitle:
{
case ModeType.SubTitle: {
int amount = 1;
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles != null)
amount += TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles.Count;
@ -118,10 +101,8 @@ namespace TJAPlayer3
this.titlesKeys[0] = "初心者";
int idx = 1;
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles != null)
{
foreach (var item in TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles)
{
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles != null) {
foreach (var item in TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles) {
this.ttkTitles[idx] = new CActSelect曲リスト.TitleTextureKey(item.Value.cld.GetString(item.Key), this.MenuFont, Color.Black, Color.Transparent, 1000);
this.titlesKeys[idx] = item.Key;
idx++;
@ -137,16 +118,13 @@ namespace TJAPlayer3
}
}
private void ChangeIndex(int change)
{
private void ChangeIndex(int change) {
CurrentIndex += change;
if (CurrentIndex < 0) CurrentIndex = CurrentMaxIndex - 1;
else if (CurrentIndex >= CurrentMaxIndex) CurrentIndex = 0;
if (CurrentState == SelectableInfo.Select)
{
switch(CurrentMode)
{
if (CurrentState == SelectableInfo.Select) {
switch (CurrentMode) {
case ModeType.PuchiChara:
tUpdateUnlockableTextPuchi();
break;
@ -161,8 +139,7 @@ namespace TJAPlayer3
}
}
public void Open()
{
public void Open() {
InFade = new CCounter(0, 255, 1.0, TJAPlayer3.Timer);
IsOpend = true;
CurrentMode = ModeType.None;
@ -170,13 +147,11 @@ namespace TJAPlayer3
SetState(SelectableInfo.PlayerSelect);
}
public void Close()
{
public void Close() {
IsOpend = false;
}
public override void Activate()
{
public override void Activate() {
InFade = new CCounter();
CharaBoxAnime = new CCounter();
@ -189,8 +164,7 @@ namespace TJAPlayer3
ttkPuchiCharaNames = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Puchichara_Ptn];
ttkPuchiCharaAuthors = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Puchichara_Ptn];
for (int i = 0; i < TJAPlayer3.Skin.Puchichara_Ptn; i++)
{
for (int i = 0; i < TJAPlayer3.Skin.Puchichara_Ptn; i++) {
var textColor = HRarity.tRarityToColor(TJAPlayer3.Tx.Puchichara[i].metadata.Rarity);
ttkPuchiCharaNames[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Puchichara[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000);
ttkPuchiCharaAuthors[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Puchichara[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000);
@ -200,8 +174,7 @@ namespace TJAPlayer3
ttkCharacterAuthors = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Characters_Ptn];
ttkCharacterNames = new CActSelect曲リスト.TitleTextureKey[TJAPlayer3.Skin.Characters_Ptn];
for (int i = 0; i < TJAPlayer3.Skin.Characters_Ptn; i++)
{
for (int i = 0; i < TJAPlayer3.Skin.Characters_Ptn; i++) {
var textColor = HRarity.tRarityToColor(TJAPlayer3.Tx.Characters[i].metadata.Rarity);
ttkCharacterNames[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000);
ttkCharacterAuthors[i] = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Characters[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000);
@ -211,41 +184,32 @@ namespace TJAPlayer3
base.Activate();
}
public override void DeActivate()
{
public override void DeActivate() {
base.DeActivate();
}
public override void CreateManagedResource()
{
public override void CreateManagedResource() {
this.MenuFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Heya_Font_Scale);
base.CreateManagedResource();
}
public override void ReleaseManagedResource()
{
public override void ReleaseManagedResource() {
MenuFont.Dispose();
base.ReleaseManagedResource();
}
public override int Draw()
{
if ((TJAPlayer3.Pad.bPressedDGB(EPad.Decide)) || ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))
{
switch(CurrentState)
{
case SelectableInfo.PlayerSelect:
{
switch(CurrentIndex)
{
public override int Draw() {
if ((TJAPlayer3.Pad.bPressedDGB(EPad.Decide)) || ((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) {
switch (CurrentState) {
case SelectableInfo.PlayerSelect: {
switch (CurrentIndex) {
case 0:
Close();
TJAPlayer3.Skin.soundCancelSFX.tPlay();
break;
default:
{
default: {
CurrentPlayer = TJAPlayer3.GetActualPlayer(CurrentIndex - 1);
SetState(SelectableInfo.ModeSelect);
TJAPlayer3.Skin.soundDecideSFX.tPlay();
@ -254,16 +218,13 @@ namespace TJAPlayer3
}
}
break;
case SelectableInfo.ModeSelect:
{
switch(CurrentIndex)
{
case SelectableInfo.ModeSelect: {
switch (CurrentIndex) {
case 0:
SetState(SelectableInfo.PlayerSelect);
TJAPlayer3.Skin.soundCancelSFX.tPlay();
break;
default:
{
default: {
SetState(SelectableInfo.Select);
TJAPlayer3.Skin.soundDecideSFX.tPlay();
}
@ -271,16 +232,12 @@ namespace TJAPlayer3
}
}
break;
case SelectableInfo.Select:
{
switch(CurrentMode)
{
case ModeType.PuchiChara:
{
case SelectableInfo.Select: {
switch (CurrentMode) {
case ModeType.PuchiChara: {
var ess = this.tSelectPuchi();
if (ess == ESelectStatus.SELECTED)
{
if (ess == ESelectStatus.SELECTED) {
//PuchiChara.tGetPuchiCharaIndexByName(p);
//TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent;
//TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
@ -290,27 +247,21 @@ namespace TJAPlayer3
TJAPlayer3.Tx.Puchichara[CurrentIndex].welcome.tPlay();
SetState(SelectableInfo.PlayerSelect);
}
else if (ess == ESelectStatus.SUCCESS)
{
} else if (ess == ESelectStatus.SUCCESS) {
//TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
//TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer);
TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Add(TJAPlayer3.Skin.Puchicharas_Name[CurrentIndex]);
TJAPlayer3.SaveFileInstances[CurrentPlayer].tSpendCoins(TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock.Values[0]);
TJAPlayer3.Skin.soundDecideSFX.tPlay();
}
else
{
} else {
TJAPlayer3.Skin.soundError.tPlay();
}
}
break;
case ModeType.Chara:
{
case ModeType.Chara: {
var ess = this.tSelectChara();
if (ess == ESelectStatus.SELECTED)
{
if (ess == ESelectStatus.SELECTED) {
//TJAPlayer3.Tx.Loading?.t2D描画(18, 7);
// Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M)
@ -330,26 +281,20 @@ namespace TJAPlayer3
SetState(SelectableInfo.PlayerSelect);
CurrentMode = ModeType.None;
}
else if (ess == ESelectStatus.SUCCESS)
{
} else if (ess == ESelectStatus.SUCCESS) {
TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Add(TJAPlayer3.Skin.Characters_DirName[CurrentIndex]);
TJAPlayer3.SaveFileInstances[CurrentPlayer].tSpendCoins(TJAPlayer3.Tx.Characters[CurrentIndex].unlock.Values[0]);
TJAPlayer3.Skin.soundDecideSFX.tPlay();
}
else
{
} else {
TJAPlayer3.Skin.soundError.tPlay();
}
}
break;
case ModeType.DanTitle:
{
case ModeType.DanTitle: {
bool iG = false;
int cs = 0;
if (CurrentIndex > 0)
{
if (CurrentIndex > 0) {
iG = TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str文字].isGold;
cs = TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str文字].clearStatus;
}
@ -366,8 +311,7 @@ namespace TJAPlayer3
SetState(SelectableInfo.PlayerSelect);
}
break;
case ModeType.SubTitle:
{
case ModeType.SubTitle: {
TJAPlayer3.SaveFileInstances[CurrentPlayer].data.Title = this.ttkTitles[CurrentIndex].str文字;
if (TJAPlayer3.SaveFileInstances[CurrentPlayer].data.NamePlateTitles != null
@ -390,73 +334,56 @@ namespace TJAPlayer3
}
break;
}
}
else if ((TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)))
{
} else if ((TJAPlayer3.Pad.bPressedDGB(EPad.Cancel) || TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) {
Close();
TJAPlayer3.Skin.soundCancelSFX.tPlay();
}
else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow))
{
} else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) {
ChangeIndex(-1);
TJAPlayer3.Skin.soundChangeSFX.tPlay();
}
else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow))
{
} else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) {
ChangeIndex(1);
TJAPlayer3.Skin.soundChangeSFX.tPlay();
}
InFade.Tick();
if (TJAPlayer3.Tx.Tile_Black != null)
{
if (TJAPlayer3.Tx.Tile_Black != null) {
TJAPlayer3.Tx.Tile_Black.Opacity = InFade.CurrentValue / 2;
for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / TJAPlayer3.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size
{
for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / TJAPlayer3.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size
{
TJAPlayer3.Tx.Tile_Black.t2D描画( i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height);
TJAPlayer3.Tx.Tile_Black.t2D描画(i * TJAPlayer3.Tx.Tile_Black.szTextureSize.Width, j * TJAPlayer3.Tx.Tile_Black.szTextureSize.Height);
}
}
}
switch (CurrentState)
{
switch (CurrentState) {
case SelectableInfo.PlayerSelect:
if (CurrentIndex == 0)
{
if (CurrentIndex == 0) {
TJAPlayer3.Tx.NewHeya_Close_Select.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_Close_Select[0], TJAPlayer3.Skin.SongSelect_NewHeya_Close_Select[1]);
}
else
{
} else {
TJAPlayer3.Tx.NewHeya_PlayerPlate_Select.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_X[CurrentIndex - 1], TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_Y[CurrentIndex - 1]);
}
break;
case SelectableInfo.ModeSelect:
{
case SelectableInfo.ModeSelect: {
TJAPlayer3.Tx.NewHeya_ModeBar_Select.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_X[CurrentIndex], TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Y[CurrentIndex]);
}
break;
case SelectableInfo.Select:
{
switch(CurrentMode)
{
case SelectableInfo.Select: {
switch (CurrentMode) {
case ModeType.Chara:
for(int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++)
{
for (int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++) {
int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i];
int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i];
int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex;
while (index < 0)
{
while (index < 0) {
index += CurrentMaxIndex;
}
while (index >= CurrentMaxIndex)
{
while (index >= CurrentMaxIndex) {
index -= CurrentMaxIndex;
}
TJAPlayer3.Tx.NewHeya_Box.t2D描画(x, y);
@ -464,14 +391,12 @@ namespace TJAPlayer3
float charaRatioX = 1.0f;
float charaRatioY = 1.0f;
if (TJAPlayer3.Skin.Characters_Resolution[index] != null)
{
if (TJAPlayer3.Skin.Characters_Resolution[index] != null) {
charaRatioX = TJAPlayer3.Skin.Resolution[0] / (float)TJAPlayer3.Skin.Characters_Resolution[index][0];
charaRatioY = TJAPlayer3.Skin.Resolution[1] / (float)TJAPlayer3.Skin.Characters_Resolution[index][1];
}
if (TJAPlayer3.Tx.Characters_Heya_Preview[index] != null)
{
if (TJAPlayer3.Tx.Characters_Heya_Preview[index] != null) {
TJAPlayer3.Tx.Characters_Heya_Preview[index].vcScaleRatio.X = charaRatioX;
TJAPlayer3.Tx.Characters_Heya_Preview[index].vcScaleRatio.Y = charaRatioY;
}
@ -479,23 +404,20 @@ namespace TJAPlayer3
TJAPlayer3.Tx.Characters_Heya_Preview[index]?.t2D拡大率考慮中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]);
TJAPlayer3.Tx.Characters_Heya_Preview[index]?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
if (ttkCharacterNames[index] != null)
{
if (ttkCharacterNames[index] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkCharacterNames[index]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Name_Offset[1]);
}
if (ttkCharacterAuthors[index] != null)
{
if (ttkCharacterAuthors[index] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkCharacterAuthors[index]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Author_Offset[1]);
}
if (TJAPlayer3.Tx.Characters[index].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[index]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[index])) {
TJAPlayer3.Tx.NewHeya_Lock?.t2D描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[1]);
if (this.ttkInfoSection != null)
@ -505,17 +427,14 @@ namespace TJAPlayer3
}
break;
case ModeType.PuchiChara:
for(int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++)
{
for (int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++) {
int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i];
int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i];
int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex;
while (index < 0)
{
while (index < 0) {
index += CurrentMaxIndex;
}
while (index >= CurrentMaxIndex)
{
while (index >= CurrentMaxIndex) {
index -= CurrentMaxIndex;
}
TJAPlayer3.Tx.NewHeya_Box.t2D描画(x, y);
@ -523,8 +442,7 @@ namespace TJAPlayer3
int puriColumn = index % 5;
int puriRow = index / 5;
if (TJAPlayer3.Tx.Puchichara[index].tx != null)
{
if (TJAPlayer3.Tx.Puchichara[index].tx != null) {
float puchiScale = TJAPlayer3.Skin.Resolution[1] / 1080.0f;
TJAPlayer3.Tx.Puchichara[index].tx.vcScaleRatio.X = puchiScale;
@ -541,23 +459,20 @@ namespace TJAPlayer3
TJAPlayer3.Tx.Puchichara[index].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
if (ttkCharacterNames[index] != null)
{
if (ttkCharacterNames[index] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkPuchiCharaNames[index]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Name_Offset[1]);
}
if (ttkCharacterAuthors[index] != null)
{
if (ttkCharacterAuthors[index] != null) {
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(ttkPuchiCharaAuthors[index]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Box_Author_Offset[1]);
}
if (TJAPlayer3.Tx.Puchichara[index].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[index]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[index])) {
TJAPlayer3.Tx.NewHeya_Lock?.t2D描画(x + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[0], y + TJAPlayer3.Skin.SongSelect_NewHeya_Lock_Offset[1]);
if (this.ttkInfoSection != null)
@ -567,27 +482,21 @@ namespace TJAPlayer3
}
break;
case ModeType.SubTitle:
for(int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++)
{
for (int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++) {
int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i];
int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i];
int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex;
while (index < 0)
{
while (index < 0) {
index += CurrentMaxIndex;
}
while (index >= CurrentMaxIndex)
{
while (index >= CurrentMaxIndex) {
index -= CurrentMaxIndex;
}
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkTitles[index]);
if (i != 0)
{
if (i != 0) {
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
else
{
} else {
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
}
@ -604,8 +513,7 @@ namespace TJAPlayer3
else if (index == 0)
iType = 0;
if (iType >= 0 && iType < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title)
{
if (iType >= 0 && iType < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title) {
//TJAPlayer3.Tx.NamePlate_Title[iType][TJAPlayer3.NamePlate.ctAnimatedNamePlateTitle.CurrentValue % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[iType]].t2D拡大率考慮上中央基準描画(
// x,
// y);
@ -616,28 +524,22 @@ namespace TJAPlayer3
}
break;
case ModeType.DanTitle:
for(int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++)
{
for (int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++) {
int x = TJAPlayer3.Skin.SongSelect_NewHeya_Box_X[i];
int y = TJAPlayer3.Skin.SongSelect_NewHeya_Box_Y[i];
int index = i - (TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex;
while (index < 0)
{
while (index < 0) {
index += CurrentMaxIndex;
}
while (index >= CurrentMaxIndex)
{
while (index >= CurrentMaxIndex) {
index -= CurrentMaxIndex;
}
CTexture tmpTex = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(this.ttkDanTitles[index]);
if (i != 0)
{
if (i != 0) {
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
else
{
} else {
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
}
@ -648,8 +550,7 @@ namespace TJAPlayer3
y += TJAPlayer3.Skin.SongSelect_NewHeya_Box_Chara_Offset[1];
int danGrade = 0;
if (index > 0)
{
if (index > 0) {
danGrade = TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[index].str文字].clearStatus;
}
@ -671,13 +572,11 @@ namespace TJAPlayer3
TJAPlayer3.Tx.NewHeya_Close.t2D描画(0, 0);
for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++)
{
for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) {
TJAPlayer3.Tx.NewHeya_PlayerPlate[TJAPlayer3.GetActualPlayer(i)].t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_X[i], TJAPlayer3.Skin.SongSelect_NewHeya_PlayerPlate_Y[i]);
}
for(int i = 0; i < 5; i++)
{
for (int i = 0; i < 5; i++) {
TJAPlayer3.Tx.NewHeya_ModeBar.t2D描画(TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_X[i], TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Y[i]);
int title_x = TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_X[i] + TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[0];
int title_y = TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Y[i] + TJAPlayer3.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[1];
@ -692,20 +591,17 @@ namespace TJAPlayer3
* SUCCESS : Purchase succeed (without selection)
* SELECTED : Selection succeed
*/
private enum ESelectStatus
{
private enum ESelectStatus {
FAILED,
SUCCESS,
SELECTED
};
private ESelectStatus tSelectPuchi()
{
private ESelectStatus tSelectPuchi() {
// Add "If unlocked" to select directly
if (TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[CurrentIndex]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[CurrentIndex])) {
(bool, string?) response = TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock.tConditionMetWrapper(TJAPlayer3.SaveFile);
//tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });
@ -723,44 +619,36 @@ namespace TJAPlayer3
return ESelectStatus.SELECTED;
}
private void tUpdateUnlockableTextPuchi()
{
private void tUpdateUnlockableTextPuchi() {
#region [Check unlockable]
if (TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[CurrentIndex]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[CurrentIndex])) {
this.ttkInfoSection = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Puchichara[CurrentIndex].unlock.tConditionMessage()
, this.MenuFont, Color.White, Color.Black, 1000);
}
else
} else
this.ttkInfoSection = null;
#endregion
}
private void tUpdateUnlockableTextChara()
{
private void tUpdateUnlockableTextChara() {
#region [Check unlockable]
if (TJAPlayer3.Tx.Characters[CurrentIndex].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[CurrentIndex]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[CurrentIndex])) {
this.ttkInfoSection = new CActSelect曲リスト.TitleTextureKey(TJAPlayer3.Tx.Characters[CurrentIndex].unlock.tConditionMessage()
, this.MenuFont, Color.White, Color.Black, 1000);
}
else
} else
this.ttkInfoSection = null;
#endregion
}
private ESelectStatus tSelectChara()
{
private ESelectStatus tSelectChara() {
// Add "If unlocked" to select directly
if (TJAPlayer3.Tx.Characters[CurrentIndex].unlock != null
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[CurrentIndex]))
{
&& !TJAPlayer3.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(TJAPlayer3.Skin.Characters_DirName[CurrentIndex])) {
(bool, string?) response = TJAPlayer3.Tx.Characters[CurrentIndex].unlock.tConditionMetWrapper(TJAPlayer3.SaveFile);
//TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });