1
0
mirror of synced 2025-02-17 11:08:33 +01:00

few unlockables improvements

This commit is contained in:
0auBSQ 2024-10-18 07:45:12 +09:00
parent 41086c5f3f
commit fc88d051a9
7 changed files with 463 additions and 420 deletions

View File

@ -63,6 +63,9 @@ namespace FDK {
private static int NoteModeID;
private static int NoiseEffectID;
private static int TimeID;
/// <summary>
/// 描画に使用する共通のバッファを作成
/// </summary>
@ -97,23 +100,39 @@ namespace FDK {
uniform sampler2D texture1;
uniform vec4 textureRect;
uniform vec2 scale;
uniform bool noteMode;
uniform int noteMode;
uniform int useNoiseEffect;
uniform float time;
varying vec2 texcoord;
float randomGrayscale(vec2 uv) {
return fract(sin(dot(uv.xy * 10.0, vec2(12.9898, 78.233))) * (43758.5453 * time * 0.02));
}
void main()
{
vec2 rect;
if (noteMode)
if (noteMode == 1)
{
rect = textureRect.xy + (texcoord * textureRect.zw * scale);
rect = rect - (floor((rect - textureRect.xy) / textureRect.zw) * textureRect.zw);
}
else
{
rect = vec2(textureRect.xy + (texcoord * textureRect.zw));
}
gl_FragColor = texture2D(texture1, rect) * color;
vec4 texColor = texture2D(texture1, rect) * color;
if (useNoiseEffect == 1) {
float n = randomGrayscale(rect);
texColor.rgb = vec3(n);
}
gl_FragColor = texColor;
}"
);
//------
@ -125,7 +144,8 @@ namespace FDK {
TextureRectID = Game.Gl.GetUniformLocation(ShaderProgram, "textureRect"); //テクスチャの切り抜きの座標と大きさ
CameraID = Game.Gl.GetUniformLocation(ShaderProgram, "camera"); //テクスチャの切り抜きの座標と大きさ
NoteModeID = Game.Gl.GetUniformLocation(ShaderProgram, "noteMode"); //テクスチャの切り抜きの座標と大きさ
NoiseEffectID = Game.Gl.GetUniformLocation(ShaderProgram, "useNoiseEffect");
TimeID = Game.Gl.GetUniformLocation(ShaderProgram, "time");
//------
@ -230,6 +250,12 @@ namespace FDK {
}
// Properties
public bool bUseNoiseEffect {
get;
set;
}
public bool b加算合成 {
get;
set;
@ -713,6 +739,11 @@ namespace FDK {
Game.Gl.Uniform1(NoteModeID, rollMode ? 1 : 0);
float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100;
Game.Gl.Uniform1(TimeID, _time);
Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0);
//描画-----
Game.Gl.BindVertexArray(VAO);
unsafe {
@ -844,6 +875,10 @@ namespace FDK {
Game.Gl.Uniform1(NoteModeID, 0);
float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100;
Game.Gl.Uniform1(TimeID, _time);
Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0);
//描画-----
Game.Gl.BindVertexArray(VAO);
unsafe {

View File

@ -229,6 +229,8 @@ namespace OpenTaiko {
this.Type = "me";
bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]);
return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE"));
default:
return (false, null);
}
}

View File

@ -152,7 +152,14 @@ namespace OpenTaiko {
this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = num4 * xRatio;
this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = num4 * xRatio;
this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]);
var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(OpenTaiko.stageSongSelect.actSongList.rCurrentlySelectedSong);
if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) {
this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = true;
this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]);
this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = false;
} else
this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]);
}
}
}

View File

@ -2,9 +2,9 @@
using FDK;
namespace OpenTaiko {
internal class CActSelectPresound : CActivity {
// メソッド
internal class CActSelectPresound : CActivity {
// メソッド
public CActSelectPresound() {
base.IsDeActivated = true;
}
@ -22,30 +22,30 @@ namespace OpenTaiko {
this.tStopSound();
this.tBGMフェードイン開始();
this.long再生位置 = -1;
if ((cスコア..strBGMファイル名 != null) && (cスコア..strBGMファイル名.Length > 0)) {
//this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer );
if ((cスコア..strBGMファイル名 != null) && (cスコア..strBGMファイル名.Length > 0)) {
//this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer );
if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") {
this.ct再生待ちウェイト = new CCounter(0, 1, 270, OpenTaiko.Timer);
} else {
this.ct再生待ちウェイト = new CCounter(0, 1, 500, OpenTaiko.Timer);
}
}
}
//if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.b再生中 ) )
//{
// this.tサウンド停止();
// this.tBGMフェードイン開始();
// if( ( cスコア.譜面情報.Presound != null ) && ( cスコア.譜面情報.Presound.Length > 0 ) )
// {
// this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer );
// }
//}
}
// CActivity 実装
}
//if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.b再生中 ) )
//{
// this.tサウンド停止();
// this.tBGMフェードイン開始();
// if( ( cスコア.譜面情報.Presound != null ) && ( cスコア.譜面情報.Presound.Length > 0 ) )
// {
// this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer );
// }
//}
}
// CActivity 実装
public override void Activate() {
this.sound = null;
this.str現在のファイル名 = "";
@ -91,24 +91,24 @@ namespace OpenTaiko {
} else {
this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻;
if (this.long再生位置 >= this.sound.TotalPlayTime - cスコア..nデモBGMオフセット) //2020.04.18 Mr-Ojii #DEMOSTARTから何度も再生するために追加
if (this.long再生位置 >= this.sound.TotalPlayTime - cスコア..nデモBGMオフセット) //2020.04.18 Mr-Ojii #DEMOSTARTから何度も再生するために追加
this.long再生位置 = -1;
}
//if (this.long再生位置 >= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) - 1 && this.long再生位置 <= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) + 0)
//this.long再生位置 = -1;
//CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.long再生位置.ToString() );
//CDTXMania.act文字コンソール.tPrint( 0, 20, C文字コンソール.Eフォント種別.白, (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット).ToString() );
}
//if (this.long再生位置 >= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) - 1 && this.long再生位置 <= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) + 0)
//this.long再生位置 = -1;
//CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.long再生位置.ToString() );
//CDTXMania.act文字コンソール.tPrint( 0, 20, C文字コンソール.Eフォント種別.白, (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット).ToString() );
}
}
return 0;
}
// その他
}
// その他
#region [ private ]
//-----------------
//-----------------
private CCounter ctBGMフェードアウト用;
private CCounter ctBGMフェードイン用;
private CCounter ct再生待ちウェイト;
@ -137,25 +137,25 @@ namespace OpenTaiko {
if ((cスコア != null)
&& !string.IsNullOrEmpty(cスコア..strBGMファイル名)
&& OpenTaiko.stageSongSelect.ePhaseID != CStage.EPhase.SongSelect_FadeOutToNowLoading
&& HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED
&& HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED
) {
string strPreviewFilename = cスコア.. + cスコア..Presound;
try {
strPreviewFilename = cスコア.. + cスコア..strBGMファイル名;
if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound)
this.sound = OpenTaiko.SoundManager.tCreateSound(strPreviewFilename, ESoundGroup.SongPreview);
if (this.sound == null) return;
//this.sound.db再生速度 = ((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0;
// 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here.
// Initialization, song enumeration, and/or interactions may have
// caused background scanning and the metadata may now be available.
// If is not yet available then we wish to queue scanning.
if (this.sound == null) return;
//this.sound.db再生速度 = ((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0;
// 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here.
// Initialization, song enumeration, and/or interactions may have
// caused background scanning and the metadata may now be available.
// If is not yet available then we wish to queue scanning.
var loudnessMetadata = cスコア..SongLoudnessMetadata
?? LoudnessMetadataScanner.LoadForAudioPath(strPreviewFilename);
OpenTaiko.SongGainController.Set(cスコア..SongVol, loudnessMetadata, this.sound);
// Disable song if playing while playing the preview song
OpenTaiko.SongGainController.Set(cスコア..SongVol, loudnessMetadata, this.sound);
// Disable song if playing while playing the preview song
CSongSelectSongManager.disable();
this.sound.PlayStart(true);
@ -165,10 +165,10 @@ namespace OpenTaiko {
this.long再生位置 = cスコア..nデモBGMオフセット;
this.sound.tSetPositonToBegin(cスコア..nデモBGMオフセット);
this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻;
}
//if( long再生位置 == this.sound.n総演奏時間ms - 10 )
// this.long再生位置 = -1;
}
//if( long再生位置 == this.sound.n総演奏時間ms - 10 )
// this.long再生位置 = -1;
this.str現在のファイル名 = strPreviewFilename;
this.tBGMフェードアウト開始();
Trace.TraceInformation("プレビューサウンドを生成しました。({0})", strPreviewFilename);
@ -193,8 +193,8 @@ namespace OpenTaiko {
}
}
}
}
//-----------------
}
//-----------------
#endregion
}
}

View File

@ -910,10 +910,9 @@ namespace OpenTaiko {
}
#endregion
#region [ "曲データを検索しています" ]
try
{
try {
this.txEnumeratingSongs = new CTexture(ft曲リスト用フォント.DrawText("Now loading songs.\nPlease wait...", Color.White));
this.txEnumeratingSongs.vcScaleRatio = new Vector3D<float>( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。
this.txEnumeratingSongs.vcScaleRatio = new Vector3D<float>(0.5f, 0.5f, 1f); // 半分のサイズで表示する。
/*
using ( Bitmap image = new Bitmap( 640, 96 ) )
@ -1344,7 +1343,7 @@ namespace OpenTaiko {
var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(stバー情報[nパネル番号].reference);
var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(stバー情報[nパネル番号].reference);
if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) {
if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) {
OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(xAnime - (int)Box_X, y - ((int)Box_Y));
}
@ -1413,7 +1412,7 @@ namespace OpenTaiko {
#region [ Bar ]
if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) {
if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) {
DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false);
} else {
var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre);
@ -1558,7 +1557,7 @@ namespace OpenTaiko {
#region [Difficulty bars]
if (OpenTaiko.Tx.SongSelect_Frame_Score != null && HiddenIndex != DBSongUnlockables.EHiddenIndex.GRAYED) {
if (OpenTaiko.Tx.SongSelect_Frame_Score != null && HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED) {
// 難易度がTower、Danではない
if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Dan) {
#region [Display difficulty boxes]
@ -1965,7 +1964,7 @@ namespace OpenTaiko {
var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong);
var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong);
if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) {
if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) {
DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false);
//TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画();
}
@ -2709,7 +2708,7 @@ namespace OpenTaiko {
if (eバー種別 == Eバー種別.Random) {
OpenTaiko.Tx.SongSelect_Bar_Genre_Random?.t2D描画(x, y);
} else if (eバー種別 != Eバー種別.BackBox) {
if (HiddenIndex == DBSongUnlockables.EHiddenIndex.GRAYED) {
if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) {
OpenTaiko.Tx.SongSelect_Bar_Genre_Locked?.t2D描画(x, y);
return;
} else {

File diff suppressed because it is too large Load Diff