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

Puchichara, Character unlock modals and few fixes about lua nameplates

This commit is contained in:
0auBSQ 2024-07-29 00:04:45 +09:00
parent 22cafcd82e
commit 68bc38186c
7 changed files with 50 additions and 22 deletions

View File

@ -18,15 +18,15 @@ Includes the following arguments:
- (object) modal_info: Asset related information, modal_type dependent:
> Coins -> (long) modal_info: The coin value of the play
> Character
> Puchichara
> 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
> Puchichara
> 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)
```

View File

@ -64,11 +64,17 @@ function registerNewModal(player, rarity, modal_type, modal_asset_informations,
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
@ -83,6 +89,7 @@ function registerNewModal(player, rarity, modal_type, modal_asset_informations,
-- > modal_asset_informations: CSongListNode
-- > modal_asset_visual_references: CTexture (Preimage)
_modal_header = getLocalizedString("MODAL_TITLE_SONG")
_modal_body = modal_current_info.ldTitle:GetString("")
end
@ -157,15 +164,33 @@ function draw()
tx_header:t2D_DisplayImage_AnchorCenter(960,180)
if modal_current_type == 3 then
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

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

@ -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

@ -36,16 +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;
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);
}
@ -62,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];