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

Feature/Handle coins and unlockable modals on result screen directly with Lua (#667)

* first commit

* Squashed commit of the following:

commit 6412740527
Author: DragonRatTiger / リュウコ <dragonrattiger@gmail.com>
Date:   Fri Jul 26 21:00:52 2024 -0500

    Adjust Score.ini Importer (#659)

* small fix

* lua modal for song unlocks

* Puchichara, Character unlock modals and few fixes about lua nameplates
This commit is contained in:
0auBSQ 2024-07-29 01:13:21 +09:00 committed by GitHub
parent 0c6bc77eca
commit 8f6c67375f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
39 changed files with 508 additions and 655 deletions

View File

@ -23,10 +23,15 @@
<Content Include="Licenses/**" CopyToOutputDirectory="PreserveNewest" />
<Content Include="Songs/**" CopyToOutputDirectory="PreserveNewest" />
<Content Include="System/**" CopyToOutputDirectory="PreserveNewest" />
<None Remove="system\open-world memories\modules\modal\Config.json" />
<Content Include="BGScriptAPI.lua" CopyToOutputDirectory="PreserveNewest" />
<Content Include="OpenTaiko.ico" CopyToOutputDirectory="PreserveNewest" />
<Content Include="README.md" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Folder Include="System\Open-World Memories\Modules\Modal\Textures\" />
<Folder Include="System\Open-World Memories\Modules\Modal\Sounds\" />
</ItemGroup>
<PropertyGroup>
<Version>0.6.0</Version>
<OutputType>WinExe</OutputType>

View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,48 @@
# Modal Lua Customization Guide
## Methods
- (bool) isAnimationFinished()
Returns if the currently playing modal animation is finished, when returning "true" enter is pressable again to move to the next modal orreturn to the song select screen
- (void) registerNewModal(int player, int rarity, int modal_type, object modal_info, object modal_visual_ref)
Method called every time a new modal is registered including its related information
Includes the following arguments:
```
- (int) player: The player related to the modal (between 1 and 5)
- (int) rarity: The rarity of the unlocked asset (between 0 (Poor) and 6 (Mythical)), unused for Coins
- (int) modal_type: The type of unlocked asset (0: Coins, 1: Character, 2: Puchichara, 3: Title, 4: Song)
- (object) modal_info: Asset related information, modal_type dependent:
> Coins -> (long) modal_info: The coin value of the play
> Character -> (CCharacter) modal_info: The unlocked character information data (never nil)
> Puchichara -> (CPuchichara) modal_info: The unlocked puchichara information data (never nil)
> Title -> (NameplateUnlockable) modal_info: The unlocked nameplate information data (never nil)
> Song -> (SongNode?) modal_info: The unlocked song information data (can be nil)
- (object) modal_visual_ref: Asset related visuals (or extra info), modal_type dependent:
> Coins -> (long) modal_visual_ref: The total count of coins after the play
> Character -> (CTexture?) modal_visual_ref: The character render as displayed in my room (can be nil)
> Puchichara -> nil
> Title -> (LuaNamePlateScript) modal_visual_ref: A reference to the Nameplate Lua script (never nil except if broken skin)
> Song -> (CTexture?) modal_visual_ref: The song preimage, with the size value set to the same value as in the song select menu (can be nil)
```
- (void) loadAssets()
Method where all resource allocation should be included, called at each skin reload and at launch
- (void) update()
The regular update loop, for example to increment time counters, plays before draw()
- (void) draw()
For displayables, played at each result screen Draw() iteration
## Types
TBD

View File

@ -0,0 +1,199 @@
import ('System.Drawing')
-- Modal info
local modal_current_type = 0
local modal_current_rarity = 1
local modal_current_player = 1
local modal_current_info = nil
local modal_current_visual = nil
-- Modal graphics
local icon_players = { }
local modal_tx = { }
local modal_tx_coin = nil
local ttk_modal_header = nil
local ttk_modal_body = nil
-- Modal sounds
local modal_sfx = { }
local modal_sfx_coin = nil
-- Fonts
local font_modal_header = nil
local font_modal_body = nil
local font_modal_plate = nil
-- Modal counter
local modal_duration = 2000
local modal_counter = 0
local script_busy = false
-- After the item is revealed, a circle glow or smth like that?
local modal_loopanim_duration = 1000
local modal_loopanim_counter = 0
-- Tmp (until new format)
local modal_asset_id = 0
function isAnimationFinished()
return not script_busy
end
-- modal_asset_informations: Character object, Coin count, Nameplate unlockable whole object, etc... having all the necessary information
-- modal_asset_visual_references: Character textures table, Song preimage (?) or supporting visuals, might be null for some modal types
function registerNewModal(player, rarity, modal_type, modal_asset_informations, modal_asset_visual_references)
local _modal_header = ""
local _modal_body = ""
modal_current_type = modal_type
modal_current_rarity = rarity
modal_current_player = player
modal_current_info = modal_asset_informations
modal_current_visual = modal_asset_visual_references
modal_counter = 0
modal_loopanim_counter = 0
script_busy = true
if modal_type == 0 then
-- Coin
modal_current_rarity = 1
_modal_header = getLocalizedString("MODAL_TITLE_COIN")
_modal_body = getLocalizedString("MODAL_MESSAGE_COIN", tostring(modal_asset_informations), tostring(modal_asset_visual_references)) -- 0: Delta coin, 1: Total coin
debugLog(_modal_body)
modal_sfx_coin:PlayStart()
elseif modal_type == 1 then
-- Character
-- > modal_asset_informations: CCharacter
-- > modal_asset_visual_references: CTexture?
_modal_header = getLocalizedString("MODAL_TITLE_CHARA")
_modal_body = modal_current_info.metadata:tGetName()
elseif modal_type == 2 then
-- Puchichara
-- > modal_asset_informations: CPuchichara
-- > modal_asset_visual_references:
_modal_header = getLocalizedString("MODAL_TITLE_PUCHI")
_modal_body = modal_current_info.metadata:tGetName()
elseif modal_type == 3 then
-- Title
-- > modal_asset_informations: NameplateUnlockable
-- > modal_asset_visual_references: CLuaNamePlateScript
_modal_header = getLocalizedString("MODAL_TITLE_NAMEPLATE")
_modal_body = modal_asset_informations.Value.nameplateInfo.cld:GetString("")
ttk_modal_body = createTitleTextureKey(_modal_body, font_modal_plate, 99999, Color.FromArgb(0,0,0,1), Color.FromArgb(0,0,0,0))
elseif modal_type == 4 then
-- Song
-- > modal_asset_informations: CSongListNode
-- > modal_asset_visual_references: CTexture (Preimage)
_modal_header = getLocalizedString("MODAL_TITLE_SONG")
_modal_body = modal_current_info.ldTitle:GetString("")
end
ttk_modal_header = createTitleTextureKey(_modal_header, font_modal_header, 99999)
if modal_type ~= 3 then
ttk_modal_body = createTitleTextureKey(_modal_body, font_modal_body, 99999)
end
-- Tmp
modal_asset_id = math.max(1, math.min(5, modal_current_rarity))
if modal_type ~= 0 then
modal_sfx[modal_asset_id]:PlayStart()
end
end
function loadAssets()
config = loadConfig("Config.json")
for i = 1, 5 do
icon_players[i] = loadTexture(tostring(i).."P.png")
end
-- Tmp, to change with the new structure later
for i = 0, 4 do
modal_tx[i + 1] = loadTexture(tostring(i)..".png")
modal_sfx[i + 1] = loadSound(tostring(i)..".ogg", "soundeffect")
end
modal_tx_coin = loadTexture("Coin.png")
modal_sfx_coin = loadSound("Coin.ogg", "soundeffect")
font_modal_header = loadFontRenderer(84, "regular")
font_modal_body = loadFontRenderer(84, "regular")
font_modal_plate = loadFontRenderer(16, "regular")
end
function update()
if modal_counter <= modal_duration then
script_busy = true
modal_counter = modal_counter + (1000 * fps.deltaTime)
else
script_busy = false
modal_loopanim_counter = modal_loopanim_counter + (1000 * fps.deltaTime)
if modal_loopanim_counter >= modal_loopanim_duration then
modal_loopanim_counter = 0
end
end
-- Idea: If button press and not finished, directly set modal_counter to modal_duration and cut the appearing animation?
end
function draw()
icon_players[modal_current_player]:t2D_DisplayImage(0, 0)
tx_header = getTextTex(ttk_modal_header, false, false)
if modal_current_type == 0 then
-- Coin
modal_tx_coin:t2D_DisplayImage(0, 0)
tx_header:t2D_DisplayImage_AnchorCenter(960,180)
tx_body = getTextTex(ttk_modal_body, false, false)
tx_body:t2D_DisplayImage_AnchorCenter(960,490)
else
-- Others
modal_tx[modal_asset_id]:t2D_DisplayImage(0, 0)
tx_header:t2D_DisplayImage_AnchorCenter(960,180)
if modal_current_type == 1 then
-- Character
if modal_current_visual ~= nil then
modal_current_visual:t2D_DisplayImage(0,260)
end
tx_body = getTextTex(ttk_modal_body, false, false)
tx_body:t2D_DisplayImage_AnchorCenter(960,390)
elseif modal_current_type == 2 then
-- Puchichara
if modal_current_info.tx ~= nil then
modal_current_info.tx:t2D_DisplayImage_AnchorCenter(960,490)
end
tx_body = getTextTex(ttk_modal_body, false, false)
tx_body:t2D_DisplayImage_AnchorCenter(960,790)
elseif modal_current_type == 3 then
-- Nameplate Title
tx_title = getTextTex(ttk_modal_body, false, false)
modal_current_visual:DrawTitlePlate(960, 490, 255, modal_current_info.Value.nameplateInfo.iType, tx_title, modal_current_rarity, modal_current_info.Key)
elseif modal_current_type == 4 then
-- Song
if modal_current_visual ~= nil then
modal_current_visual:t2D_DisplayImage_AnchorCenter(960,490)
end
tx_body = getTextTex(ttk_modal_body, false, false)
tx_body:t2D_DisplayImage_AnchorCenter(960,790)
else
-- Custom modals for custom unlockables in the future??
tx_body = getTextTex(ttk_modal_body, false, false)
tx_body:t2D_DisplayImage_AnchorCenter(960,490)
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -1173,7 +1173,6 @@ namespace TJAPlayer3 {
public bool bDanTowerHide;
public bool bTight;
public bool bストイックモード;
public bool bIncludeSubfoldersOnRandomSelect;
public bool bOutputLogs;
public bool bDisplayDebugInfo;
@ -2176,10 +2175,6 @@ namespace TJAPlayer3 {
sw.WriteLine($"; Blank time before music source to play. (ms)");
sw.WriteLine("{0}={1}", nameof(MusicPreTimeMs), MusicPreTimeMs);
sw.WriteLine();
sw.WriteLine("; ストイックモード(0:OFF, 1:ON)");
sw.WriteLine("; Stoic mode. (0:OFF, 1:ON)");
sw.WriteLine("StoicMode={0}", this.bストイックモード ? 1 : 0);
sw.WriteLine();
sw.WriteLine("; バッファ入力モード(0:OFF, 1:ON)");
sw.WriteLine("; Using Buffered input (0:OFF, 1:ON)");
sw.WriteLine("BufferedInput={0}", this.bBufferedInputs ? 1 : 0);
@ -2911,10 +2906,7 @@ namespace TJAPlayer3 {
this.KeyboardSoundLevelIncrement = CConversion.n値を文字列から取得して範囲内に丸めて返す(str4, MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, this.KeyboardSoundLevelIncrement);
} else if (str3.Equals(nameof(MusicPreTimeMs))) {
MusicPreTimeMs = int.Parse(str4);
} else if (str3.Equals("StoicMode")) {
this.bストイックモード = CConversion.bONorOFF(str4[0]);
} else if (str3.Equals("AutoResultCapture")) // #25399 2011.6.9 yyagi
{
} else if (str3.Equals("AutoResultCapture")) {
this.bIsAutoResultCapture = CConversion.bONorOFF(str4[0]);
} else if (str3.Equals(nameof(SendDiscordPlayingInformation))) {
SendDiscordPlayingInformation = CConversion.bONorOFF(str4[0]);

View File

@ -1,154 +1,13 @@
using System.Drawing;
using FDK;
using static TJAPlayer3.CActSelect曲リスト;
namespace TJAPlayer3 {
namespace TJAPlayer3 {
internal class Modal {
public Modal(EModalType mt, int ra, params object[] re) {
public Modal(EModalType mt, int ra, params object?[] re) {
modalType = mt;
rarity = ra;
reference = re;
_isSet = false;
// TODO: Add an int (?) or string to find the Puchichara/Character/Song asset to display it
}
public void tSetupModal() {
CTexture[] arrRef;
if (modalFormat == EModalFormat.Half)
arrRef = TJAPlayer3.Tx.Modal_Half;
else if (modalFormat == EModalFormat.Half_4P)
arrRef = TJAPlayer3.Tx.Modal_Half_4P;
else if (modalFormat == EModalFormat.Half_5P)
arrRef = TJAPlayer3.Tx.Modal_Half_5P;
else
arrRef = TJAPlayer3.Tx.Modal_Full;
if (modalType == EModalType.Coin)
_box = arrRef[arrRef.Length - 1];
else {
int usedTex = Math.Max(0, Math.Min(arrRef.Length - 2, rarity));
_box = arrRef[usedTex];
}
/*
_boxRect = new Rectangle(
(modalFormat == EModalFormat.Full || player == 0)
? 0
: _box.szテクスチャサイズ.Width / 2,
0,
(modalFormat == EModalFormat.Full)
? _box.szテクスチャサイズ.Width
: _box.szテクスチャサイズ.Width / 2,
_box.szテクスチャサイズ.Height);
*/
_boxRect = new Rectangle(
(modalFormat == EModalFormat.Full || player == 0) ? 0 : _box.szTextureSize.Width / 2,
0,
(modalFormat == EModalFormat.Full) ? _box.szTextureSize.Width : _box.szTextureSize.Width / 2,
_box.szTextureSize.Height / (((TJAPlayer3.ConfigIni.nPlayerCount - 1) / 2) + 1));
tGenerateTextures();
_isSet = true;
}
public void tDisplayModal() {
if (_isSet == true) {
_box?.t2D描画(_boxRect.Width * (player % 2), _boxRect.Height * (player / 2), _boxRect);
int[] title_x;
int[] title_y;
int[] text_x;
int[] text_y;
int moveX;
int moveY;
if (modalFormat == EModalFormat.Full) {
title_x = new int[] { TJAPlayer3.Skin.Modal_Title_Full[0] };
title_y = new int[] { TJAPlayer3.Skin.Modal_Title_Full[1] };
text_x = new int[] { TJAPlayer3.Skin.Modal_Text_Full[0] };
text_y = new int[] { TJAPlayer3.Skin.Modal_Text_Full[1] };
moveX = TJAPlayer3.Skin.Modal_Text_Full_Move[0];
moveY = TJAPlayer3.Skin.Modal_Text_Full_Move[1];
} else if (modalFormat == EModalFormat.Half) {
title_x = TJAPlayer3.Skin.Modal_Title_Half_X;
title_y = TJAPlayer3.Skin.Modal_Title_Half_Y;
text_x = TJAPlayer3.Skin.Modal_Text_Half_X;
text_y = TJAPlayer3.Skin.Modal_Text_Half_Y;
moveX = TJAPlayer3.Skin.Modal_Text_Half_Move[0];
moveY = TJAPlayer3.Skin.Modal_Text_Half_Move[1];
} else if (modalFormat == EModalFormat.Half_4P) {
title_x = TJAPlayer3.Skin.Modal_Title_Half_X_4P;
title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_4P;
text_x = TJAPlayer3.Skin.Modal_Text_Half_X_4P;
text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_4P;
moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[0];
moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_4P[1];
} else// 5P
{
title_x = TJAPlayer3.Skin.Modal_Title_Half_X_5P;
title_y = TJAPlayer3.Skin.Modal_Title_Half_Y_5P;
text_x = TJAPlayer3.Skin.Modal_Text_Half_X_5P;
text_y = TJAPlayer3.Skin.Modal_Text_Half_Y_5P;
moveX = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[0];
moveY = TJAPlayer3.Skin.Modal_Text_Half_Move_5P[1];
}
/*
Point[] Pos = new Point[]
{
(modalFormat == EModalFormat.Full) ? new Point(TJAPlayer3.Skin.Modal_Title_Full[0], TJAPlayer3.Skin.Modal_Title_Full[1]) : new Point(TJAPlayer3.Skin.Modal_Title_Half_X[player], TJAPlayer3.Skin.Modal_Title_Half_Y[player]), // title
(modalFormat == EModalFormat.Full) ?
new Point(TJAPlayer3.Skin.Modal_Text_Full[0] +(tTextCentered () ? TJAPlayer3.Skin.Modal_Text_Full_Move[0] : 0),
TJAPlayer3.Skin.Modal_Text_Full[1] + (tTextCentered () ? TJAPlayer3.Skin.Modal_Text_Full_Move[1] : 0)) :
new Point(TJAPlayer3.Skin.Modal_Text_Half_X[player] + (tTextCentered () ? TJAPlayer3.Skin.Modal_Text_Half_Move[0] : 0),
TJAPlayer3.Skin.Modal_Text_Half_Y[player] + (tTextCentered () ? TJAPlayer3.Skin.Modal_Text_Half_Move[1] : 0)), // content
};
*/
Point[] Pos = new Point[]
{
new Point(title_x[player], title_y[player]),
new Point(text_x[player] + (tTextCentered () ? moveX : 0),
text_y[player] + (tTextCentered () ? moveY : 0)), // content
};
_ModalTitle?.t2D中心基準描画(Pos[0].X, Pos[0].Y);
_ModalText?.t2D中心基準描画(Pos[1].X, Pos[1].Y);
// Extra texture for Puchichara, Character and Titles next
}
}
public void tPlayModalSfx() {
if (modalType == EModalType.Coin)
TJAPlayer3.Skin.soundModal[TJAPlayer3.Skin.soundModal.Length - 1].tPlay();
else
TJAPlayer3.Skin.soundModal[Math.Max(0, Math.Min(TJAPlayer3.Skin.soundModal.Length - 2, rarity))].tPlay();
}
public static void tInitModalFonts() {
if (_pfModalContentHalf != null
&& _pfModalTitleHalf != null
&& _pfModalContentFull != null
&& _pfModalTitleFull != null)
return;
_pfModalContentHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentHalf_Size);
_pfModalTitleHalf = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleHalf_Size);
_pfModalContentFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalContentFull_Size);
_pfModalTitleFull = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.Modal_Font_ModalTitleFull_Size);
public void tRegisterModal(int player) {
TJAPlayer3.stage結果.lcModal.RegisterNewModal(player, rarity, modalType, reference);
}
#region [Enum definitions]
@ -175,7 +34,7 @@ namespace TJAPlayer3 {
#region [Public variables]
// Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm
public object[] reference;
public object?[] reference;
public int rarity;
public EModalType modalType;
@ -186,87 +45,5 @@ namespace TJAPlayer3 {
#endregion
#region [private]
// Check if the text is vertically centered or slightly up (to let enough space for the unlocked unit texture)
private bool tTextCentered() {
if (modalType == EModalType.Coin)
return true;
return false;
}
// Generate the modal title and content text textures
private void tGenerateTextures() {
string modalKey = "MODAL_TITLE_COIN";
switch (modalType) {
case EModalType.Character:
modalKey = "MODAL_TITLE_CHARA";
break;
case EModalType.Puchichara:
modalKey = "MODAL_TITLE_PUCHI";
break;
case EModalType.Title:
modalKey = "MODAL_TITLE_NAMEPLATE";
break;
case EModalType.Song:
modalKey = "MODAL_TITLE_SONG";
break;
}
TitleTextureKey _title = new TitleTextureKey(
CLangManager.LangInstance.GetString(modalKey),
(modalFormat == EModalFormat.Full)
? _pfModalTitleFull
: _pfModalTitleHalf,
Color.White,
Color.Black,
1800);
string content = "";
if (modalType == EModalType.Coin) {
content = CLangManager.LangInstance.GetString("MODAL_MESSAGE_COIN", reference[0].ToString(), TJAPlayer3.SaveFileInstances[player].data.Medals.ToString());
//content = String.Format("+{0} {1} ({2}: {3})",
// (int)reference[0],
// CLangManager.LangInstance.GetString(306),
// CLangManager.LangInstance.GetString(307),
// TJAPlayer3.SaveFileInstances[player].data.Medals
// );
} else if (modalType == EModalType.Title) {
content = ((string)reference[0]).RemoveTags();
} else if (modalType == EModalType.Character) {
content = ((string)reference[0]).RemoveTags();
} else if (modalType == EModalType.Puchichara) {
content = ((string)reference[0]).RemoveTags();
} else if (modalType == EModalType.Song) {
content = ((string)reference[0]).RemoveTags();
}
TitleTextureKey _content = new TitleTextureKey(
content,
(modalFormat == EModalFormat.Full)
? _pfModalContentFull
: _pfModalContentHalf,
Color.White,
Color.Black,
1800);
_ModalText = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_content);
_ModalTitle = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(_title);
}
private CTexture _box;
private Rectangle _boxRect;
private bool _isSet;
private static CCachedFontRenderer _pfModalTitleHalf;
private static CCachedFontRenderer _pfModalContentHalf;
private static CCachedFontRenderer _pfModalTitleFull;
private static CCachedFontRenderer _pfModalContentFull;
private CTexture _ModalTitle;
private CTexture _ModalText;
#endregion
}
}

View File

@ -5,41 +5,10 @@
_modalFormat = mf;
}
// Add two modals (one per player) at the same time
public void tAddModal(Modal mp1, Modal mp2, Modal mp3, Modal mp4, Modal mp5) {
mp1.modalFormat = _modalFormat;
mp2.modalFormat = _modalFormat;
mp3.modalFormat = _modalFormat;
mp4.modalFormat = _modalFormat;
mp5.modalFormat = _modalFormat;
mp1.player = 0;
mp2.player = 1;
mp3.player = 2;
mp4.player = 3;
mp5.player = 4;
mp1.tSetupModal();
mp2.tSetupModal();
mp3.tSetupModal();
mp4.tSetupModal();
mp5.tSetupModal();
if (mp1 != null)
_modalQueues[0].Enqueue(mp1);
if (mp2 != null)
_modalQueues[1].Enqueue(mp2);
if (mp3 != null)
_modalQueues[2].Enqueue(mp3);
if (mp4 != null)
_modalQueues[3].Enqueue(mp4);
if (mp5 != null)
_modalQueues[4].Enqueue(mp5);
}
// Add a single modal
public void tAddModal(Modal mp, int player) {
mp.modalFormat = _modalFormat;
mp.player = player;
mp.tSetupModal();
if (mp != null && player >= 0 && player < TJAPlayer3.ConfigIni.nPlayerCount)
_modalQueues[player].Enqueue(mp);
@ -51,6 +20,19 @@
return null;
}
// 1P => 2P => 3P => 4P => 5P
public Modal? tPopModalInOrder() {
for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) {
if (!tIsQueueEmpty(i)) {
Modal? _m = _modalQueues[i].Dequeue();
_m?.tRegisterModal(i + 1);
return _m;
}
}
return null;
}
public bool tIsQueueEmpty(int player) {
if (player < 0 || player >= TJAPlayer3.ConfigIni.nPlayerCount)
return true;

View File

@ -2391,9 +2391,6 @@ for (int i = 0; i < 3; i++) {
}
#endif
// Init Modal fonts once config.ini parsing is done
// Moved here to reference Skin values.
Modal.tInitModalFonts();
//---------------------
#endregion
//-----------
@ -2622,6 +2619,7 @@ for (int i = 0; i < 3; i++) {
stage曲読み込み = new CStage曲読み込み();
stage演奏ドラム画面 = new CStage演奏ドラム画面();
stage結果 = new CStage結果();
stage結果.RefreshSkin();
stageChangeSkin = new CStageChangeSkin();
stage終了 = new CStage終了();
NamePlate = new CNamePlate();
@ -3063,6 +3061,7 @@ for (int i = 0; i < 3; i++) {
actTextConsole.CreateManagedResource();
actTextConsole.CreateUnmanagedResource();
TJAPlayer3.NamePlate.RefleshSkin();
TJAPlayer3.stage結果.RefreshSkin();
CActSelectPopupMenu.RefleshSkin();
CActSelect段位リスト.RefleshSkin();
}

View File

@ -78,8 +78,9 @@ namespace TJAPlayer3 {
mq.tAddModal(
new Modal(
Modal.EModalType.Title,
HRarity.tRarityToModalInt(item.Value.rarity),
item.Value.nameplateInfo.cld.GetString("") // Cannot be null on database
HRarity.tRarityToLangInt(item.Value.rarity),
item,
TJAPlayer3.NamePlate.lcNamePlate
),
_player);

View File

@ -68,10 +68,11 @@ namespace TJAPlayer3 {
foreach (KeyValuePair<string, SongUnlockable> item in data) {
string _npvKey = item.Key;
string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.ldTitle.GetString("");
string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.ldSubtitle.GetString("") ?? "";
//string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.ldTitle.GetString("");
//string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.ldSubtitle.GetString("") ?? "";
CSongListNode? _node = CSongDict.tGetNodeFromID(_npvKey);
if (!_sf.Contains(_npvKey) && _songName != null) {
if (!_sf.Contains(_npvKey)) { // && _songName != null) {
var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1;
if (_fulfilled) {
@ -84,8 +85,8 @@ namespace TJAPlayer3 {
new Modal(
Modal.EModalType.Song,
HRarity.tRarityToModalInt(item.Value.rarity),
_songName,
_songSubtitle
_node,
TJAPlayer3.stageSongSelect.actPreimageパネル.tGenerateAndGetPreimage(_node?.arスコア[0] ?? null)
),
_player);

View File

@ -35,7 +35,7 @@ namespace TJAPlayer3 {
private List<IDisposable> listDisposables = new List<IDisposable>();
protected bool Avaibale {
protected bool Available {
get {
return bLoadedAssets && !bDisposed && !bCrashed;
}
@ -148,6 +148,10 @@ namespace TJAPlayer3 {
return fontRenderer;
}
private string GetLocalizedString(string key, params object?[] args) {
return CLangManager.LangInstance.GetString(key, args);
}
private TitleTextureKey CreateTitleTextureKey(string title, CCachedFontRenderer fontRenderer, int maxSize, Color? color = null, Color? edgeColor = null) {
return new TitleTextureKey(title, fontRenderer, color ?? Color.White, edgeColor ?? Color.Black, maxSize);
}
@ -184,6 +188,7 @@ namespace TJAPlayer3 {
LuaScript["getText"] = getText;
LuaScript["getNumArray"] = getNumArray;
LuaScript["getTextArray"] = getTextArray;
LuaScript["getLocalizedString"] = GetLocalizedString;
LuaScript["displayDanPlate"] = CActSelect段位リスト.tDisplayDanPlate;
LuaScript["debugLog"] = DebugLog;

View File

@ -0,0 +1,47 @@
using NLua;
namespace TJAPlayer3 {
internal class CLuaModalScript : CLuaScript {
private LuaFunction lfRegisterModal;
private LuaFunction lfAnimationFinished;
private LuaFunction lfUpdate;
private LuaFunction lfDraw;
public CLuaModalScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets) {
lfRegisterModal = (LuaFunction)LuaScript["registerNewModal"];
lfAnimationFinished = (LuaFunction)LuaScript["isAnimationFinished"];
lfUpdate = (LuaFunction)LuaScript["update"];
lfDraw = (LuaFunction)LuaScript["draw"];
}
// Function to retrieve if the currently playing modal animation (etc) finished playing, allowing to send the next modal
public bool AnimationFinished() {
if (!Available) return false;
bool result = (bool)RunLuaCode(lfAnimationFinished)[0];
return result;
}
// Informations of the newly added modal are initialized here
public void RegisterNewModal(int player, int rarity, Modal.EModalType modalType, params object?[] args) {
if (!Available) return;
object[] newParams = new object[] { player, rarity, (int)modalType };
if (args != null) newParams = newParams.Concat((object[])args).ToArray();
RunLuaCode(lfRegisterModal, newParams);
}
// Handle inputs here (if necessary, like to add a shortcut to accelerate the animation etc
public void Update(params object[] args) {
if (!Available) return;
RunLuaCode(lfUpdate, args);
}
public void Draw(params object[] args) {
if (!Available) return;
RunLuaCode(lfDraw, args);
}
}
}

View File

@ -20,39 +20,41 @@ namespace TJAPlayer3 {
}
public int GetCharaOffset() {
if (!Avaibale) return 0;
if (!Available) return 0;
double result = (double)RunLuaCode(lfGetCharaOffset)[0];
return (int)result;
}
public void SetInfos(int player, string name, string title, string dan, SaveFile.Data data) {
if (!Avaibale) return;
if (!Available) return;
RunLuaCode(lfSetInfos, player, name ?? "", title ?? "", dan ?? "", data);
}
// For My Room
public void DrawDan(int x, int y, int opacity, int danGrade, CTexture titleTex) {
if (!Avaibale) return;
if (!Available) return;
RunLuaCode(lfDrawDan, x, y, opacity, danGrade, titleTex);
}
// For My Room
public void DrawTitlePlate(int x, int y, int opacity, int type, CTexture titleTex, int rarity, int nameplateId) {
if (!Avaibale) return;
if (!Available) return;
RunLuaCode(lfDrawTitlePlate, x, y, opacity, type, titleTex, rarity, nameplateId);
}
public void Update(params object[] args) {
if (!Avaibale) return;
if (!Available) return;
RunLuaCode(lfUpdate, args);
}
public void Draw(int x, int y, int opacity, int player, int side) {
if (!Avaibale) return;
if (!Available) return;
RunLuaCode(lfDraw, x, y, opacity, player, side);
}
}
}
}

View File

@ -4,6 +4,7 @@
public DBCharacter.CharacterEffect effect;
public DBUnlockables.CUnlockConditions unlock;
public string _path;
public int _idx;
public float GetEffectCoinMultiplier() {
float mult = 1f;
@ -31,7 +32,8 @@
new Modal(
Modal.EModalType.Character,
HRarity.tRarityToModalInt(metadata.Rarity),
metadata.tGetName()
this,
TJAPlayer3.Tx.Characters_Heya_Render[_idx]
),
_player);
@ -43,8 +45,9 @@
TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges();
}
public CCharacter(string path) {
public CCharacter(string path, int i) {
_path = path;
_idx = i;
// Character metadata
if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json"))

View File

@ -38,7 +38,7 @@ namespace TJAPlayer3 {
new Modal(
Modal.EModalType.Puchichara,
HRarity.tRarityToModalInt(metadata.Rarity),
metadata.tGetName()
this
),
_player);

View File

@ -1317,7 +1317,7 @@ namespace TJAPlayer3 {
}
}
Characters[i] = new CCharacter(charaDirs[i]);
Characters[i] = new CCharacter(charaDirs[i], i);
}

View File

@ -1,7 +1,4 @@
using System.Diagnostics;
using FDK;
using Silk.NET.Maths;
using Rectangle = System.Drawing.Rectangle;
using FDK;
namespace TJAPlayer3 {
internal class CActSelectPreimageパネル : CActivity {
@ -10,299 +7,158 @@ namespace TJAPlayer3 {
public CActSelectPreimageパネル() {
base.IsDeActivated = true;
}
public void t選択曲が変更された() {
this.ct遅延表示 = new CCounter(-TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms, 100, 1, TJAPlayer3.Timer);
this.b新しいプレビューファイルを読み込んだ = false;
public void tSelectedSongChanged() {
this.ctDelayedDisplay = new CCounter(-TJAPlayer3.ConfigIni.n曲が選択されてからプレビュー画像が表示開始されるまでのウェイトms, 100, 1, TJAPlayer3.Timer);
this.bNewPreimageLoaded = false;
}
// CActivity 実装
public override void Activate() {
this.n本体X = 8;
this.n本体Y = 0x39;
this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像;
this.str現在のファイル名 = "";
this.b新しいプレビューファイルを読み込んだ = false;
this.txプレビュー画像 = null;
this.n前回描画したフレーム番号 = -1;
this.b動画フレームを作成した = false;
this.pAVIBmp = IntPtr.Zero;
this.tプレビュー画像_動画の変更();
this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage;
this.strCurrentFilename = "";
this.bNewPreimageLoaded = false;
this.txPreimage = null;
this.tUpdatePreimage(TJAPlayer3.stageSongSelect.r現在選択中のスコア);
base.Activate();
}
public override void DeActivate() {
TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像);
this.ct登場アニメ用 = null;
this.ct遅延表示 = null;
TJAPlayer3.tテクスチャの解放(ref this.txPreimage);
this.ctApparitionAnimation = null;
this.ctDelayedDisplay = null;
base.DeActivate();
}
public override void CreateManagedResource() {
this.txパネル本体 = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_preimage panel.png"), false);
this.txセンサ = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_sensor.png"), false);
//this.txセンサ光 = CDTXMania.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}5_sensor light.png" ), false );
this.txプレビュー画像がないときの画像 = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false);
this.txDefaultPreimage = TJAPlayer3.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false);
base.CreateManagedResource();
}
public override void ReleaseManagedResource() {
TJAPlayer3.tテクスチャの解放(ref this.txパネル本体);
TJAPlayer3.tテクスチャの解放(ref this.txセンサ);
TJAPlayer3.tテクスチャの解放(ref this.txセンサ光);
TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像がないときの画像);
TJAPlayer3.tテクスチャの解放(ref this.txDefaultPreimage);
base.ReleaseManagedResource();
}
public override int Draw() {
if (!base.IsDeActivated) {
if (base.IsFirstDraw) {
this.ct登場アニメ用 = new CCounter(0, 100, 5, TJAPlayer3.Timer);
this.ctセンサ光 = new CCounter(0, 100, 30, TJAPlayer3.Timer);
this.ctセンサ光.CurrentValue = 70;
this.ctApparitionAnimation = new CCounter(0, 100, 5, TJAPlayer3.Timer);
base.IsFirstDraw = false;
}
this.ct登場アニメ用.Tick();
this.ctセンサ光.TickLoop();
if ((!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (this.ct遅延表示 != null)) && this.ct遅延表示.IsTicked) {
this.ct遅延表示.Tick();
if ((this.ct遅延表示.CurrentValue >= 0) && this.b新しいプレビューファイルをまだ読み込んでいない) {
this.tプレビュー画像_動画の変更();
this.ctApparitionAnimation.Tick();
if ((!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (this.ctDelayedDisplay != null)) && this.ctDelayedDisplay.IsTicked) {
this.ctDelayedDisplay.Tick();
if ((this.ctDelayedDisplay.CurrentValue >= 0) && this.bNewPreimageStillLoading) {
this.tUpdatePreimage(TJAPlayer3.stageSongSelect.r現在選択中のスコア);
TJAPlayer3.Timer.Update();
this.ct遅延表示.NowTime = TJAPlayer3.Timer.NowTime;
this.b新しいプレビューファイルを読み込んだ = true;
} else if (this.ct遅延表示.IsEnded && this.ct遅延表示.IsTicked) {
this.ct遅延表示.Stop();
this.ctDelayedDisplay.NowTime = TJAPlayer3.Timer.NowTime;
this.bNewPreimageLoaded = true;
} else if (this.ctDelayedDisplay.IsEnded && this.ctDelayedDisplay.IsTicked) {
this.ctDelayedDisplay.Stop();
}
}
this.t描画処理_パネル本体();
this.t描画処理_プレビュー画像();
this.tDisplayPreimage();
}
return 0;
}
public CTexture? tGenerateAndGetPreimage(Cスコア? cScoreInst) {
this.tUpdatePreimage(cScoreInst);
return tGetPreimageTextureResized();
}
public CTexture? tGetPreimageTextureResized() {
if (this.rCurrentlyDisplayedPreimage != null) {
int width = TJAPlayer3.Skin.SongSelect_Preimage_Size[0];
int height = TJAPlayer3.Skin.SongSelect_Preimage_Size[1];
float xRatio = width / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Width;
float yRatio = height / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Height;
this.rCurrentlyDisplayedPreimage.Opacity = 255;
this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = xRatio;
this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = xRatio;
}
return rCurrentlyDisplayedPreimage;
}
// その他
#region [ private ]
//-----------------
private bool b動画フレームを作成した;
private CCounter ctセンサ光;
private CCounter ct遅延表示;
private CCounter ct登場アニメ用;
private int n前回描画したフレーム番号;
private int n本体X;
private int n本体Y;
private IntPtr pAVIBmp;
private readonly Rectangle rcセンサ光 = new Rectangle(0, 0xc0, 0x40, 0x40);
private readonly Rectangle rcセンサ本体下半分 = new Rectangle(0x40, 0, 0x40, 0x80);
private readonly Rectangle rcセンサ本体上半分 = new Rectangle(0, 0, 0x40, 0x80);
private CTexture r表示するプレビュー画像;
private string str現在のファイル名;
private CTexture txセンサ;
private CTexture txセンサ光;
private CTexture txパネル本体;
private CTexture txプレビュー画像;
private CTexture txプレビュー画像がないときの画像;
private bool b新しいプレビューファイルを読み込んだ;
private bool b新しいプレビューファイルをまだ読み込んでいない {
private CCounter ctDelayedDisplay;
private CCounter ctApparitionAnimation;
private CTexture rCurrentlyDisplayedPreimage;
private string strCurrentFilename;
private CTexture txPreimage;
private CTexture txDefaultPreimage;
private bool bNewPreimageLoaded;
private bool bNewPreimageStillLoading {
get {
return !this.b新しいプレビューファイルを読み込んだ;
return !this.bNewPreimageLoaded;
}
set {
this.b新しいプレビューファイルを読み込んだ = !value;
this.bNewPreimageLoaded = !value;
}
}
private void tプレビュー画像_動画の変更() {
this.pAVIBmp = IntPtr.Zero;
if (!TJAPlayer3.ConfigIni.bストイックモード) {
if (this.tプレビュー画像の指定があれば構築する()) {
return;
}
private void tUpdatePreimage(Cスコア? cScoreInst) {
if (cScoreInst != null && this.tBuildPreimageAssets(cScoreInst)) {
return;
}
this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像;
this.str現在のファイル名 = "";
}
private bool tプレビュー画像の指定があれば構築する() {
Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア;
if ((cスコア == null) || string.IsNullOrEmpty(cスコア..Preimage)) return false;
string str = ((!Path.IsPathRooted(cスコア..Preimage)) ? cスコア.. : "") + cスコア..Preimage;
if (!str.Equals(this.str現在のファイル名)) {
TJAPlayer3.tテクスチャの解放(ref this.txプレビュー画像);
this.str現在のファイル名 = str;
if (!File.Exists(this.str現在のファイル名)) {
Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 });
// If no preimage or preimage not found
this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage;
this.strCurrentFilename = "";
}
private bool tBuildPreimageAssets(Cスコア cScoreInst) {
if ((cScoreInst == null) || string.IsNullOrEmpty(cScoreInst..Preimage)) return false;
string str = ((!Path.IsPathRooted(cScoreInst..Preimage)) ? cScoreInst.. : "") + cScoreInst..Preimage;
if (!str.Equals(this.strCurrentFilename)) {
TJAPlayer3.tテクスチャの解放(ref this.txPreimage);
this.strCurrentFilename = str;
if (!File.Exists(this.strCurrentFilename)) {
LogNotification.PopWarning("Preimage not found ({0})".SafeFormat(this.strCurrentFilename));
return false;
}
this.txプレビュー画像 = TJAPlayer3.tテクスチャの生成(this.str現在のファイル名, false);
if (this.txプレビュー画像 != null) {
this.r表示するプレビュー画像 = this.txプレビュー画像;
this.txPreimage = TJAPlayer3.tテクスチャの生成(this.strCurrentFilename, false);
if (this.txPreimage != null) {
this.rCurrentlyDisplayedPreimage = this.txPreimage;
} else {
this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像;
this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage;
}
}
return true;
}
/// <summary>
/// 一時的に使用禁止。
/// </summary>
private void t描画処理_ジャンル文字列() {
CSongListNode c曲リストード = TJAPlayer3.stageSongSelect.rNowSelectedSong;
Cスコア cスコア = TJAPlayer3.stageSongSelect.r現在選択中のスコア;
if ((c曲リストード != null) && (cスコア != null)) {
string str = "";
switch (c曲リストード.eード種別) {
case CSongListNode.ENodeType.SCORE:
if ((c曲リストード.strジャンル == null) || (c曲リストード.strジャンル.Length <= 0)) {
if ((cスコア.. != null) && (cスコア...Length > 0)) {
str = cスコア..;
}
#if false // #32644 2013.12.21 yyagi "Unknown"なジャンル表示を削除。DTX/BMSなどの種別表示もしない。
else
{
switch( cスコア.. )
{
case CDTX.E種別.DTX:
str = "DTX";
break;
case CDTX.E種別.GDA:
str = "GDA";
break;
private void tDisplayPreimage() {
if (!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (((this.ctDelayedDisplay != null) && (this.ctDelayedDisplay.CurrentValue > 0)) && !this.bNewPreimageStillLoading)) {
case CDTX.E種別.G2D:
str = "G2D";
break;
case CDTX.E種別.BMS:
str = "BMS";
break;
case CDTX.E種別.BME:
str = "BME";
break;
}
str = "Unknown";
}
#endif
break;
}
str = c曲リストード.strジャンル;
break;
case CSongListNode.ENodeType.SCORE_MIDI:
str = "MIDI";
break;
case CSongListNode.ENodeType.BOX:
str = "MusicBox";
break;
case CSongListNode.ENodeType.BACKBOX:
str = "BackBox";
break;
case CSongListNode.ENodeType.RANDOM:
str = "Random";
break;
default:
str = "Unknown";
break;
}
TJAPlayer3.actTextConsole.tPrint(this.n本体X + 0x12, this.n本体Y - 1, CTextConsole.EFontType.CyanSlim, str);
}
}
private void t描画処理_センサ光() {
int num = (int)this.ctセンサ光.CurrentValue;
if (num < 12) {
int x = this.n本体X + 0xcc;
int y = this.n本体Y + 0x7b;
if (this.txセンサ光 != null) {
this.txセンサ光.vcScaleRatio = new Vector3D<float>(1f, 1f, 1f);
this.txセンサ光.Opacity = 0xff;
this.txセンサ光.t2D描画(x, y, new Rectangle((num % 4) * 0x40, (num / 4) * 0x40, 0x40, 0x40));
}
} else if (num < 0x18) {
int num4 = num - 11;
double num5 = ((double)num4) / 11.0;
double num6 = 1.0 + (num5 * 0.5);
int num7 = (int)(64.0 * num6);
int num8 = (int)(64.0 * num6);
int num9 = ((this.n本体X + 0xcc) + 0x20) - (num7 / 2);
int num10 = ((this.n本体Y + 0x7b) + 0x20) - (num8 / 2);
if (this.txセンサ光 != null) {
this.txセンサ光.vcScaleRatio = new Vector3D<float>((float)num6, (float)num6, 1f);
this.txセンサ光.Opacity = (int)(255.0 * (1.0 - num5));
this.txセンサ光.t2D描画(num9, num10, this.rcセンサ光);
}
}
}
private void t描画処理_センサ本体() {
int x = this.n本体X + 0xcd;
int y = this.n本体Y - 4;
if (this.txセンサ != null) {
this.txセンサ.t2D描画(x, y, this.rcセンサ本体上半分);
y += 0x80;
this.txセンサ.t2D描画(x, y, this.rcセンサ本体下半分);
}
}
private void t描画処理_パネル本体() {
if (this.ct登場アニメ用.IsEnded || (this.txパネル本体 != null)) {
this.n本体X = 16;
this.n本体Y = 86;
} else {
double num = ((double)this.ct登場アニメ用.CurrentValue) / 100.0;
double num2 = Math.Cos((1.5 + (0.5 * num)) * Math.PI);
this.n本体X = 8;
if (this.txパネル本体 != null)
this.n本体Y = 0x39 - ((int)(this.txパネル本体.sz画像サイズ.Height * (1.0 - (num2 * num2))));
else
this.n本体Y = 8;
}
if (this.txパネル本体 != null) {
this.txパネル本体.t2D描画(this.n本体X, this.n本体Y);
}
}
private unsafe void t描画処理_プレビュー画像() {
if (!TJAPlayer3.stageSongSelect.bCurrentlyScrolling && (((this.ct遅延表示 != null) && (this.ct遅延表示.CurrentValue > 0)) && !this.b新しいプレビューファイルをまだ読み込んでいない)) {
int x = this.n本体X + 0x12;
int y = this.n本体Y + 0x10;
float num3 = ((float)this.ct遅延表示.CurrentValue) / 100f;
float num3 = ((float)this.ctDelayedDisplay.CurrentValue) / 100f;
float num4 = 0.9f + (0.1f * num3);
if (this.r表示するプレビュー画像 != null) {
/*
int width = this.r表示するプレビュー画像.sz画像サイズ.Width;
int height = this.r表示するプレビュー画像.sz画像サイズ.Height;
if( width > 400 )
{
width = 400;
}
if( height > 400 )
{
height = 400;
}
*/
// Placeholder
if (this.rCurrentlyDisplayedPreimage != null) {
int width = TJAPlayer3.Skin.SongSelect_Preimage_Size[0];
int height = TJAPlayer3.Skin.SongSelect_Preimage_Size[1];
float xRatio = width / (float)this.r表示するプレビュー画像.sz画像サイズ.Width;
float yRatio = height / (float)this.r表示するプレビュー画像.sz画像サイズ.Height;
float xRatio = width / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Width;
float yRatio = height / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Height;
x += (400 - ((int)(width * num4))) / 2;
y += (400 - ((int)(height * num4))) / 2;
this.rCurrentlyDisplayedPreimage.Opacity = (int)(255f * num3);
this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = num4 * xRatio;
this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = num4 * xRatio;
this.r表示するプレビュー画像.Opacity = (int)(255f * num3);
this.r表示するプレビュー画像.vcScaleRatio.X = num4 * xRatio;
this.r表示するプレビュー画像.vcScaleRatio.Y = num4 * xRatio;
// this.r表示するプレビュー画像.t2D描画( x + 22, y + 12, new Rectangle( 0, 0, width, height ) );
// Temporary addition
this.r表示するプレビュー画像.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.SongSelect_Preimage[0], TJAPlayer3.Skin.SongSelect_Preimage[1]);
this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.SongSelect_Preimage[0], TJAPlayer3.Skin.SongSelect_Preimage[1]);
}
}
}
//-----------------
#endregion
}

View File

@ -209,7 +209,7 @@ namespace TJAPlayer3 {
this.ctOldBGScroll = new CCounter(0, (int)(txOldGenreBack.szTextureSize.Width * oldScale), 30, TJAPlayer3.Timer);
this.ctOldBGScroll.CurrentValue = Math.Min(scroll, (int)(txOldGenreBack.szTextureSize.Width * oldScale));
this.actPreimageパネル.t選択曲が変更された();
this.actPreimageパネル.tSelectedSongChanged();
this.actPresound.t選択曲が変更された();
this.act演奏履歴パネル.t選択曲が変更された();
this.actステータスパネル.t選択曲が変更された();
@ -1226,7 +1226,7 @@ namespace TJAPlayer3 {
//private CActFIFOBlack actFOtoNowLoading;
public CActFIFOStart actFOtoNowLoading;
private CActSelectInformation actInformation;
private CActSelectPreimageパネル actPreimageパネル;
public CActSelectPreimageパネル actPreimageパネル;
public CActSelectPresound actPresound;
private CActオプションパネル actオプションパネル;
private CActSelectステータスパネル actステータスパネル;

View File

@ -2842,7 +2842,7 @@ namespace TJAPlayer3 {
protected abstract void t進行描画_AVI();
protected void t進行描画_AVI(int x, int y) {
if (((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) && (!TJAPlayer3.ConfigIni.bストイックモード && TJAPlayer3.ConfigIni.bEnableAVI)) {
if (((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) && TJAPlayer3.ConfigIni.bEnableAVI) {
this.actAVI.t進行描画(x, y);
}
}

View File

@ -7,6 +7,16 @@ using static TJAPlayer3.CActSelect曲リスト;
namespace TJAPlayer3 {
internal class CStage結果 : CStage {
// Modals Lua management
public CLuaModalScript lcModal { get; private set; }
public void RefreshSkin() {
lcModal?.Dispose();
lcModal = new CLuaModalScript(CSkin.Path("Modules/Modal"));
}
// プロパティ
public STDGBVALUE<bool> b新記録スキル;
@ -593,7 +603,9 @@ namespace TJAPlayer3 {
new Modal(
Modal.EModalType.Coin,
0,
this.nEarnedMedalsCount[i]),
(long)this.nEarnedMedalsCount[i],
TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Medals
),
i);
// Check unlockables
@ -612,7 +624,7 @@ namespace TJAPlayer3 {
}
displayedModals = new Modal[] { null, null, null, null, null };
displayedModals = null;
#endregion
@ -1357,10 +1369,9 @@ namespace TJAPlayer3 {
#region [Display modals]
// Display modal is present
for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) {
if (displayedModals[i] != null)
displayedModals[i].tDisplayModal();
if (displayedModals != null) {
lcModal?.Update();
lcModal?.Draw();
}
#endregion
@ -1415,90 +1426,59 @@ namespace TJAPlayer3 {
|| (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LC)
|| (TJAPlayer3.Pad.bPressedDGB(EPad.Decide)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
#region [ Skip animations ]
if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower
&& this.actParameterPanel.ctMainCounter.CurrentValue < this.actParameterPanel.MountainAppearValue) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
this.actParameterPanel.tSkipResultAnimations();
} else if (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan
&& (ctPhase1 != null && ctPhase1.IsUnEnded)) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
ctPhase1.CurrentValue = (int)ctPhase1.EndValue;
}
#endregion
else {
if (!mqModals.tIsQueueEmpty(0)
&& (
TJAPlayer3.Pad.bPressedDGB(EPad.Decide)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)
)
) {
displayedModals[0] = mqModals.tPopModal(0);
displayedModals[0]?.tPlayModalSfx();
} else if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) {
#region [ Return to song select screen ]
if ((lcModal?.AnimationFinished() ?? true)) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
actFI.tフェードアウト開始();
if (!mqModals.tAreBothQueuesEmpty()
&& (TJAPlayer3.Pad.bPressedDGB(EPad.Decide)
|| TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) {
displayedModals = mqModals.tPopModalInOrder();
if (TJAPlayer3.latestSongSelect == TJAPlayer3.stageSongSelect)
if (TJAPlayer3.stageSongSelect.rNowSelectedSong.rParentNode != null)
TJAPlayer3.stageSongSelect.actSongList.tCloseBOX();
tPostprocessing();
} else if (TJAPlayer3.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) {
{
base.ePhaseID = CStage.EPhase.Common_FADEOUT;
this.eフェードアウト完了時の戻り値 = E戻り値.;
bgmResultLoop.tStop();
TJAPlayer3.Skin.bgmDanResult.tStop();
TJAPlayer3.Skin.bgmTowerResult.tStop();
if (!mqModals.tAreBothQueuesEmpty())
LogNotification.PopError("Unexpected Error: Exited results screen with remaining modals, this is likely due to a Lua script issue.");
#region [ Return to song select screen ]
actFI.tフェードアウト開始();
if (TJAPlayer3.latestSongSelect == TJAPlayer3.stageSongSelect)
if (TJAPlayer3.stageSongSelect.rNowSelectedSong.rParentNode != null)
TJAPlayer3.stageSongSelect.actSongList.tCloseBOX();
tPostprocessing();
{
base.ePhaseID = CStage.EPhase.Common_FADEOUT;
this.eフェードアウト完了時の戻り値 = E戻り値.;
bgmResultLoop.tStop();
TJAPlayer3.Skin.bgmDanResult.tStop();
TJAPlayer3.Skin.bgmTowerResult.tStop();
}
#endregion
}
#endregion
}
}
} else if ((TJAPlayer3.ConfigIni.nPlayerCount > 1 && (
TJAPlayer3.Pad.bPressedDGB(EPad.LRed2P)
|| TJAPlayer3.Pad.bPressedDGB(EPad.RRed2P)
))) {
if (!mqModals.tIsQueueEmpty(1) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
displayedModals[1] = mqModals.tPopModal(1);
displayedModals[1]?.tPlayModalSfx();
}
} else if ((TJAPlayer3.ConfigIni.nPlayerCount > 2 && (
TJAPlayer3.Pad.bPressedDGB(EPad.LRed3P)
|| TJAPlayer3.Pad.bPressedDGB(EPad.RRed3P)
))) {
if (!mqModals.tIsQueueEmpty(2) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
displayedModals[2] = mqModals.tPopModal(2);
displayedModals[2]?.tPlayModalSfx();
}
} else if ((TJAPlayer3.ConfigIni.nPlayerCount > 3 && (
TJAPlayer3.Pad.bPressedDGB(EPad.LRed4P)
|| TJAPlayer3.Pad.bPressedDGB(EPad.RRed4P)
))) {
if (!mqModals.tIsQueueEmpty(3) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
displayedModals[3] = mqModals.tPopModal(3);
displayedModals[3]?.tPlayModalSfx();
}
} else if ((TJAPlayer3.ConfigIni.nPlayerCount > 4 && (
TJAPlayer3.Pad.bPressedDGB(EPad.LRed5P)
|| TJAPlayer3.Pad.bPressedDGB(EPad.RRed5P)
))) {
if (!mqModals.tIsQueueEmpty(4) && this.actParameterPanel.ctMainCounter.CurrentValue >= this.actParameterPanel.MountainAppearValue) {
TJAPlayer3.Skin.soundDecideSFX.tPlay();
displayedModals[4] = mqModals.tPopModal(4);
displayedModals[4]?.tPlayModalSfx();
}
}
@ -1804,7 +1784,7 @@ namespace TJAPlayer3 {
// Modal queues
private ModalQueue mqModals;
private Modal[] displayedModals;
private Modal? displayedModals;
// Coins information
private int[] nEarnedMedalsCount = { 0, 0, 0, 0, 0 };

View File

@ -613,7 +613,7 @@ namespace TJAPlayer3 {
TJAPlayer3.SaveFileInstances[iPlayer].data.DanGold = iG;
TJAPlayer3.SaveFileInstances[iPlayer].data.DanType = cs;
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(iPlayer);
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(0);
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();
@ -639,7 +639,7 @@ namespace TJAPlayer3 {
}
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(iPlayer);
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(0);
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();

View File

@ -2,23 +2,6 @@
class CNamePlate {
public CLuaNamePlateScript lcNamePlate { get; private set; }
public void RefleshSkin() {
/*
for (int player = 0; player < 5; player++)
{
this.pfName[player]?.Dispose();
if (TJAPlayer3.SaveFileInstances[player].data.Title == "" || TJAPlayer3.SaveFileInstances[player].data.Title == null)
this.pfName[player] = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.NamePlate_Font_Name_Size_Normal);
else
this.pfName[player] = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.NamePlate_Font_Name_Size_WithTitle);
}
this.pfTitle?.Dispose();
this.pfdan?.Dispose();
this.pfTitle = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.NamePlate_Font_Title_Size);
this.pfdan = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.NamePlate_Font_Dan_Size);
*/
lcNamePlate?.Dispose();
lcNamePlate = new CLuaNamePlateScript(CSkin.Path("Modules/NamePlate"));
@ -36,31 +19,8 @@
}
RefleshSkin();
//ctNamePlateEffect = new CCounter(0, 120, 16.6f, TJAPlayer3.Timer);
//ctAnimatedNamePlateTitle = new CCounter(0, 10000, 60.0f, TJAPlayer3.Timer);
}
/*
public void tNamePlateDisplayNamePlateBase(int x, int y, int item)
{
int namePlateBaseX = TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width;
int namePlateBaseY = TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 12;
TJAPlayer3.Tx.NamePlateBase?.t2D描画(x, y, new RectangleF(0, item * namePlateBaseY, namePlateBaseX, namePlateBaseY));
}
public void tNamePlateDisplayNamePlate_Extension(int x, int y, int item)
{
int namePlateBaseX = TJAPlayer3.Tx.NamePlate_Extension.szTextureSize.Width;
int namePlateBaseY = TJAPlayer3.Tx.NamePlate_Extension.szTextureSize.Height / 12;
TJAPlayer3.Tx.NamePlate_Extension?.t2D描画(x, y, new RectangleF(0, item * namePlateBaseY, namePlateBaseX, namePlateBaseY));
}
*/
public void tNamePlateRefreshTitles(int player) {
int actualPlayer = TJAPlayer3.GetActualPlayer(player);
@ -76,23 +36,16 @@
title = CLangManager.LangInstance.GetString("AI_TITLE");
dan = stages[Math.Max(0, TJAPlayer3.ConfigIni.nAILevel - 1)] + "面";
} else {
name = TJAPlayer3.SaveFileInstances[player].data.Name;
title = TJAPlayer3.SaveFileInstances[player].data.Title;
dan = TJAPlayer3.SaveFileInstances[player].data.Dan;
name = TJAPlayer3.SaveFileInstances[actualPlayer].data.Name;
title = TJAPlayer3.SaveFileInstances[actualPlayer].data.Title;
dan = TJAPlayer3.SaveFileInstances[actualPlayer].data.Dan;
}
bIsPrevAI[player] = isAI;
/*
txTitle[player] = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(new TitleTextureKey(title, pfTitle, Color.Black, Color.Empty, 1000));
txName[player] = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(new TitleTextureKey(name, pfName[player], Color.White, Color.Black, 1000));
if (TJAPlayer3.SaveFileInstances[player].data.DanGold) txdan[player] = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(new TitleTextureKey($"<g.#FFE34A.#EA9622>{dan}</g>", pfdan, Color.White, Color.Black, 1000));
else txdan[player] = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(new TitleTextureKey(dan, pfdan, Color.White, Color.Black, 1000));
*/
if (TJAPlayer3.SaveFileInstances[player].data.DanGold)
lcNamePlate.SetInfos(player, name, title, $"<g.#FFE34A.#EA9622>{dan}</g>", TJAPlayer3.SaveFileInstances[player].data);
lcNamePlate.SetInfos(player, name, title, $"<g.#FFE34A.#EA9622>{dan}</g>", TJAPlayer3.SaveFileInstances[actualPlayer].data);
else
lcNamePlate.SetInfos(player, name, title, dan, TJAPlayer3.SaveFileInstances[player].data);
lcNamePlate.SetInfos(player, name, title, dan, TJAPlayer3.SaveFileInstances[actualPlayer].data);
}
@ -109,7 +62,7 @@
}
bIsPrevAI[basePlayer] = isAI;
lcNamePlate.Draw(x, y, Opacity, basePlayer, player);
lcNamePlate.Draw(x, y, Opacity, basePlayer, TJAPlayer3.P1IsBlue() ? 1 : 0);
}
private bool[] bIsPrevAI = new bool[5];