1
0
mirror of synced 2024-11-30 18:24:32 +01:00

NamePlateをLuaに移植

This commit is contained in:
Takkkom 2024-07-17 21:00:15 +09:00
parent 1558eb2a70
commit bcb7c68d73
62 changed files with 743 additions and 87 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,76 @@
{
"font_name_normal":{
"size":22,
"maxsize":330
},
"font_name_withtitle":{
"size":18,
"maxsize":180
},
"font_title":{
"size":16,
"maxsize":240
},
"font_dan":{
"size":18,
"maxsize":100
},
"text_name_normal":{
"offset_x":181,
"offset_y":55
},
"text_name_withtitle":{
"offset_x":181,
"offset_y":55
},
"text_name_full":{
"offset_x":216,
"offset_y":55
},
"text_title":{
"offset_x":186,
"offset_y":22
},
"text_dan":{
"offset_x":103,
"offset_y":55
},
"title_plate":{
"offset_x":-3,
"offset_y":-3
},
"titles":{
"0":{
"framecount":0,
"effect":"none"
},
"1":{
"framecount":0,
"effect":"flash"
},
"2":{
"framecount":0,
"effect":"flash"
},
"3":{
"framecount":0,
"effect":"flash"
},
"4":{
"framecount":0,
"effect":"flash"
},
"5":{
"framecount":0,
"effect":"flash"
},
"6":{
"framecount":0,
"effect":"flash"
},
"7":{
"framecount":5,
"effect":"none"
}
}
}

View File

@ -0,0 +1,407 @@
import ('System.Drawing')
local ring_types = { "Red", "Blue", "Yellow", "Green", "Purple" }
local dan_types = { "Silver", "Gold", "Rainbow" }
local config = nil
local config_font_name_normal_size = nil
local config_font_name_normal_maxsize = nil
local config_font_name_withtitle_size = nil
local config_font_name_withtitle_maxsize = nil
local config_text_name_full_offset_x = nil
local config_text_name_full_offset_y = nil
local config_font_title_size = nil
local config_font_title_maxsize = nil
local config_font_dan_size = nil
local config_font_dan_maxsize = nil
local config_text_title_offset_x = nil
local config_text_title_offset_y = nil
local config_text_dan_offset_x = nil
local config_text_dan_offset_y = nil
local config_title_plate_offset_x = nil
local config_title_plate_offset_y = nil
local config_titletypes = { "0", "1" }
local config_titleplate_effects = { }
local base = nil
local dan_gradation = { }
local dan_gold_bar = nil
local rings = { }
local ring_players = { }
local titles = { }
local title_plates = { { } }
local title_plate_star_big = { }
local title_plate_star_small = { }
local slash = nil
local font_name_normal_size = nil
local font_name_withtitle = nil
local font_title = nil
local font_dan = nil
local player_data = { nil, nil, nil, nil, nil }
local name_titlekey = { nil, nil, nil, nil, nil }
local title_titlekey = { nil, nil, nil, nil, nil }
local dan_titlekey = { nil, nil, nil, nil, nil }
local notitle = { false, false, false, false, false }
local nodan = { false, false, false, false, false }
local titleplate_counter = 0
local namePlateEffect_counter = 0
function implDrawStar(scale, x, y, star_small)
star_small:tSetScale(scale, scale)
star_small:t2D_DisplayImage_AnchorCenter(x, y)
end
function implDrawStarFlash(x, y, titleTexIndex)
star_small = title_plate_star_small[titleTexIndex]
resolutionScaleX = skininfo.width / 1280.0;
resolutionScaleY = skininfo.height / 720.0;
if namePlateEffect_counter <= 10 then
implDrawStar(1.0 - (namePlateEffect_counter / 10 * 1.0), x + (63 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 3 and namePlateEffect_counter <= 10 then
implDrawStar(1.0 - ((namePlateEffect_counter - 3) / 7 * 1.0), x + (38 * resolutionScaleX), y + (7 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 6 and namePlateEffect_counter <= 10 then
implDrawStar(1.0 - ((namePlateEffect_counter - 6) / 4 * 1.0), x + (51 * resolutionScaleX), y + (5 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 8 and namePlateEffect_counter <= 10 then
implDrawStar(0.3 - ((namePlateEffect_counter - 8) / 2 * 0.3), x + (110 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 11 and namePlateEffect_counter <= 13 then
implDrawStar(1.0 - ((namePlateEffect_counter - 11) / 2 * 1.0), x + (38 * resolutionScaleX), y + (7 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 11 and namePlateEffect_counter <= 15 then
implDrawStar(1.0, x + (51 * resolutionScaleX), y + 5, star_small)
end
if namePlateEffect_counter >= 11 and namePlateEffect_counter <= 17 then
implDrawStar(1.0 - ((namePlateEffect_counter - 11) / 7 * 1.0), x + (110 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 16 and namePlateEffect_counter <= 20 then
implDrawStar(0.2 - ((namePlateEffect_counter - 16) / 4 * 0.2), x + (63 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 17 and namePlateEffect_counter <= 20 then
implDrawStar(1.0 - ((namePlateEffect_counter - 17) / 3 * 1.0), x + (99 * resolutionScaleX), y + (1 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 20 and namePlateEffect_counter <= 24 then
implDrawStar(0.4, x + (63 * resolutionScaleX), y + 25, star_small)
end
if namePlateEffect_counter >= 20 and namePlateEffect_counter <= 25 then
implDrawStar(1.0, x + (99 * resolutionScaleX), y + 1, star_small)
end
if namePlateEffect_counter >= 20 and namePlateEffect_counter <= 30 then
implDrawStar(0.5 - ((namePlateEffect_counter - 20) / 10 * 0.5), x + (152 * resolutionScaleX), y + (7 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 31 and namePlateEffect_counter <= 37 then
implDrawStar(0.5 - ((namePlateEffect_counter - 31) / 6 * 0.5), x + (176 * resolutionScaleX), y + (8 * resolutionScaleY), star_small)
implDrawStar(1.0 - ((namePlateEffect_counter - 31) / 6 * 1.0), x + (175 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 31 and namePlateEffect_counter <= 40 then
implDrawStar(0.9 - ((namePlateEffect_counter - 31) / 9 * 0.9), x + (136 * resolutionScaleX), y + (24 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 34 and namePlateEffect_counter <= 40 then
implDrawStar(0.7 - ((namePlateEffect_counter - 34) / 6 * 0.7), x + (159 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 41 and namePlateEffect_counter <= 42 then
implDrawStar(0.7, x + (159 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 43 and namePlateEffect_counter <= 50 then
implDrawStar(0.8 - ((namePlateEffect_counter - 43) / 7 * 0.8), x + (196 * resolutionScaleX), y + (23 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 51 and namePlateEffect_counter <= 57 then
implDrawStar(0.8 - ((namePlateEffect_counter - 51) / 6 * 0.8), x + (51 * resolutionScaleX), y + (5 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 51 and namePlateEffect_counter <= 52 then
implDrawStar(0.2, x + (166 * resolutionScaleX), y + (22 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 51 and namePlateEffect_counter <= 53 then
implDrawStar(0.8, x + (136 * resolutionScaleX), y + (24 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 51 and namePlateEffect_counter <= 55 then
implDrawStar(1.0, x + (176 * resolutionScaleX), y + (8 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 51 and namePlateEffect_counter <= 55 then
implDrawStar(1.0, x + (176 * resolutionScaleX), y + (8 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 61 and namePlateEffect_counter <= 70 then
implDrawStar(1.0 - ((namePlateEffect_counter - 61) / 9 * 1.0), x + (196 * resolutionScaleX), y + (23 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 61 and namePlateEffect_counter <= 67 then
implDrawStar(0.7 - ((namePlateEffect_counter - 61) / 6 * 0.7), x + (214 * resolutionScaleX), y + (14 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 63 and namePlateEffect_counter <= 70 then
implDrawStar(0.5 - ((namePlateEffect_counter - 63) / 7 * 0.5), x + (129 * resolutionScaleX), y + (24 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 63 and namePlateEffect_counter <= 70 then
implDrawStar(0.5 - ((namePlateEffect_counter - 63) / 7 * 0.5), x + (129 * resolutionScaleX), y + (24 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 65 and namePlateEffect_counter <= 70 then
implDrawStar(0.8 - ((namePlateEffect_counter - 65) / 5 * 0.8), x + (117 * resolutionScaleX), y + (7 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 71 and namePlateEffect_counter <= 72 then
implDrawStar(0.8, x + (151 * resolutionScaleX), y + (25 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 71 and namePlateEffect_counter <= 74 then
implDrawStar(0.8, x + (117 * resolutionScaleX), y + (7 * resolutionScaleY), star_small)
end
if namePlateEffect_counter >= 85 and namePlateEffect_counter <= 112 then
slash.Opacity = 1400 - (namePlateEffect_counter - 85) * 50
slash:t2D_DisplayImage(x + ((((namePlateEffect_counter - 85) * (150 / 27))) * resolutionScaleX), y + (7 * resolutionScaleY));
end
if namePlateEffect_counter >= 105 and namePlateEffect_counter <= 120 then
big_scale = 1.0
if namePlateEffect_counter < 112 then
big_scale = (namePlateEffect_counter - 105) / 8
title_plate_star_big[titleTexIndex].Opacity = 255
else
title_plate_star_big[titleTexIndex].Opacity = (255 - (namePlateEffect_counter - 112) * 31.875)
end
title_plate_star_big[titleTexIndex]:tSetScale(big_scale, big_scale)
title_plate_star_big[titleTexIndex]:t2D_DisplayImage_AnchorCenter(x + (193 * resolutionScaleX), y + (6 * resolutionScaleY))
end
end
function implDrawTitleEffect(x, y, titleTexIndex)
if titleTexIndex >= 1 and titleTexIndex <= #title_plates then
if config_titleplate_effects[titleTexIndex] == "flash" then
implDrawStarFlash(x, y, titleTexIndex)
elseif config_titleplate_effects[titleTexIndex] == "none" then
else
end
end
end
function implDrawTitlePlate(x, y, opacity, titleTexIndex)
if titleTexIndex >= 1 and titleTexIndex < #title_plates then
titleplate_frame = 1 + math.ceil(titleplate_counter * (#title_plates[titleTexIndex] - 1))
tx_titleplate = title_plates[titleTexIndex][titleplate_frame]
tx_titleplate.Opacity = opacity
tx_titleplate:t2D_DisplayImage(x + config_title_plate_offset_x, y + config_title_plate_offset_y)
end
end
function reloadLanguage(lang)
end
function getCharaOffset()
return base.szTextureSize.Width / 2
end
function setInfos(player, name, title, dan, data)
player_lua = player + 1
player_data[player_lua] = data
notitle[player_lua] = (title == "")
nodan[player_lua] = (player_data[player_lua].Dan == nil or player_data[player_lua].Dan == "")
if notitle[player_lua] then
name_titlekey[player_lua] = createTitleTextureKey(name, font_name_normal_size, 99999)
else
name_titlekey[player_lua] = createTitleTextureKey(name, font_name_withtitle, 99999)
end
title_titlekey[player_lua] = createTitleTextureKey(title, font_title, 99999)
dan_titlekey[player_lua] = createTitleTextureKey(dan, font_dan, 99999)
end
function loadAssets()
config = loadConfig("Config.json")
config_font_name_normal_size = getNum(config["font_name_normal"]["size"])
config_font_name_normal_maxsize = getNum(config["font_name_normal"]["maxsize"])
config_font_name_withtitle_size = getNum(config["font_name_withtitle"]["size"])
config_font_name_withtitle_maxsize = getNum(config["font_name_withtitle"]["maxsize"])
config_font_title_size = getNum(config["font_title"]["size"])
config_font_title_maxsize = getNum(config["font_title"]["maxsize"])
config_font_dan_size = getNum(config["font_dan"]["size"])
config_font_dan_maxsize = getNum(config["font_dan"]["maxsize"])
config_text_name_normal_offset_x = getNum(config["text_name_normal"]["offset_x"])
config_text_name_normal_offset_y = getNum(config["text_name_normal"]["offset_y"])
config_text_name_withtitle_offset_x = getNum(config["text_name_withtitle"]["offset_x"])
config_text_name_withtitle_offset_y = getNum(config["text_name_withtitle"]["offset_y"])
config_text_name_full_offset_x = getNum(config["text_name_full"]["offset_x"])
config_text_name_full_offset_y = getNum(config["text_name_full"]["offset_y"])
config_text_title_offset_x = getNum(config["text_title"]["offset_x"])
config_text_title_offset_y = getNum(config["text_title"]["offset_y"])
config_text_dan_offset_x = getNum(config["text_dan"]["offset_x"])
config_text_dan_offset_y = getNum(config["text_dan"]["offset_y"])
config_title_plate_offset_x = getNum(config["title_plate"]["offset_x"])
config_title_plate_offset_y = getNum(config["title_plate"]["offset_y"])
titletypes_array = skinconfig.NamePlate_TitleTypes
for i = 0, titletypes_array.Length - 1 do
config_titletypes[i + 1] = titletypes_array[i]
end
base = loadTexture("Base.png")
dan_base = loadTexture("Dan_Base.png")
dan_gold = loadTexture("Dan_Gold.png")
dan_rainbow = loadTexture("Dan_Rainbow.png")
dan_silver = loadTexture("Dan_Silver.png")
dan_gold_bar = loadTexture("Dan_Gold_Bar.png")
slash = loadTexture("Slash.png")
for i = 1, 3 do
dan_gradation[i] = loadTexture("Dan_"..dan_types[i]..".png")
end
for i = 1, 5 do
rings[i] = loadTexture("Ring_"..ring_types[i]..".png")
ring_players[i] = loadTexture("Ring_"..tostring(i).."P.png")
end
for i = 1, #config_titletypes do
titledir = "Title/"..config_titletypes[i]
titleplate_config = config["titles"][config_titletypes[i]]
config_titleplate_effects[i] = getText(titleplate_config["effect"])
local titleplates = { }
for j = 0, getNum(titleplate_config["framecount"]) do
titleplates[j + 1] = loadTexture(titledir.."/"..j..".png")
end
title_plates[i] = titleplates
if config_titleplate_effects[i] == "flash" then
title_plate_star_small[i] = loadTexture(titledir.."/Small.png")
title_plate_star_big[i] = loadTexture(titledir.."/Big.png")
end
end
font_name_normal_size = loadFontRenderer(config_font_name_normal_size, "regular")
font_name_withtitle = loadFontRenderer(config_font_name_withtitle_size, "regular")
font_title = loadFontRenderer(config_font_title_size, "regular")
font_dan = loadFontRenderer(config_font_dan_size, "regular")
end
function drawDan(x, y, opacity, type, titleTex)
base.Opacity = opacity
base:t2D_DisplayImage(x, y)
dan_base.Opacity = opacity
dan_base:t2D_DisplayImage(x, y)
--Dan text
if not(nodan[player_lua]) then
titleTex:tSetScale(math.min(config_font_dan_maxsize / titleTex.szTextureSize.Width, 1.0), 1.0)
titleTex.Opacity = opacity
titleTex:t2D_DisplayImage_AnchorCenter(x + config_text_dan_offset_x, y + config_text_dan_offset_y)
end
end
function drawTitlePlate(x, y, opacity, titletype, titleTex)
base.Opacity = opacity
base:t2D_DisplayImage(x, y)
implDrawTitlePlate(x, y, opacity, titletype + 1)
titleTex:tSetScale(math.min(config_font_title_maxsize / titleTex.szTextureSize.Width, 1.0), 1.0)
titleTex.Opacity = opacity
titleTex:t2D_DisplayImage_AnchorCenter(x + config_text_title_offset_x, y + config_text_title_offset_y)
end
function update()
titleplate_counter = titleplate_counter + (3.3 * fps.deltaTime)
if titleplate_counter >= 1 then
titleplate_counter = 0
end
namePlateEffect_counter = namePlateEffect_counter + (60 * fps.deltaTime)
if namePlateEffect_counter >= 120 then
namePlateEffect_counter = 0
end
end
function draw(x, y, opacity, player, side)
player_lua = player + 1
side_lua = side + 1
--White background
base.Opacity = opacity
base:t2D_DisplayImage(x, y)
--Upper (title) plate
titleplate_index = player_data[player_lua].TitleType + 1
if not(notitle[player_lua]) then
implDrawTitlePlate(x, y, opacity, titleplate_index)
end
--Dan plate
if not(player_data[player_lua].Dan == nil) and not(player_data[player_lua].Dan == "") then
dan_base.Opacity = opacity
dan_base:t2D_DisplayImage(x, y)
dan_gradation[player_data[player_lua].DanType + 1].Opacity = opacity
dan_gradation[player_data[player_lua].DanType + 1]:t2D_DisplayImage(x, y)
end
--Glow
implDrawTitleEffect(x, y, titleplate_index)
--Player number
rings[side_lua].Opacity = opacity
rings[side_lua]:t2D_DisplayImage(x, y)
ring_players[player_lua].Opacity = opacity
ring_players[player_lua]:t2D_DisplayImage(x, y)
--Dan text
if not(nodan[player_lua]) then
tx_dan = getTextTex(dan_titlekey[player_lua], false, false)
tx_dan:tSetScale(math.min(config_font_dan_maxsize / tx_dan.szTextureSize.Width, 1.0), 1.0)
tx_dan.Opacity = opacity
tx_dan:t2D_DisplayImage_AnchorCenter(x + config_text_dan_offset_x, y + config_text_dan_offset_y)
end
--Title/Name text
if notitle[player_lua] then
tx_name = getTextTex(name_titlekey[player_lua], false, false)
tx_name:tSetScale(math.min(config_font_name_normal_maxsize / tx_name.szTextureSize.Width, 1.0), 1.0)
tx_name.Opacity = opacity
tx_name:t2D_DisplayImage_AnchorCenter(x + config_text_name_normal_offset_x, y + config_text_name_normal_offset_y)
else
tx_title = getTextTex(title_titlekey[player_lua], false, false)
tx_title:tSetScale(math.min(config_font_title_maxsize / tx_title.szTextureSize.Width, 1.0), 1.0)
tx_title.Opacity = opacity
tx_title:t2D_DisplayImage_AnchorCenter(x + config_text_title_offset_x, y + config_text_title_offset_y)
tx_name = getTextTex(name_titlekey[player_lua], false, false)
tx_name:tSetScale(math.min(config_font_name_withtitle_maxsize / tx_name.szTextureSize.Width, 1.0), 1.0)
tx_name.Opacity = opacity
if nodan[player_lua] then
tx_name:t2D_DisplayImage_AnchorCenter(x + config_text_name_withtitle_offset_x, y + config_text_name_withtitle_offset_y)
else
tx_name:t2D_DisplayImage_AnchorCenter(x + config_text_name_full_offset_x, y + config_text_name_full_offset_y)
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -0,0 +1,9 @@
{
"name":"SimpleStyle",
"description":"Template :TemplateMoyai:",
"version":"0.6.0",
"creator":"OpenTaiko Team",
"width":1920,
"height":1080,
"nameplate_titletypes":["0", "1", "2", "3", "4", "5", "6", "7"]
}

View File

@ -6,6 +6,7 @@ using System.Diagnostics;
using FDK;
using System.Drawing;
using System.Linq;
using System.Text.Json;
namespace TJAPlayer3
{
@ -1056,8 +1057,10 @@ namespace TJAPlayer3
{
var str = "";
LoadSkinConfigFromFile(Path(@$"SkinConfig.ini"), ref str);
this.t文字列から読み込み(str);
this.t文字列から読み込み(str);
using Stream stream = File.OpenRead(Path(@$"SkinConfig.json"));
SkinConfig = JsonSerializer.Deserialize<SkinConfigJson>(stream);
}
private void t文字列から読み込み(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier.
@ -1094,6 +1097,7 @@ namespace TJAPlayer3
}
switch (strCommand)
{
/*
case "Name":
{
this.Skin_Name = strParam;
@ -1118,6 +1122,7 @@ namespace TJAPlayer3
}
break;
}
*/
//case "FontName":
//{
// strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar);
@ -9537,11 +9542,20 @@ namespace TJAPlayer3
}
#region SkinConfig
public SkinConfigJson SkinConfig = new SkinConfigJson();
#region General
public string Skin_Name = "Unknown";
public string Skin_Version = "Unknown";
public string Skin_Creator = "Unknown";
public int[] Resolution = new int[] { 1280, 720 };
public string Skin_Name => SkinConfig.Name;
public string Skin_Version => SkinConfig.Version;
public string Skin_Creator => SkinConfig.Creators;
public int[] Resolution
{
get
{
return new int[] { SkinConfig.Width, SkinConfig.Height };
}
}
public string FontName { get { return _fontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } }
private Dictionary<string, string> _fontNameLocalized = new Dictionary<string, string>();
public string BoxFontName { get { return _boxFontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } }
@ -9550,9 +9564,6 @@ namespace TJAPlayer3
#region Config
public int Config_NamePlate_Ptn_Title;
public int[] Config_NamePlate_Ptn_Title_Boxes;
public int[] Config_Arrow_X = new int[] { 552, 552 };
public int[] Config_Arrow_Y = new int[] { 297, 363 };

View File

@ -853,9 +853,10 @@ namespace TJAPlayer3
*/
#endregion
if( r現在のステージ != null )
{
this.n進行描画の戻り値 = ( r現在のステージ != null ) ? r現在のステージ.Draw() : 0;
if( r現在のステージ != null )
{
TJAPlayer3.NamePlate.lcNamePlate.Update();
this.n進行描画の戻り値 = ( r現在のステージ != null ) ? r現在のステージ.Draw() : 0;
#region [ ]
//---------------------

View File

@ -87,16 +87,17 @@ namespace TJAPlayer3
return array;
}
protected void RunLuaCode(LuaFunction luaFunction, params object[] args)
protected object[] RunLuaCode(LuaFunction luaFunction, params object[] args)
{
try
{
luaFunction.Call(args);
return luaFunction.Call(args);
}
catch (Exception exception)
{
Crash(exception);
}
return new object[0];
}
private JsonNode LoadConfig(string name)
@ -212,6 +213,7 @@ namespace TJAPlayer3
LuaScript["getNumArray"] = getNumArray;
LuaScript["getTextArray"] = getTextArray;
LuaScript["displayDanPlate"] = CActSelect段位リスト.tDisplayDanPlate;
LuaScript["skinconfig"] = TJAPlayer3.Skin.SkinConfig;
if (loadAssets) LoadAssets();

View File

@ -0,0 +1,72 @@
using FDK;
using NLua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TJAPlayer3
{
internal class CLuaNamePlateScript : CLuaScript
{
private LuaFunction lfGetCharaOffset;
private LuaFunction lfSetInfos;
private LuaFunction lfDrawDan;
private LuaFunction lfDrawTitlePlate;
private LuaFunction lfUpdate;
private LuaFunction lfDraw;
public CLuaNamePlateScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets)
{
lfGetCharaOffset = (LuaFunction)LuaScript["getCharaOffset"];
lfSetInfos = (LuaFunction)LuaScript["setInfos"];
lfDrawDan = (LuaFunction)LuaScript["drawDan"];
lfDrawTitlePlate = (LuaFunction)LuaScript["drawTitlePlate"];
lfUpdate = (LuaFunction)LuaScript["update"];
lfDraw = (LuaFunction)LuaScript["draw"];
}
public int GetCharaOffset()
{
if (!Avaibale) 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;
RunLuaCode(lfSetInfos, player, name ?? "", title ?? "", dan ?? "", data);
}
public void DrawDan(int x, int y, int opacity, int danGrade, CTexture titleTex)
{
if (!Avaibale) return;
RunLuaCode(lfDrawDan, x, y, opacity, danGrade, titleTex);
}
public void DrawTitlePlate(int x, int y, int opacity, int type, CTexture titleTex)
{
if (!Avaibale) return;
RunLuaCode(lfDrawTitlePlate, x, y, opacity, type, titleTex);
}
public void Update(params object[] args)
{
if (!Avaibale) return;
RunLuaCode(lfUpdate, args);
}
public void Draw(int x, int y, int opacity, int player, int side)
{
if (!Avaibale) return;
RunLuaCode(lfDraw, x, y, opacity, player, side);
}
}
}

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TJAPlayer3
{
internal class SkinConfigJson
{
[JsonInclude]
[JsonPropertyName("name")]
public string Name { get; private set; } = "";
[JsonInclude]
[JsonPropertyName("description")]
public string Description { get; private set; } = "";
[JsonInclude]
[JsonPropertyName("version")]
public string Version { get; private set; } = "";
[JsonInclude]
[JsonPropertyName("creator")]
public string Creators { get; private set; } = "Unknown";
[JsonInclude]
[JsonPropertyName("width")]
public int Width { get; private set; } = 1280;
[JsonInclude]
[JsonPropertyName("height")]
public int Height { get; private set; } = 720;
[JsonInclude]
[JsonPropertyName("nameplate_titletypes")]
public string[] NamePlate_TitleTypes { get; private set; } = new string[1] { "0" };
}
}

View File

@ -151,6 +151,7 @@ namespace TJAPlayer3
Menu_Highlight = TxC(@$"Menu_Highlight.png");
Loading = TxC(@$"Loading.png");
Scanning_Loudness = TxC(@$"Scanning_Loudness.png");
/*
NamePlate = new CTexture[2];
NamePlateBase = TxC(@$"NamePlate.png");
NamePlate_Extension = TxC(@$"NamePlate_Extension.png");
@ -161,10 +162,9 @@ namespace TJAPlayer3
NamePlate_Effect[2] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}GoldBStar.png");
NamePlate_Effect[3] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}PurpleBStar.png");
NamePlate_Effect[4] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Slash.png");
*/
TJAPlayer3.Skin.Config_NamePlate_Ptn_Title = System.IO.Directory.GetDirectories(CSkin.Path(BASE + @$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}")).Length;
TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes = new int[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title];
/*
NamePlate_Title = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title][];
NamePlate_Title_Big = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title];
NamePlate_Title_Small = new CTexture[TJAPlayer3.Skin.Config_NamePlate_Ptn_Title];
@ -182,6 +182,7 @@ namespace TJAPlayer3
NamePlate_Title_Big[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Big.png");
NamePlate_Title_Small[i] = TxC(@$"9_NamePlateEffect{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}" + i.ToString() + @$"{Path.DirectorySeparatorChar}Small.png");
}
*/
listTexture.Add(lcBlackFade = new CLuaFadeScript(CSkin.Path("Modules/BlackFade")));
listTexture.Add(lcWhiteFade = new CLuaFadeScript(CSkin.Path("Modules/WhiteFade")));
@ -2546,22 +2547,13 @@ namespace TJAPlayer3
Menu_Highlight,
//Enum_Song,
Loading,
Scanning_Loudness,
NamePlateBase,
NamePlate_Extension;
Scanning_Loudness;
public CLuaFadeScript lcBlackFade;
public CLuaFadeScript lcWhiteFade;
public CLuaFadeScript lcResultFade;
public CLuaAttentionScript lcAttention;
public CLuaEnumSongsScript lcEnumSong;
public CLuaOverlayScript lcOverlay;
public CTexture[] NamePlate;
public CTexture[] NamePlate_Effect = new CTexture[5];
public CTexture[][] NamePlate_Title;
public CTexture[] NamePlate_Title_Big;
public CTexture[] NamePlate_Title_Small;
#endregion

View File

@ -582,7 +582,7 @@ namespace TJAPlayer3
int _charaId = TJAPlayer3.SaveFileInstances[_actual].data.Character;
int chara_x = TJAPlayer3.Skin.Title_Entry_NamePlate[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = TJAPlayer3.Skin.Title_Entry_NamePlate[0] + TJAPlayer3.NamePlate.lcNamePlate.GetCharaOffset();
int chara_y = TJAPlayer3.Skin.Title_Entry_NamePlate[1];
int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0];
@ -686,7 +686,7 @@ namespace TJAPlayer3
//int chara_y = (int)(TJAPlayer3.Skin.Characters_Title_Normal_Y[_charaId][player] - CharaY);
int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[player];// + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2
int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[player] - (int)CharaY;
int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player];

View File

@ -257,7 +257,7 @@ namespace TJAPlayer3
//CMenuCharacter.tMenuDisplayCharacter(0, (int)(-200 + CharaX), (int)(336 - CharaY), CMenuCharacter.ECharacterAnimation.NORMAL);
int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.NamePlate.lcNamePlate.GetCharaOffset();
int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[0];
CMenuCharacter.tMenuDisplayCharacter(

View File

@ -671,7 +671,7 @@ namespace TJAPlayer3
//int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player];
//int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player];
int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = TJAPlayer3.Skin.SongSelect_NamePlate_X[player] + TJAPlayer3.NamePlate.lcNamePlate.GetCharaOffset();
int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[player];
//int puchi_x = player == 0 ? 0 + 100 : 981 + 250;

View File

@ -822,7 +822,7 @@ namespace TJAPlayer3
//int chara_x = TJAPlayer3.Skin.Characters_Result_X[_charaId][pos];
//int chara_y = TJAPlayer3.Skin.Characters_Result_Y[_charaId][pos];
int chara_x = namePlate_x[pos] - (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] ? uioffset_x : 0) + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = namePlate_x[pos] - (TJAPlayer3.Skin.Characters_UseResult1P[_charaId] ? uioffset_x : 0) + TJAPlayer3.NamePlate.lcNamePlate.GetCharaOffset();
int chara_y = namePlate_y[pos];
int p1chara_x = is2PSide ? TJAPlayer3.Skin.Resolution[0] / 2 : 0;

View File

@ -415,16 +415,16 @@ namespace TJAPlayer3
{
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
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);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
}
int danGrade = 0;
int danGrade = 0;
if (pos > 0)
{
danGrade = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[pos]].clearStatus;
@ -432,13 +432,16 @@ namespace TJAPlayer3
var scroll = DrawSide_Menu(i + (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2));
/*
TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase(
scroll.Item1 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2,
scroll.Item2 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24,
(8 + danGrade));
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
*/
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
TJAPlayer3.NamePlate.lcNamePlate.DrawDan(scroll.Item1, scroll.Item2, 255, danGrade, tmpTex);
//tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
}
@ -481,14 +484,18 @@ namespace TJAPlayer3
else if (pos == 0)
iType = 0;
/*
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拡大率考慮上中央基準描画(
scroll.Item1,
scroll.Item2);
}
}
*/
tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
TJAPlayer3.NamePlate.lcNamePlate.DrawTitlePlate(scroll.Item1, scroll.Item2, 255, iType, tmpTex);
//tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
}
}
@ -547,7 +554,7 @@ namespace TJAPlayer3
//int chara_x = (int)(TJAPlayer3.Skin.Characters_Menu_X[_charaId][0] + (-200 + CharaX));
//int chara_y = (int)(TJAPlayer3.Skin.Characters_Menu_Y[_charaId][0] - CharaY);
int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2;
int chara_x = (int)CharaX + TJAPlayer3.Skin.SongSelect_NamePlate_X[0] + TJAPlayer3.NamePlate.lcNamePlate.GetCharaOffset();
int chara_y = TJAPlayer3.Skin.SongSelect_NamePlate_Y[0] - (int)CharaY;
int puchi_x = chara_x + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[0];

View File

@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FDK;
using static TJAPlayer3.CDTX;
namespace TJAPlayer3
{
@ -604,16 +605,19 @@ namespace TJAPlayer3
else if (index == 0)
iType = 0;
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);
}
/*
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);
}
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
*/
TJAPlayer3.NamePlate.lcNamePlate.DrawTitlePlate(x, y, 255, iType, tmpTex);
}
}
break;
case ModeType.DanTitle:
for(int i = 1; i < TJAPlayer3.Skin.SongSelect_NewHeya_Box_Count - 1; i++)
@ -634,12 +638,12 @@ namespace TJAPlayer3
if (i != 0)
{
tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray);
}
else
{
tmpTex.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
//TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
}
TJAPlayer3.Tx.NewHeya_Box.t2D描画(x, y);
@ -651,17 +655,20 @@ namespace TJAPlayer3
if (index > 0)
{
danGrade = TJAPlayer3.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[index].str文字].clearStatus;
}
}
TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase(
x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2,
y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24,
(8 + danGrade));
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.NamePlate.lcNamePlate.DrawDan(x, y, 255, danGrade, tmpTex);
/*
TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase(
x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2,
y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24,
(8 + danGrade));
TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]);
*/
}
}
break;
}
}

View File

@ -11,9 +11,11 @@ using static TJAPlayer3.CActSelect曲リスト;
namespace TJAPlayer3
{
class CNamePlate
{
{
public CLuaNamePlateScript lcNamePlate { get; private set; }
public void RefleshSkin()
{
/*
for (int player = 0; player < 5; player++)
{
this.pfName[player]?.Dispose();
@ -29,12 +31,18 @@ namespace TJAPlayer3
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"));
for (int player = 0; player < 5; player++)
{
tNamePlateRefreshTitles(player);
}
}
public CNamePlate()
{
RefleshSkin();
for (int player = 0; player < 5; player++)
{
if (TJAPlayer3.SaveFileInstances[player].data.DanType < 0) TJAPlayer3.SaveFileInstances[player].data.DanType = 0;
@ -42,13 +50,14 @@ namespace TJAPlayer3
if (TJAPlayer3.SaveFileInstances[player].data.TitleType < 0) TJAPlayer3.SaveFileInstances[player].data.TitleType = 0;
tNamePlateRefreshTitles(player);
}
RefleshSkin();
ctNamePlateEffect = new CCounter(0, 120, 16.6f, TJAPlayer3.Timer);
ctAnimatedNamePlateTitle = new CCounter(0, 10000, 60.0f, TJAPlayer3.Timer);
//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;
@ -66,6 +75,7 @@ namespace TJAPlayer3
TJAPlayer3.Tx.NamePlate_Extension?.t2D描画(x, y, new RectangleF(0, item * namePlateBaseY, namePlateBaseX, namePlateBaseY));
}
*/
public void tNamePlateRefreshTitles(int player)
{
@ -73,21 +83,34 @@ namespace TJAPlayer3
string[] stages = { "初", "二", "三", "四", "五", "六", "七", "八", "九", "極" };
string name = CLangManager.LangInstance.GetString("AI_NAME");
string title = CLangManager.LangInstance.GetString("AI_TITLE");
string dan = stages[Math.Max(0, TJAPlayer3.ConfigIni.nAILevel - 1)] + "面";
if (!TJAPlayer3.ConfigIni.bAIBattleMode || actualPlayer == 0)
string name;
string title;
string dan;
bool isAI = TJAPlayer3.ConfigIni.bAIBattleMode && player == 1;
if (isAI)
{
name = CLangManager.LangInstance.GetString("AI_NAME");
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;
dan = TJAPlayer3.SaveFileInstances[player].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));
else txdan[player] = TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(new TitleTextureKey(dan, pfdan, Color.White, Color.Black, 1000));
*/
lcNamePlate.SetInfos(player, name, title, dan, TJAPlayer3.SaveFileInstances[player].data);
}
@ -97,17 +120,29 @@ namespace TJAPlayer3
float resolutionScaleY = TJAPlayer3.Skin.Resolution[1] / 720.0f;
int basePlayer = player;
player = TJAPlayer3.GetActualPlayer(player);
tNamePlateRefreshTitles(player);
player = TJAPlayer3.GetActualPlayer(player);
//tNamePlateRefreshTitles(player);
/*
ctNamePlateEffect.TickLoop();
ctAnimatedNamePlateTitle.TickLoop();
this.txName[player].Opacity = Opacity;
this.txTitle[player].Opacity = Opacity;
this.txdan[player].Opacity = Opacity;
*/
bool isAI = TJAPlayer3.ConfigIni.bAIBattleMode && basePlayer == 1;
if (bIsPrevAI[basePlayer] != isAI)
{
tNamePlateRefreshTitles(player);
}
bIsPrevAI[basePlayer] = isAI;
lcNamePlate.Draw(x, y, Opacity, basePlayer, player);
/*
TJAPlayer3.Tx.NamePlateBase.Opacity = Opacity;
@ -203,8 +238,10 @@ namespace TJAPlayer3
// Overlap frame
tNamePlateDisplayNamePlateBase(x, y, 4);
*/
}
/*
private void tNamePlateDraw(int player, int x, int y, int Opacity = 255)
{
if (Opacity == 0)
@ -341,13 +378,6 @@ namespace TJAPlayer3
}
if (this.ctNamePlateEffect.CurrentValue >= 105 && this.ctNamePlateEffect.CurrentValue <= 120)
{
/*
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].Opacity = this.ctNamePlateEffect.n現在の値 >= 112 ? (int)(255 - (this.ctNamePlateEffect.n現在の値 - 112) * 31.875f) : 255;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].vc拡大縮小倍率.X = this.ctNamePlateEffect.n現在の値 >= 112 ? 1.0f : (this.ctNamePlateEffect.n現在の値 - 105) / 8f;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].vc拡大縮小倍率.Y = this.ctNamePlateEffect.n現在の値 >= 112 ? 1.0f : (this.ctNamePlateEffect.n現在の値 - 105) / 8f;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].t2D拡大率考慮中央基準描画(x + 193, y + 6);
*/
int tt = TJAPlayer3.SaveFileInstances[player].data.TitleType;
if (tt >= 0 && tt < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title && TJAPlayer3.Tx.NamePlate_Title_Big[tt] != null) {
TJAPlayer3.Tx.NamePlate_Title_Big[tt].Opacity = this.ctNamePlateEffect.CurrentValue >= 112 ? (int)(255 - (this.ctNamePlateEffect.CurrentValue - 112) * 31.875f) : 255;
@ -359,14 +389,11 @@ namespace TJAPlayer3
}
}
}
*/
/*
private void tNamePlateStarDraw(int player, float Scale, float x, float y)
{
/*
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].vc拡大縮小倍率.X = Scale;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].vc拡大縮小倍率.Y = Scale;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].t2D拡大率考慮中央基準描画(x, y);
*/
{
int tt = TJAPlayer3.SaveFileInstances[player].data.TitleType;
if (tt >= 0 && tt < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title && TJAPlayer3.Tx.NamePlate_Title_Small[tt] != null)
{
@ -376,7 +403,9 @@ namespace TJAPlayer3
}
}
*/
/*
private CCachedFontRenderer[] pfName = new CCachedFontRenderer[5];
private CCachedFontRenderer pfTitle;
private CCachedFontRenderer pfdan;
@ -387,5 +416,8 @@ namespace TJAPlayer3
private CTexture[] txName = new CTexture[5];
private CTexture[] txTitle = new CTexture[5];
private CTexture[] txdan = new CTexture[5];
*/
private bool[] bIsPrevAI = new bool[5];
}
}