infoskill done data
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ namespace BrewMonster
|
||||
// TODO: Implement GetNameDisplay - requires game instance access
|
||||
BrewMonster.CECStringTab pStrTab = EC_Game.GetSkillDesc();
|
||||
string str = pStrTab.GetWideString(id);
|
||||
return string.IsNullOrEmpty(str) ? str : string.Empty;
|
||||
return string.IsNullOrEmpty(str) ? string.Empty : str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,21 +103,18 @@ namespace BrewMonster
|
||||
RANGE_SLEF, // 自身
|
||||
}
|
||||
|
||||
// Attributes
|
||||
private ElementSkill m_pSkillCore;
|
||||
private int m_idSkill; // Skill ID
|
||||
private int m_iLevel; // Skill level
|
||||
private int m_iCoolCnt; // Cooling time counter
|
||||
private int m_iCoolTime; // Total cooling time
|
||||
private bool m_bCooling; // In cooling state
|
||||
private int m_iChargeCnt; // Charging time counter
|
||||
private int m_iChargeMax; // Charging time maximum count value
|
||||
private bool m_bCharging; // In charging state
|
||||
private int m_idSkill;
|
||||
private int m_iLevel;
|
||||
private int m_iCoolCnt;
|
||||
private int m_iCoolTime;
|
||||
private bool m_bCooling;
|
||||
private int m_iChargeCnt;
|
||||
private int m_iChargeMax;
|
||||
private bool m_bCharging;
|
||||
|
||||
// Static skill string provider
|
||||
private static CECSkillStr l_SkillStr = new CECSkillStr();
|
||||
|
||||
// Public accessor for skill core (for CheckSkillCastCondition)
|
||||
public ElementSkill SkillCore => m_pSkillCore;
|
||||
|
||||
// Constructor
|
||||
@@ -287,28 +284,27 @@ namespace BrewMonster
|
||||
return EC_Game.GetSkillDesc().GetWideString(GetSkillID() * 10);
|
||||
}
|
||||
|
||||
public string GetDesc()
|
||||
public StringBuilder GetDesc()
|
||||
{
|
||||
if (m_pSkillCore == null || l_SkillStr == null)
|
||||
return string.Empty;
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder(1024);
|
||||
m_pSkillCore.GetIntroduction(sb, l_SkillStr);
|
||||
return sb.ToString();
|
||||
return sb;
|
||||
}
|
||||
public static bool GetDesc(int idSkill, int iLevel, string szText, int iBufLen)
|
||||
public static StringBuilder GetDesc(int idSkill, int iLevel, StringBuilder szText, int iBufLen)
|
||||
{
|
||||
if (szText == null || iBufLen == 0)
|
||||
return false;
|
||||
return null;
|
||||
|
||||
CECSkill pSkill = new CECSkill(idSkill, iLevel);
|
||||
if (pSkill == null)
|
||||
{
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
string sz = pSkill.GetDesc();
|
||||
|
||||
return true;
|
||||
szText = pSkill.GetDesc();
|
||||
return szText;
|
||||
}
|
||||
public int GetCoreCoolingTime()
|
||||
{
|
||||
@@ -434,32 +430,6 @@ namespace BrewMonster
|
||||
return m_pSkillCore != null ? m_pSkillCore.GetCommonCoolDownTime() : 0;
|
||||
}*/
|
||||
|
||||
// Get skill description (static method)
|
||||
public static bool GetDesc(int idSkill, int iLevel, out string szText, int iBufLen)
|
||||
{
|
||||
szText = string.Empty;
|
||||
|
||||
if (iBufLen <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CECSkill pSkill = new CECSkill(idSkill, iLevel);
|
||||
if (pSkill == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string sz = pSkill.GetDesc();
|
||||
if (sz != null && sz.Length < iBufLen)
|
||||
{
|
||||
szText = sz;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check skill type
|
||||
public bool IsGoblinSkill()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using ModelRenderer.Scripts.GameData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BrewMonster.Scripts.Skills
|
||||
@@ -304,15 +305,10 @@ namespace BrewMonster.Scripts.Skills
|
||||
{
|
||||
return CECGameRun.Instance.GetHostPlayer().CheckSkillLearnCondition(skillID, true);
|
||||
}
|
||||
public string GetSkillDescription(int skillID, int level)
|
||||
public StringBuilder GetSkillDescription(int skillID, int level)
|
||||
{
|
||||
string tmp = "";
|
||||
if (CECSkill.GetDesc(skillID, level, tmp, 1024))
|
||||
{
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
return tmp;
|
||||
StringBuilder tmp = new StringBuilder();
|
||||
return CECSkill.GetDesc(skillID, level, tmp, 1024);
|
||||
}
|
||||
public int GetRequiredBook(int skillID, int level)
|
||||
{
|
||||
@@ -400,7 +396,7 @@ namespace BrewMonster.Scripts.Skills
|
||||
var juniors = GetJunior(rootSkillID);
|
||||
int maxHeight = 0;
|
||||
|
||||
foreach(var skill in juniors)
|
||||
foreach (var skill in juniors)
|
||||
{
|
||||
int subHeight = GetSkillTreeHeight((int)skill.Key);
|
||||
if (subHeight > maxHeight)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#define SKILL_CLIENT
|
||||
using BrewMonster.Scripts.Skills;
|
||||
using CSNetwork.GPDataType;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
@@ -143,12 +144,11 @@ namespace BrewMonster
|
||||
#if SKILL_CLIENT
|
||||
public override int GetIntroduction(Skill skill, StringBuilder buffer, string format)
|
||||
{
|
||||
string result = string.Format(format,
|
||||
buffer.Append(GPDataTypeHelper.ReplacePercentD(format,
|
||||
skill.GetLevel(),
|
||||
-5 + 7 * skill.GetLevel(),
|
||||
1.9 * skill.GetLevel() * skill.GetLevel() + 64 * skill.GetLevel() + 36.7);
|
||||
buffer.Append(result);
|
||||
return result.Length;
|
||||
1.9 * skill.GetLevel() * skill.GetLevel() + 64 * skill.GetLevel() + 36.7));
|
||||
return buffer.Length;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -82,9 +82,7 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay
|
||||
|
||||
public void SetColor(Color color)
|
||||
{
|
||||
if (m_color != color)
|
||||
UpdateRenderTargert();
|
||||
m_color = color;
|
||||
skillImage.color = color;
|
||||
}
|
||||
|
||||
private void UpdateRenderTargert()
|
||||
|
||||
@@ -169,9 +169,9 @@ namespace BrewMonster.UI
|
||||
m_IconMap[(byte)EC_GAMEUI_ICONS.ICONS_SKILL] = (SKILL_ICONLIST_NAME, Resources.LoadAll<Sprite>(SKILL_ICONLIST_NAME));
|
||||
m_IconMap[(byte)EC_GAMEUI_ICONS.ICONS_ACTION] = (ACTION_ICONLIST_NAME, Resources.LoadAll<Sprite>(ACTION_ICONLIST_NAME));
|
||||
}
|
||||
public void SetCover(AUIImagePicture pImgPic, string nameImage, EC_GAMEUI_ICONS iCONS_SKILL)
|
||||
public void SetCover(AUIImagePicture pImgPic, string nameImage, EC_GAMEUI_ICONS iCONS_TYPE)
|
||||
{
|
||||
pImgPic.SetImage(m_IconMap[(byte)iCONS_SKILL].Item2.FirstOrDefault(s => s.name == nameImage));
|
||||
pImgPic.SetImage(m_IconMap[(byte)iCONS_TYPE].Item2.FirstOrDefault(s => s.name == nameImage));
|
||||
}
|
||||
|
||||
/// <summary>Refresh team UI (Arrange Team dialog). Called after team join/leave/member data.</summary>
|
||||
|
||||
@@ -3,6 +3,7 @@ using BrewMonster.Scripts.Skills;
|
||||
using BrewMonster.UI;
|
||||
using CSNetwork.GPDataType;
|
||||
using System;
|
||||
using System.Text;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Splines;
|
||||
@@ -16,7 +17,6 @@ namespace BrewMonster
|
||||
{
|
||||
[SerializeField] private TextMeshProUGUI m_skillNameLbl;
|
||||
[SerializeField] private TextMeshProUGUI skillLevel;
|
||||
[SerializeField] private Image skillIcon;
|
||||
[SerializeField] private GameObject m_highlight;
|
||||
[SerializeField] private Button m_upgradeBtn;
|
||||
[SerializeField] private AUIImagePicture m_skillIconImgPic;
|
||||
@@ -97,7 +97,7 @@ namespace BrewMonster
|
||||
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
|
||||
|
||||
string str = GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11326), needMoney, needSp);
|
||||
var messagebox = uiManager.ShowMessageBox("Game_LearnSkill", str);
|
||||
var messagebox = uiManager.ShowMessageBox("Game_LearnSkill", str);
|
||||
messagebox.SetData((uint)m_skillID);
|
||||
//GetGameUIMan()->MessageBox("Game_LearnSkill", str, //GetGameUIMan()->GetStringFromTable(231),
|
||||
// MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
|
||||
@@ -125,32 +125,34 @@ namespace BrewMonster
|
||||
enumSkillLearnedState learnedState = model.GetSkillLearnedState(m_skillID);
|
||||
|
||||
var spriteName = model.GetSkillIcon(skillID);
|
||||
var sprites = Resources.LoadAll<Sprite>("iconlist_skill_multisprite");
|
||||
if (sprites == null || sprites.Length == 0)
|
||||
return;
|
||||
CECUIManager.Instance.GetInGameUIMan().SetCover(m_skillIconImgPic, spriteName, EC_GAMEUI_ICONS.ICONS_SKILL);
|
||||
|
||||
for (int i = 0; i < sprites.Length; i++)
|
||||
{
|
||||
if (sprites[i].name == spriteName)
|
||||
{
|
||||
skillIcon.sprite = sprites[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* var sprites = Resources.LoadAll<Sprite>("iconlist_skill_multisprite");
|
||||
if (sprites == null || sprites.Length == 0)
|
||||
return;
|
||||
|
||||
string skillDsc;
|
||||
for (int i = 0; i < sprites.Length; i++)
|
||||
{
|
||||
if (sprites[i].name == spriteName)
|
||||
{
|
||||
skillIcon.sprite = sprites[i];
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
StringBuilder skillDsc;
|
||||
int reqLevel;
|
||||
int reqRealmLevel;
|
||||
if (enumSkillLearnedState.SKILL_NOT_LEARNED == learnedState)
|
||||
{
|
||||
skillIcon.color = Color.gray;
|
||||
m_skillIconImgPic.SetColor(Color.gray);
|
||||
skillDsc = model.GetSkillDescription(m_skillID, 1);
|
||||
reqLevel = ElementSkill.GetRequiredLevel((uint)m_skillID, 1);
|
||||
reqRealmLevel = ElementSkill.GetRequiredRealmLevel((uint)m_skillID, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
skillIcon.color = Color.white;
|
||||
m_skillIconImgPic.SetColor(Color.white);
|
||||
skillDsc = model.GetSkillDescription(m_skillID, m_curLevel);
|
||||
reqLevel = ElementSkill.GetRequiredLevel((uint)m_skillID, m_curLevel);
|
||||
reqRealmLevel = ElementSkill.GetRequiredRealmLevel((uint)m_skillID, m_curLevel);
|
||||
@@ -159,13 +161,15 @@ namespace BrewMonster
|
||||
{
|
||||
reqLevel = 1;
|
||||
}
|
||||
skillDsc += GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11328), reqLevel);
|
||||
skillDsc.AppendLine(GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11328), reqLevel));
|
||||
if (reqRealmLevel != 0)
|
||||
{
|
||||
skillDsc += GetStringFromTable(11401);
|
||||
skillDsc += GetGameUIMan().GetRealmName(reqRealmLevel);
|
||||
skillDsc.AppendLine(GetStringFromTable(11401));
|
||||
skillDsc.AppendLine(GetGameUIMan().GetRealmName(reqRealmLevel));
|
||||
}
|
||||
|
||||
var str = EC_Utility.FormatForTextMeshPro(skillDsc.ToString());
|
||||
if (skillID == 1)
|
||||
BMLogger.LogError("HoangDev: CDlgSkillSubListItem skillDsc for skillID " + skillID + " : " + str);
|
||||
//m_skillIconImgPic.SetHint(skillDsc);
|
||||
|
||||
string skillName = model.GetSkillName(m_skillID);
|
||||
|
||||
+380
-363
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3872a82199fafae4a811f93464626a45
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:95d6d825ffc45e6ba389d5e2baffd576d409d5718b1888331c763dfe2b9460e5
|
||||
size 200522636
|
||||
oid sha256:def3c6a4f58ef9b5c9558210328e5b6f3ed11bfee5b577271ee43fa110616b82
|
||||
size 200521689
|
||||
|
||||
@@ -211,7 +211,10 @@ namespace BrewMonster
|
||||
{
|
||||
if (!TrySplitIndexAndText(payload, out int idx, out string text))
|
||||
continue;
|
||||
PutString(idx, text, isWide);
|
||||
|
||||
// Check if the text is a multiline quoted string
|
||||
string fullText = ReadMultilineQuotedString(text, allLines, ref j);
|
||||
PutString(idx, fullText, isWide);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -265,6 +268,52 @@ namespace BrewMonster
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a multiline quoted string similar to C++ AWScriptFile.GetNextToken(false)
|
||||
/// If the string starts with " but doesn't end with ", continues reading subsequent lines
|
||||
/// </summary>
|
||||
private string ReadMultilineQuotedString(string firstLine, List<string> allLines, ref int currentIndex)
|
||||
{
|
||||
// If it doesn't start with a quote, return as-is
|
||||
if (string.IsNullOrEmpty(firstLine) || firstLine[0] != '"')
|
||||
return firstLine;
|
||||
|
||||
// Check if the string is already complete (starts and ends with quotes on same line)
|
||||
if (firstLine.Length >= 2 && firstLine[firstLine.Length - 1] == '"')
|
||||
{
|
||||
// Check if it's not an escaped quote by looking at preceding character
|
||||
// Simple check: if there's more than one char and last is ", assume complete
|
||||
return firstLine;
|
||||
}
|
||||
|
||||
// The string is incomplete - need to read more lines
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(firstLine);
|
||||
|
||||
// Continue reading lines until we find the closing quote
|
||||
for (int k = currentIndex + 1; k < allLines.Count; k++)
|
||||
{
|
||||
string nextLine = allLines[k];
|
||||
|
||||
// Append newline to preserve original formatting (matching C++ behavior)
|
||||
sb.Append("\n");
|
||||
sb.Append(nextLine);
|
||||
|
||||
// Check if this line contains the closing quote
|
||||
// Look for " at the end of the trimmed line
|
||||
string trimmedNext = nextLine.TrimEnd();
|
||||
if (trimmedNext.Length > 0 && trimmedNext[trimmedNext.Length - 1] == '"')
|
||||
{
|
||||
// Found the closing quote, update the index and return
|
||||
currentIndex = k;
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// If we reach here, the closing quote wasn't found - return what we have
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private void PutString(int id, string value, bool isWide)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
|
||||
+9
-36
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user