1
0
mirror of synced 2024-11-28 17:31:00 +01:00
OpenTaiko/TJAPlayer3/Common/Modal.cs

91 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FDK;
using System.Drawing;
namespace TJAPlayer3
{
internal class Modal
{
public Modal(EModalType mt, int ra, int re)
{
modalType = mt;
rarity = ra;
reference = re;
_isSet = false;
}
public void tSetupModal()
{
CTexture[] arrRef;
if (modalFormat == EModalFormat.Half)
arrRef = TJAPlayer3.Tx.Modal_Half;
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
: 640,
0,
(modalFormat == EModalFormat.Full)
? 1280
: 640,
720);
_isSet = true;
}
public void tDisplayModal()
{
if (_isSet == true)
{
_box?.t2D描画(TJAPlayer3.app.Device, 640 * player, 0, _boxRect);
}
}
public enum EModalType
{
Coin,
Puchichara,
Character,
Title,
Text,
Confirm,
}
public enum EModalFormat
{
Full,
Half,
}
// Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm
public int reference;
public int rarity;
public EModalType modalType;
public EModalFormat modalFormat;
// For modalFormat = Half only
public int player;
private CTexture _box;
private Rectangle _boxRect;
private bool _isSet;
}
}