public string GetIndexDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, TO8CHLI skits, Dictionary <uint, TSS.TSSEntry> inGameIdDict, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); string url = HyoutaTools.Tales.Vesperia.Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Skit, version, versionPostfix, locale, websiteLanguage, phpLinks, extra: RefString); sb.Append("<tr>"); sb.Append("<td>"); sb.Append(CategoryString); sb.Append("</td>"); if (websiteLanguage.WantsJp()) { sb.Append("<td>"); sb.Append("<a href=\"" + url + "\">"); sb.Append(inGameIdDict[StringDicIdName].StringJpnHtml(version, inGameIdDict)); sb.Append("</a>"); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td>"); sb.Append("<a href=\"" + url + "\">"); sb.Append(inGameIdDict[StringDicIdName].StringEngHtml(version, inGameIdDict)); sb.Append("</a>"); sb.Append("</td>"); } sb.Append("<td>"); Website.WebsiteGenerator.AppendCharacterBitfieldAsImageString(sb, inGameIdDict, version, CharacterBitmask, websiteLanguage.MainJp()); sb.Append("</td>"); sb.Append("</tr>"); return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict) { StringBuilder sb = new StringBuilder(); int colspan = websiteLanguage.WantsBoth() ? 1 : 2; if (websiteLanguage.WantsJp()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicId].StringJpnHtml(version, inGameIdDict)); sb.Append("</span><br>"); sb.Append(inGameIdDict[TextStringDicId].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicId].StringEngHtml(version, inGameIdDict)); sb.Append("</span><br>"); sb.Append(inGameIdDict[TextStringDicId].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } return(sb.ToString()); }
public static Stream TryGetNecropolisMap(string basepath, string mapname, GameLocale locale, GameVersion version) { string folder = Path.Combine(ConstructBtlPackPath(basepath, locale, version), 23.ToString("D4") + ".ext"); var files = System.IO.Directory.GetFiles(folder, mapname + ".*", SearchOption.TopDirectoryOnly); Util.Assert(files.Length == 1); return(TryCreateStreamFromPath(files[0])); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, ItemDat.ItemDat items, TSSFile stringDic, Dictionary <uint, TSSEntry> inGameIdDict, List <SearchPointContent> searchPointContents, List <SearchPointItem> searchPointItems, int index, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); sb.Append("<tr id=\"searchpoint").Append(Index).Append("\">"); sb.Append("<td colspan=\"5\">"); sb.Append("[#").Append(index).Append("] "); switch (SearchPointType) { case 0: sb.Append("Tree Stump"); break; case 1: sb.Append("Shell"); break; case 2: sb.Append("Bones"); break; case 3: sb.Append("Seagulls"); break; default: sb.Append(SearchPointType); break; } if (CoordY < 0) { sb.Append(" (Underwater)"); } if (ScenarioBegin > 1000999) { switch (ScenarioBegin) { case 3000000: sb.Append(" (Chapter 3 only)"); break; case 3590000: sb.Append(" (once Erealumen Crystallands accessible)"); break; default: sb.Append(" (Appears after scenario ").Append(ScenarioBegin).Append(")"); break; } } //sb.Append( "<br>" ) //sb.Append( "9: " ).Append( Unknown9 ).Append( "<br>" ); //sb.Append( "11: " ).Append( Unknown11 ).Append( "<br>" ); //sb.Append( "14a: " ).Append( Unknown14a ).Append( "<br>" ); sb.Append("</td>"); sb.Append("</tr>"); sb.Append("<tr>"); for (uint i = 0; i < SearchPointContentCount; ++i) { sb.Append("<td>"); sb.Append(searchPointContents[(int)(SearchPointContentIndex + i)].GetDataAsHtml(version, versionPostfix, locale, websiteLanguage, items, stringDic, inGameIdDict, searchPointItems, phpLinks: phpLinks)); sb.Append("</td>"); } for (uint i = SearchPointContentCount; i < 5; ++i) { sb.Append("<td>"); sb.Append("</td>"); } sb.Append("</tr>"); return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict) { StringBuilder sb = new StringBuilder(); sb.Append("<tr id=\"skill" + InGameID + "\">"); //sb.Append( RefString + "<br>" ); sb.Append("<td>"); sb.Append("<img src=\"skill-icons/category-" + Category + ".png\" width=\"32\" height=\"32\">"); sb.Append("</td>"); int colspan = websiteLanguage.WantsBoth() ? 1 : 2; if (websiteLanguage.WantsJp()) { sb.Append("<td colspan=\"" + colspan + "\" class=\"skilljpn\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } sb.Append("<td class=\"skilldata\">"); if (LearnableByBitmask > 0) { sb.Append("<span class=\"equip\">"); Website.WebsiteGenerator.AppendCharacterBitfieldAsImageString(sb, inGameIdDict, version, LearnableByBitmask, websiteLanguage.MainJp()); sb.Append("</span>"); } sb.Append(EquipCost + " SP<br>"); sb.Append(LearnCost + " LP<br>"); sb.Append("Symbol Weight: " + SymbolValue + "<br>"); //sb.Append( "~7: " + Unknown7 + "<br>" ); //sb.Append( "~13: " + Unknown13 + "<br>" ); //sb.Append( "~14: " + Unknown14 + "<br>" ); //sb.Append( "~15: " + Unknown15 + "<br>" ); if (Inactive == 0) { sb.Append("Unusable<br>"); } sb.Append("</td>"); sb.Append("</tr>"); return(sb.ToString()); }
public static string GetPhpUrlGameLocale(GameLocale locale) { switch (locale) { case GameLocale.J: return("jp"); default: return(locale.ToString().ToLowerInvariant()); } }
private void Update() { if (languageDropdown.value != (int)gameLang) { SavePrompt(); gameLang = (GameLocale)languageDropdown.value; DeserializeLocale(gameLang.ToString(), "prompts"); ReloadPrompt(); } }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, ItemDat.ItemDat items, TSSFile stringDic, Dictionary <uint, TSSEntry> inGameIdDict, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); var item = items.itemIdDict[Item]; sb.Append("<img src=\"item-icons/ICON" + item.Data[(int)ItemData.Icon] + ".png\" height=\"16\" width=\"16\"> "); sb.Append("<a href=\"" + Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Item, version, versionPostfix, locale, websiteLanguage, phpLinks, id: (int)item.Data[(int)ItemData.ID], icon: (int)item.Data[(int)ItemData.Icon]) + "\">"); sb.Append(inGameIdDict[item.NamePointer].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage) + "</a> x" + Count); return(sb.ToString()); }
public static string ConstructBtlPackPath(string basepath, GameLocale locale, GameVersion version) { if (version == GameVersion.X360_EU) { return(Path.Combine(basepath, "btl.svo.ext", "BTL_PACK_" + locale.ToString().ToUpperInvariant() + ".DAT.ext")); } else { return(Path.Combine(basepath, "btl.svo.ext", "BTL_PACK.DAT.ext")); } }
public static Stream TryGetStringDic(string basepath, GameLocale locale, GameVersion version) { if (version == GameVersion.X360_EU || version == GameVersion.PC) { return(TryGetContainerFromDisk(basepath)?.FindChildByName("language")?.AsContainer?.FindChildByName("string_dic_" + locale.ToString().ToLowerInvariant() + ".so")?.AsFile?.DataStream); } else { return(TryGetContainerFromDisk(basepath)?.FindChildByName("string.svo")?.ToFps4()?.FindChildByName("STRING_DIC.SO")?.AsFile?.DataStream); } }
public static Stream TryGetScenarioFile(string basepath, int fileIndex, GameLocale locale, GameVersion version) { if (version == GameVersion.X360_EU || version == GameVersion.PC) { return(TryCreateStreamFromPath(Path.Combine(basepath, "language", "scenario_" + (version == GameVersion.X360_EU ? locale.ToString().ToLowerInvariant() : locale.ToString().ToUpperInvariant()) + ".dat.ext", fileIndex.ToString("D1") + ".d"))); } else { return(TryCreateStreamFromPath(Path.Combine(basepath, "scenario.dat.ext", fileIndex.ToString("D1") + ".d"))); } }
public static Stream TryGetRecipes(string basepath, GameLocale locale, GameVersion version) { if (version.Is360()) { return(TryGetContainerFromDisk(basepath)?.FindChildByName("cook.svo")?.ToFps4()?.FindChildByName("COOKDATA.BIN")?.AsFile?.DataStream); } else { return(TryGetContainerFromDisk(basepath)?.FindChildByName("menu.svo")?.ToFps4()?.FindChildByName("COOKDATA.BIN")?.AsFile?.DataStream); } }
public static List <string> GetBattleScenarioFileNames(string basepath, GameLocale locale, GameVersion version) { string folder = Path.Combine(ConstructBtlPackPath(basepath, locale, version), 3.ToString("D4") + ".ext"); List <string> names = new List <string>(); foreach (string f in System.IO.Directory.GetFiles(folder, "BTL_*", SearchOption.TopDirectoryOnly)) { names.Add(Path.GetFileName(f).Split('.')[0]); } return(names); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, ItemDat.ItemDat items, ShopData shops, Dictionary <uint, TSS.TSSEntry> inGameIdDict, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); int colspan = websiteLanguage.WantsBoth() ? 3 : 6; sb.Append("<tr id=\"shop" + InGameID + "\">"); if (websiteLanguage.WantsJp()) { sb.Append("<td class=\"synopsistitle\" colspan=\"" + colspan + "\">"); sb.Append(inGameIdDict[StringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td class=\"synopsistitle\" colspan=\"" + colspan + "\">"); sb.Append(inGameIdDict[StringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } sb.Append("</tr>"); sb.Append("<tr>"); for (int i = 2; i < 9; ++i) { if (i == 4) { continue; } sb.Append("<td>"); foreach (var item in ShopItems) { if (items.itemIdDict[item.ItemID].Data[(int)ItemDat.ItemData.Category] == i) { sb.Append(item.GetDataAsHtml(version, versionPostfix, locale, websiteLanguage, items, inGameIdDict, phpLinks: phpLinks)); sb.Append("<br>"); } } sb.Append("</td>"); } sb.Append("</tr>"); if (OnTrigger > 0) { sb.Append("<tr>"); sb.Append("<td class=\"strategychar\" colspan=\"6\">"); sb.Append("Changes to <a href=\"" + Vesperia.Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Shop, version, versionPostfix, locale, websiteLanguage, phpLinks, id: (int)ChangeToShop) + "\">"); sb.Append(inGameIdDict[shops.ShopDictionary[ChangeToShop].StringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)); sb.Append("</a>"); sb.Append("</td>"); sb.Append("</tr>"); } return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict) { var nameEn = inGameIdDict[NameStringDicID].StringEng; var nameJp = inGameIdDict[NameStringDicID].StringJpn; StringBuilder sb = new StringBuilder(); sb.Append("<tr>"); sb.Append("<td>"); Website.WebsiteGenerator.AppendCharacterBitfieldAsImageString(sb, inGameIdDict, version, 1u << (int)(Character - 1), websiteLanguage.MainJp()); sb.Append("</td>"); int colspan = websiteLanguage.WantsBoth() ? 1 : 2; if (websiteLanguage.WantsJp()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); if (nameEn.Contains("\x06(COS)") && !nameJp.Contains("\x06(COS)")) { sb.Append(nameEn.Replace("\x06(COS)", "").ToHtmlEng(inGameIdDict, version)); Console.WriteLine("Removed EN costume icon for " + nameEn); } else { sb.Append(inGameIdDict[NameStringDicID].StringEngHtml(version, inGameIdDict)); } sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } sb.Append("<td>"); sb.Append(BunnyGuildPointsMaybe + " Fame point" + (BunnyGuildPointsMaybe != 1 ? "s" : "")); sb.Append("</td>"); return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, ItemDat.ItemDat items, TSSFile stringDic, Dictionary <uint, TSSEntry> inGameIdDict, List <SearchPointItem> searchPointItems, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); //sb.Append( "Percentage: " ).Append( Percentage ).Append( "%" ).Append( "<br>" ); for (uint i = 0; i < SearchPointItemCount; ++i) { //sb.Append( "Item #" ).Append( i ).Append( ":" ); sb.Append(searchPointItems[(int)(SearchPointItemIndex + i)].GetDataAsHtml(version, versionPostfix, locale, websiteLanguage, items, stringDic, inGameIdDict, phpLinks: phpLinks)); sb.Append("<br>"); } return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict) { StringBuilder sb = new StringBuilder(); //sb.Append( RefString ); sb.Append("<tr id=\"strategyoption" + InGameID + "\">"); sb.Append("<td>"); sb.Append(StrategySet.GetCategoryName(Category, version, websiteLanguage, inGameIdDict)); sb.Append("</td>"); int colspan = websiteLanguage.WantsBoth() ? 1 : 2; if (websiteLanguage.WantsJp()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } sb.Append("<td>"); Website.WebsiteGenerator.AppendCharacterBitfieldAsImageString(sb, inGameIdDict, version, Characters, websiteLanguage.MainJp()); sb.Append("</td>"); sb.Append("</tr>"); return(sb.ToString()); }
public EditorUI promptEditor; // id, type, prompt, reprompt, responses // TODO: multiple reprompts void Start() { // NOTE: Set language var languageArray = Enum.GetNames(typeof(GameLocale)); languageDropdown.ClearOptions(); languageDropdown.AddOptions(new List <string>(languageArray)); languageDropdown.value = 1; // TODO: multiple language support in game gameLang = (GameLocale)languageDropdown.value; // NOTE: Config UI prevButton.onClick.AddListener(LoadPrevPrompt); nextButton.onClick.AddListener(LoadNextPrompt); newButton.onClick.AddListener(NewPrompt); resetButton.onClick.AddListener(ReloadPrompt); saveButton.onClick.AddListener(SavePrompt); deleteButton.onClick.AddListener(DeletePrompt); // NOTE: Serialize data to memory DeserializeLocale(gameLang.ToString(), "prompts"); LoadPrompt(0); }
public static string TrophyNodeToHtml(GameVersion version, Dictionary <uint, TSS.TSSEntry> inGameIdDict, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, HyoutaTools.Trophy.TrophyNode jp, HyoutaTools.Trophy.TrophyNode en) { var sb = new StringBuilder(); bool wantJp = websiteLanguage.WantsJp() && jp != null; bool wantEn = websiteLanguage.WantsEn() && en != null; bool wantBoth = wantJp && wantEn; sb.Append("<tr>"); sb.Append("<td>"); sb.Append("<img width=\"60\" height=\"60\" src=\"trophies/TROP" + jp.ID + ".PNG\"/>"); sb.Append("</td>"); int colspan = wantBoth ? 1 : 2; if (wantJp) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(jp.Name); sb.Append("</span>"); sb.Append("<br/>"); sb.Append(jp.Detail.ToHtmlJpn(inGameIdDict, version)); sb.Append("</td>"); } if (wantEn) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(en.Name); sb.Append("</span>"); sb.Append("<br/>"); sb.Append(en.Detail.ToHtmlEng(inGameIdDict, version)); sb.Append("</td>"); } sb.Append("</tr>"); return(sb.ToString()); }
public string GetDataAsHtml(T8BTEMST.T8BTEMST enemies, Dictionary <uint, TSS.TSSEntry> inGameIdDict, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage) { var sb = new StringBuilder(); sb.Append("<tr id=\"egroup" + InGameID + "\">"); sb.Append("<td>"); sb.Append(RefString); sb.Append("<br>"); sb.Append(inGameIdDict[StringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)); sb.Append("<br>"); sb.Append("ID: "); sb.Append(ID); sb.Append("<br>"); sb.Append("InGameId: "); sb.Append(InGameID); sb.Append("<br>"); sb.Append("Flag: "); sb.Append(SomeFlag); sb.Append("</td>"); for (int i = 0; i < EnemyIDs.Length; ++i) { sb.Append("<td>"); if (EnemyIDs[i] >= 0) { sb.Append(inGameIdDict[enemies.EnemyIdDict[(uint)EnemyIDs[i]].NameStringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)); sb.Append("<br>"); sb.Append("~1: "); sb.Append(UnknownFloats[i]); sb.Append("<br>"); sb.Append("X Pos: "); sb.Append(PosX[i]); sb.Append("<br>"); sb.Append("Y Pos: "); sb.Append(PosY[i]); sb.Append("<br>"); sb.Append("Scale: "); sb.Append(Scale[i]); sb.Append("<br>"); sb.Append("~5: "); sb.Append(UnknownInts[i]); } sb.Append("</td>"); } sb.Append("</tr>"); return(sb.ToString()); }
public string GetDataAsHtml(string stratum, int floor, T8BTEMST.T8BTEMST Enemies, T8BTEMGP.T8BTEMGP EnemyGroups, T8BTEMEG.T8BTEMEG EncounterGroups, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, T8BTXTMT treasures, ItemDat.ItemDat items, Dictionary <uint, TSS.TSSEntry> inGameIdDict, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); bool printEnemies = Enemies != null && EnemyGroups != null && EncounterGroups != null; sb.Append("<td class=\"necropolistile" + RoomType + "\">"); if (RoomType != 0) { sb.Append("<div class=\"necropolis-arrow-up\">"); if (MoveUpAllowed > 0) { sb.Append("<img src=\"etc/up.png\" width=\"16\" height=\"16\">"); } sb.Append("</div>"); sb.Append("<div class=\"necropolis-arrow-side\">"); if (MoveLeftAllowed > 0) { sb.Append("<img src=\"etc/left.png\" width=\"16\" height=\"16\">"); } sb.Append("</div>"); sb.Append("<div class=\"necropolis-data\">"); if (printEnemies) { foreach (uint groupId in EncounterGroups.EncounterGroupIdDict[EnemyGroup].EnemyGroupIDs) { if (groupId == 0xFFFFFFFFu) { continue; } foreach (int enemyId in EnemyGroups.EnemyGroupIdDict[groupId].EnemyIDs) { if (enemyId < 0) { continue; } var enemy = Enemies.EnemyIdDict[(uint)enemyId]; sb.Append("<a href=\"" + Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Enemy, version, versionPostfix, locale, websiteLanguage, phpLinks, category: (int)enemy.Category, id: (int)enemy.InGameID) + "\">"); sb.Append("<img src=\"monster-icons/46px/monster-" + enemy.IconID.ToString("D3") + ".png\" title=\"" + inGameIdDict[enemy.NameStringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage) + "\" width=\"23\" height=\"23\">"); sb.Append("</a>"); } sb.Append("<br>"); } } else { sb.Append("<img src=\"item-icons/ICON60.png\" width=\"16\" height=\"16\"> " + (FramesToMove / 60) + " sec<br>"); switch (RoomType) { case 1: sb.Append("Entrance<br>"); break; case 2: case 5: { int targetFloor; string targetLinkId; string targetStratum; if (RoomType == 5) { targetFloor = (floor + FloorExitDiff); } else { targetFloor = (floor + 1); } if (targetFloor == 11) { targetStratum = ((char)(((int)stratum[0]) + 1)).ToString(); targetLinkId = targetStratum + "1"; } else { targetStratum = stratum; targetLinkId = targetStratum + targetFloor; } string targetHumanReadable; if (targetFloor == 11) { targetHumanReadable = stratum + " Bottom"; } else { targetHumanReadable = stratum + "-" + targetFloor; } string nextHumanReadable = ""; if (targetFloor == 11) { nextHumanReadable = targetStratum + "-1"; } string linkStart = "<a href=\"" + (phpLinks ? Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.NecropolisMap, version, versionPostfix, locale, websiteLanguage, true, extra: targetLinkId) : ("#" + targetLinkId)) + "\">"; string linkEnd = "</a>"; string finalText; if (targetFloor == 11) { if (stratum == "F") { finalText = $"Exit to {targetHumanReadable}"; } else { finalText = $"Exit to {targetHumanReadable}<br>(Go to {linkStart}{nextHumanReadable}{linkEnd})"; } } else { finalText = $"Exit to {linkStart}{targetHumanReadable}{linkStart}"; } sb.Append(finalText); sb.Append("<br>"); break; } case 3: //sb.Append( "Regular Room<br>" ); break; case 4: //sb.Append( "Treasure Room<br>" ); break; } if (RegularTreasure > 0) { // not a generic solution, but the unmodified game has all four slots identical for regular treasures var treasureInfo = treasures.TreasureInfoList[(int)RegularTreasure]; sb.Append("<table>"); sb.Append("<tr>"); for (int i = 0; i < 3; ++i) { var item = items.itemIdDict[treasureInfo.Items[i]]; sb.Append("<td>"); sb.Append("<a href=\"" + Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Item, version, versionPostfix, locale, websiteLanguage, phpLinks, id: (int)item.Data[(int)ItemData.ID], icon: (int)item.Data[(int)ItemData.Icon]) + "\">"); sb.Append("<img src=\"items/U_" + item.ItemString.TrimNull() + ".png\" height=\"32\" width=\"32\" title=\"" + inGameIdDict[item.NamePointer].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage) + "\">"); sb.Append("</a>"); sb.Append("</td>"); } sb.Append("</tr>"); sb.Append("<tr>"); for (int i = 0; i < 3; ++i) { sb.Append("<td>"); sb.Append(treasureInfo.Chances[i] + "%"); sb.Append("</td>"); } sb.Append("</tr>"); sb.Append("</table>"); } if (SpecialTreasure > 0) { // unmodified game always has special treasures as one in the first slot with 100% chance var treasureInfo = treasures.TreasureInfoList[(int)SpecialTreasure]; var item = items.itemIdDict[treasureInfo.Items[0]]; sb.Append("<img src=\"item-icons/ICON" + item.Data[(int)ItemDat.ItemData.Icon] + ".png\" height=\"16\" width=\"16\"> "); sb.Append("<a href=\"" + Website.WebsiteGenerator.GetUrl(Website.WebsiteSection.Item, version, versionPostfix, locale, websiteLanguage, phpLinks, id: (int)item.Data[(int)ItemData.ID], icon: (int)item.Data[(int)ItemData.Icon]) + "\">"); sb.Append(inGameIdDict[item.NamePointer].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage) + "</a><br>"); } } sb.Append("</div>"); sb.Append("<div class=\"necropolis-arrow-side\">"); if (MoveRightAllowed > 0) { sb.Append("<img src=\"etc/right.png\" width=\"16\" height=\"16\">"); } sb.Append("</div>"); sb.Append("<div class=\"necropolis-arrow-down\">"); if (MoveDownAllowed > 0) { sb.Append("<img src=\"etc/down.png\" width=\"16\" height=\"16\">"); } sb.Append("</div>"); } sb.Append("</td>"); return(sb.ToString()); }
public string GetDataAsHtml(GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, T8BTTA strategy, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict) { StringBuilder sb = new StringBuilder(); //sb.Append( RefString ); sb.Append("<tr>"); int colspan = websiteLanguage.WantsBoth() ? 5 : 10; if (websiteLanguage.WantsJp()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringJpnHtml(version, inGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td colspan=\"" + colspan + "\">"); sb.Append("<span class=\"itemname\">"); sb.Append(inGameIdDict[NameStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</span>"); sb.Append("<br>"); sb.Append(inGameIdDict[DescStringDicID].StringEngHtml(version, inGameIdDict)); sb.Append("</td>"); } sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td>"); sb.Append("</td>"); for (int i = 0; i < StrategyDefaults.GetLength(1); ++i) { sb.Append("<td class=\"strategychar\">"); Website.WebsiteGenerator.AppendCharacterBitfieldAsImageString(sb, inGameIdDict, version, 1u << i, websiteLanguage.MainJp()); sb.Append("</td>"); } sb.Append("</tr>"); for (uint xRaw = 0; xRaw < StrategyDefaults.GetLength(0); ++xRaw) { uint x = xRaw; // swap around OVL and FS because they're stored the wrong way around compared to how they show up ingame if (x == 6) { x = 7; } else if (x == 7) { x = 6; } sb.Append("<tr>"); sb.Append("<td>"); sb.Append("<span class=\"strategycat\">"); sb.Append(GetCategoryName(x, version, websiteLanguage, inGameIdDict)); sb.Append("</span>"); sb.Append("</td>"); for (uint y = 0; y < StrategyDefaults.GetLength(1); ++y) { if (y == 8 && !version.HasPS3Content()) { continue; } // skip patty strategy if we don't have her sb.Append("<td>"); var option = strategy.StrategyOptionDict[StrategyDefaults[x, y]]; sb.Append(inGameIdDict[option.NameStringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)); sb.Append("</td>"); } sb.Append("</tr>"); } //sb.Append( "<td>" ); //for ( int i = 0; i < UnknownFloats1.Length; ++i ) { // sb.Append( UnknownFloats1[i] + " / " ); //} //sb.Append( "<br>" ); //for ( int i = 0; i < UnknownFloats2.Length; ++i ) { // sb.Append( UnknownFloats2[i] + " / " ); //} //sb.Append( "</td>" ); return(sb.ToString()); }
public string GetDataAsHtml(string stratum, int floor, T8BTEMST.T8BTEMST Enemies, T8BTEMGP.T8BTEMGP EnemyGroups, T8BTEMEG.T8BTEMEG EncounterGroups, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, T8BTXTMT treasures, ItemDat.ItemDat items, Dictionary <uint, TSS.TSSEntry> inGameIdDict, bool surroundingTable = true, bool phpLinks = false) { StringBuilder sb = new StringBuilder(); if (surroundingTable) { sb.Append("<div id=\"" + stratum + floor + "\">"); sb.Append("<table class=\"necropolisfloor\">"); sb.Append("<tr>"); sb.Append("<th colspan=\"6\">"); sb.Append("<div class=\"itemname\" style=\"text-align: center;\">"); sb.Append(stratum + "-" + floor); sb.Append("</div>"); sb.Append("</td>"); sb.Append("</tr>"); } for (int y = 0; y < VerticalTiles; y++) { sb.Append("<tr>"); for (int x = 0; x < HorizontalTiles; x++) { sb.Append(TileList[(int)(y * HorizontalTiles + x)].GetDataAsHtml(stratum, floor, Enemies, EnemyGroups, EncounterGroups, version, versionPostfix, locale, websiteLanguage, treasures, items, inGameIdDict, phpLinks: phpLinks)); } sb.Append("</tr>"); //sb.Append( "<tr><td colspan=\"" + HorizontalTiles + "\"><hr></td></tr>" ); } if (surroundingTable) { sb.Append("</table>"); sb.Append("</div>"); } return(sb.ToString()); }
public static Dictionary <string, SCFOMBIN.SCFOMBIN> LoadBattleText(IContainer gameDataPath, GameLocale locale, GameVersion version, EndianUtils.Endianness endian, TextUtils.GameTextEncoding encoding, BitUtils.Bitness bits) { var BattleTextFiles = new Dictionary <string, SCFOMBIN.SCFOMBIN>(); foreach (var filename in GenerateWebsite.GetBattleScenarioFileNames(gameDataPath, locale, version)) { var bin = LoadBattleTextFile(gameDataPath, filename, locale, version, endian, encoding, bits); BattleTextFiles.Add(filename, bin); } return(BattleTextFiles); }
public static SCFOMBIN.SCFOMBIN LoadBattleTextFile(IContainer gameDataPath, string filename, GameLocale locale, GameVersion version, EndianUtils.Endianness endian, TextUtils.GameTextEncoding encoding, BitUtils.Bitness bits) { if (!version.Is360()) { uint ptrDiff = 0x1888; if (filename.StartsWith("BTL_XTM")) { ptrDiff = 0x1B4C; } var bin = new SCFOMBIN.SCFOMBIN(GenerateWebsite.TryGetBattleScenarioFile(gameDataPath, filename, locale, version), endian, encoding, ptrDiff); return(bin); } else { var bin = new ScenarioFile.ScenarioFile(GenerateWebsite.TryGetBattleScenarioFile(gameDataPath, filename, locale, version), encoding, endian, bits); var btl = new SCFOMBIN.SCFOMBIN(); btl.EntryList = bin.EntryList; return(btl); } }
public string GetDataAsHtml(ItemDat.ItemDat items, Dictionary <uint, TSS.TSSEntry> inGameIdDict, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < Items.Length; ++i) { if (Items[i] > 0) { var item = items.itemIdDict[this.Items[i]]; sb.Append(inGameIdDict[item.NamePointer].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)); sb.Append(" / "); sb.Append(Chances[i]); } sb.Append((i % 3 == 2) ? "<br>" : " -- "); } return(sb.ToString()); }
public static string GetUrl(WebsiteSection section, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, bool phpLink, int?id = null, int?category = null, int?icon = null, string extra = null) { if (phpLink) { string v = GetPhpUrlGameVersion(version); string l = GetPhpUrlGameLocale(locale); string w = GetPhpUrlWebsiteLanguage(websiteLanguage); string begin = "?version=" + v + versionPostfix + "&locale=" + l + "&compare=" + w; switch (section) { case WebsiteSection.Arte: return(begin + "§ion=artes" + (id != null ? "&id=" + id : "")); case WebsiteSection.Enemy: return(begin + "§ion=enemies&category=" + category + (id != null ? "&id=" + id : "")); case WebsiteSection.Item: return(begin + "§ion=items&icon=" + icon + (id != null ? "&id=" + id : "")); case WebsiteSection.Recipe: return(begin + "§ion=recipes" + (id != null ? "&id=" + id : "")); case WebsiteSection.Skill: return(begin + "§ion=skills" + (id != null ? "&id=" + id : "")); case WebsiteSection.Location: return(begin + "§ion=locations" + (id != null ? "&id=" + id : "")); case WebsiteSection.Shop: return(begin + "§ion=shops" + (id != null ? "&id=" + id : "")); case WebsiteSection.SearchPoint: return(begin + "§ion=searchpoint" + (id != null ? "#searchpoint" + id : "")); case WebsiteSection.Skit: return(begin + "§ion=skit" + (extra != null ? "&name=" + extra : "")); case WebsiteSection.Scenario: return(begin + "§ion=scenario" + (extra != null ? "&name=" + extra : "")); case WebsiteSection.NecropolisMap: return(begin + "§ion=necropolis" + (extra != null ? "&map=" + extra : "")); default: throw new Exception("Unsupported PHP URL requested."); } } else { StringBuilder sb = new StringBuilder(); sb.Append(version.ToString()); sb.Append("-"); sb.Append(section.ToString()); if (category != null) { sb.Append("-c"); sb.Append(category); } if (icon != null) { sb.Append("-i"); sb.Append(icon); } if (extra != null) { sb.Append("-"); sb.Append(extra); } sb.Append(".html"); if (id != null) { sb.Append("#"); sb.Append(section.ToString().ToLowerInvariant()); sb.Append(id); } return(sb.ToString()); } }
public static void AddMenuBar(StringBuilder sb, GameVersion Version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, IEnumerable <uint> IconsWithItems, Dictionary <uint, TSS.TSSEntry> InGameIdDict) { sb.AppendLine("<div id=\"header-name\">"); sb.AppendLine("<a href=\"index.html\">Tales of Vesperia - Data & Translation Guide</a>"); sb.AppendLine("</div>"); sb.AppendLine("<div id=\"topmenu\">"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Arte, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-01.png\" title=\"Artes\"></a>"); //sb.AppendLine( "<a href=\"" + WebsiteGenerator.GetUrl( WebsiteSection.Equipment, Version, versionPostfix, locale, websiteLanguage, false ) + "\"><img src=\"menu-icons/main-02.png\" title=\"Equipment\"></a>" ); //sb.AppendLine( "<a href=\"" + WebsiteGenerator.GetUrl( WebsiteSection.Item, Version, versionPostfix, locale, websiteLanguage, false ) + "\"><img src=\"menu-icons/main-03.png\" title=\"Items\"></a>" ); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Skill, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-04.png\" title=\"Skills\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Strategy, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-05.png\" title=\"Strategy\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Recipe, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-06.png\" title=\"Recipes\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Shop, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-02.png\" title=\"Shops\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Title, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/main-07.png\" title=\"Titles\"></a>"); //sb.AppendLine( "<img src=\"menu-icons/main-08.png\" title=\"Library\">" ); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Synopsis, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/sub-09.png\" title=\"Synopsis\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.BattleBook, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/sub-14.png\" title=\"Battle Book\"></a>"); //sb.AppendLine( "<a href=\"" + WebsiteGenerator.GetUrl( WebsiteSection.Enemy, Version, versionPostfix, locale, websiteLanguage, false ) + "\"><img src=\"menu-icons/sub-13.png\" title=\"Monster Book\"></a>" ); //sb.AppendLine( "<a href=\"" + WebsiteGenerator.GetUrl( WebsiteSection.Item, Version, versionPostfix, locale, websiteLanguage, false ) + "\"><img src=\"menu-icons/sub-11.png\" title=\"Collector's Book\"></a>" ); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Location, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/sub-10.png\" title=\"World Map\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.SearchPoint, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"etc/U_ITEM_IRIKIAGRASS-64px.png\" title=\"Search Points\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Record, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/sub-08.png\" title=\"Records\"></a>"); //sb.AppendLine( "<img src=\"menu-icons/main-09.png\" title=\"Save & Load\">" ); //sb.AppendLine( "<img src=\"menu-icons/sub-06.png\" title=\"Save\">" ); //sb.AppendLine( "<img src=\"menu-icons/sub-05.png\" title=\"Load\">" ); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Settings, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/sub-07.png\" title=\"Settings\"></a>"); sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.GradeShop, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"item-categories/cat-01.png\" title=\"Grade Shop\"></a>"); if (Version.HasPS3Content()) { sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.NecropolisMap, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"menu-icons/weather-4-64px.png\" title=\"Necropolis of Nostalgia Maps\"></a>"); } if (Version == GameVersion.PS3) { sb.AppendLine("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Trophy, Version, versionPostfix, locale, websiteLanguage, false) + "\"><img src=\"trophies/gold.png\" title=\"Trophies\"></a>"); } sb.AppendLine("<br>"); for (uint i = 2; i < 12; ++i) { sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Item, Version, versionPostfix, locale, websiteLanguage, false, category: (int)i) + "\">"); sb.Append("<img src=\"item-categories/cat-" + i.ToString("D2") + ".png\" title=\"" + InGameIdDict[33912572u + i].StringEngOrJpnHtml(Version, InGameIdDict, websiteLanguage) + "\" height=\"32\">"); sb.Append("</a>"); } sb.AppendLine(); for (uint i = 0; i < 9; ++i) { sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Enemy, Version, versionPostfix, locale, websiteLanguage, false, category: (int)i) + "\">"); sb.Append("<img src=\"monster-categories/cat-" + i + ".png\" title=\"" + InGameIdDict[33912323u + i].StringEngOrJpnHtml(Version, InGameIdDict, websiteLanguage) + "\" height=\"32\">"); sb.Append("</a>"); } sb.AppendLine("<br>"); foreach (uint i in IconsWithItems) { sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.Item, Version, versionPostfix, locale, websiteLanguage, false, icon: (int)i) + "\">"); sb.Append("<img src=\"item-icons/ICON" + i + ".png\" height=\"16\" width=\"16\">"); sb.Append("</a>"); } sb.AppendLine("<br>"); sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.ScenarioStoryIndex, Version, versionPostfix, locale, websiteLanguage, false) + "\">Story</a> / "); sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.ScenarioSidequestIndex, Version, versionPostfix, locale, websiteLanguage, false) + "\">Sidequests</a> / "); sb.Append("<a href=\"" + WebsiteGenerator.GetUrl(WebsiteSection.SkitIndex, Version, versionPostfix, locale, websiteLanguage, false) + "\">Skits</a>"); sb.AppendLine(); sb.AppendLine("</div>"); sb.AppendLine("<hr>"); sb.AppendLine("<div id=\"content\">"); }
public static void AppendRecord(StringBuilder sb, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, Dictionary <uint, TSS.TSSEntry> InGameIdDict, uint id) { sb.Append("<tr>"); if (websiteLanguage.WantsJp()) { sb.Append("<td>"); sb.Append(InGameIdDict[id].StringJpnHtml(version, InGameIdDict)); sb.Append("</td>"); } if (websiteLanguage.WantsEn()) { sb.Append("<td>"); sb.Append(InGameIdDict[id].StringEngHtml(version, InGameIdDict)); sb.Append("</td>"); } sb.Append("</tr>"); //sb.Append( "<tr><td colspan=\"2\"><hr></td></tr>" ); }
public static void AppendSetting(StringBuilder sb, GameVersion Version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, Dictionary <uint, TSS.TSSEntry> InGameIdDict, uint idName, uint idDesc, uint option1 = 0, uint option2 = 0, uint option3 = 0, uint option4 = 0) { for (int i = 0; i < 2; ++i) { if (!websiteLanguage.WantsJp() && i == 0) { continue; } if (!websiteLanguage.WantsEn() && i == 1) { continue; } sb.Append("<tr>"); sb.Append("<td>"); sb.Append("<span class=\"itemname\">"); sb.Append(InGameIdDict[idName].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</span>"); sb.Append("</td>"); int optionCount = 0; if (option1 > 0) { ++optionCount; } if (option2 > 0) { ++optionCount; } if (option3 > 0) { ++optionCount; } if (option4 > 0) { ++optionCount; } if (optionCount == 0) { sb.Append("<td colspan=\"4\">"); sb.Append("</td>"); } else { if (option1 > 0) { if (optionCount == 1) { sb.Append("<td colspan=\"4\">"); } else { sb.Append("<td>"); } sb.Append(InGameIdDict[option1].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</td>"); } if (option2 > 0) { if (optionCount == 2) { sb.Append("<td colspan=\"3\">"); } else { sb.Append("<td>"); } sb.Append(InGameIdDict[option2].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</td>"); } if (option3 > 0) { if (optionCount == 3) { sb.Append("<td colspan=\"2\">"); } else { sb.Append("<td>"); } sb.Append(InGameIdDict[option3].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</td>"); } if (option4 > 0) { sb.Append("<td>"); sb.Append(InGameIdDict[option4].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</td>"); } } sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td colspan=\"5\">"); sb.Append(InGameIdDict[idDesc].GetStringHtml(i, Version, InGameIdDict)); sb.Append("</td>"); sb.Append("</tr>"); } }