12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Text.RegularExpressions;
- using UnityEngine;
- public class Menu : MonoBehaviour
- {
- public static string[] GetModFiles()
- {
- string fullPath = Path.GetFullPath(".\\");
- string path = fullPath + "Mod";
- if (!Directory.Exists(path))
- {
- return null;
- }
- return Directory.GetFiles(path, "mod_*.mod", SearchOption.AllDirectories);
- }
- public static string GetModPathFileName(string f_strMenuFileName)
- {
- string[] modFiles = Menu.GetModFiles();
- if (modFiles == null)
- {
- NDebug.MessageBox("MODエラー", "MODフォルダが無いか、MODフォルダにMODファイルが1つもありません。\n" + f_strMenuFileName);
- return string.Empty;
- }
- string text = Array.Find<string>(modFiles, (string a) => Path.GetFileName(a).ToLower() == f_strMenuFileName.ToLower());
- if (string.IsNullOrEmpty(text))
- {
- NDebug.MessageBox("MODエラー", "MODフォルダにMODファイルが見つかりません。\n" + f_strMenuFileName);
- return string.Empty;
- }
- return text;
- }
- public static bool ProcScript(Maid maid, string filename, bool f_bTemp = false, SubProp f_SubProp = null)
- {
- return Menu.ProcScript(maid, new MaidProp
- {
- strFileName = filename,
- strTempFileName = filename
- }, f_bTemp, f_SubProp);
- }
- public static bool ProcScript(Maid maid, MaidProp mp, bool f_bTemp = false, SubProp f_SubProp = null)
- {
- string text;
- if (f_bTemp)
- {
- text = mp.strTempFileName;
- }
- else
- {
- text = mp.strFileName;
- }
- bool flag = false;
- string text2 = string.Empty;
- byte[] array = null;
- if (text.IndexOf("mod_") == 0)
- {
- flag = true;
- text2 = Menu.GetModPathFileName(text);
- if (string.IsNullOrEmpty(text2))
- {
- return false;
- }
- text = Menu.GetBaseItemFromMod(text2);
- try
- {
- using (FileStream fileStream = new FileStream(text2, FileMode.Open))
- {
- if (fileStream == null)
- {
- Debug.LogWarning("MODアイテムメニューファイルが見つかりません。" + text);
- return false;
- }
- array = new byte[fileStream.Length];
- fileStream.Read(array, 0, (int)fileStream.Length);
- }
- }
- catch (Exception ex)
- {
- Debug.LogError("ProcScript MODアイテムメニューファイルが読み込めませんでした。 : " + text + " : " + ex.Message);
- return false;
- }
- }
- byte[] cd = null;
- try
- {
- using (AFileBase afileBase = GameUty.FileOpen(text, null))
- {
- if (afileBase == null || !afileBase.IsValid())
- {
- Debug.LogError("アイテムメニューファイルが見つかりません。" + text);
- return false;
- }
- cd = afileBase.ReadAll();
- }
- }
- catch (Exception ex2)
- {
- Debug.LogError("ProcScript アイテムメニューファイルが読み込めませんでした。 : " + text + " : " + ex2.Message);
- return false;
- }
- Menu.ProcScriptBin(maid, cd, mp, f_bTemp, f_SubProp);
- if (flag)
- {
- Menu.ProcModScriptBin(maid, array, text2, mp, false);
- }
- return true;
- }
- private static void ProcScriptBin(Maid maid, byte[] cd, string filename, bool f_bTemp = false, SubProp f_SubProp = null)
- {
- Menu.ProcScriptBin(maid, cd, new MaidProp
- {
- strFileName = filename,
- strTempFileName = filename
- }, f_bTemp, f_SubProp);
- }
- private static void ProcScriptBin(Maid maid, byte[] cd, MaidProp mp, bool f_bTemp = false, SubProp f_SubProp = null)
- {
- string text;
- if (f_bTemp)
- {
- text = mp.strTempFileName;
- }
- else
- {
- text = mp.strFileName;
- }
- TBody body = maid.body0;
- if (mp.idx == 61 || mp.idx == 64 || mp.idx == 65 || mp.idx == 66)
- {
- TBodySkin slot = body.GetSlot(1);
- if (slot.PartsVersion < 110)
- {
- return;
- }
- }
- List<Menu.LastParam> list = new List<Menu.LastParam>();
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
- string text2 = binaryReader.ReadString();
- NDebug.Assert(text2 == "CM3D2_MENU", "ProcScriptBin 例外 : ヘッダーファイルが不正です。" + text2);
- int num = binaryReader.ReadInt32();
- string text3 = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- string text5 = binaryReader.ReadString();
- string text6 = binaryReader.ReadString();
- long num2 = (long)binaryReader.ReadInt32();
- bool flag = false;
- string text7 = string.Empty;
- string text8 = string.Empty;
- string text9 = string.Empty;
- string slotname = string.Empty;
- int version = 100;
- bool flag2 = false;
- bool flag3 = false;
- for (;;)
- {
- try
- {
- for (;;)
- {
- IL_108:
- int num3 = (int)binaryReader.ReadByte();
- text8 = text7;
- text7 = string.Empty;
- if (num3 == 0)
- {
- break;
- }
- for (int i = 0; i < num3; i++)
- {
- text7 = text7 + "\"" + binaryReader.ReadString() + "\" ";
- }
- if (!(text7 == string.Empty))
- {
- goto IL_16F;
- }
- }
- break;
- IL_16F:
- string stringCom = UTY.GetStringCom(text7);
- string[] stringList = UTY.GetStringList(text7);
- if (stringCom == "end")
- {
- break;
- }
- if (stringCom == "name")
- {
- goto IL_14B9;
- }
- if (stringCom == "ver")
- {
- TBodySkin slot2 = body.GetSlot(stringList[1]);
- version = int.Parse(stringList[2]);
- goto IL_14B9;
- }
- if (stringCom == "アイテム")
- {
- Menu.SetMaidItemTemp(maid, stringList[1], f_bTemp);
- goto IL_14B9;
- }
- if (stringCom == "アイテム条件")
- {
- string slotname2 = stringList[1];
- if (stringList[2] == "に何か")
- {
- bool flag4 = false;
- TBodySkin slot3 = body.GetSlot(slotname2);
- if (stringList[3] == "有る")
- {
- if (slot3.obj != null)
- {
- flag4 = true;
- }
- }
- else if (stringList[3] == "無い")
- {
- if (slot3.obj == null)
- {
- flag4 = true;
- }
- }
- else
- {
- NDebug.Assert("アイテム条件が不正です。「有る」か「無い」かを指定してください。\n" + text7, false);
- }
- if (stringList[4] == "なら")
- {
- if (flag4)
- {
- Menu.SetMaidItemTemp(maid, stringList[5], f_bTemp);
- goto IL_2C9;
- }
- goto IL_2C9;
- IL_2C9:
- goto IL_2E0;
- }
- NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text7, false);
- goto IL_2E0;
- IL_2E0:
- goto IL_414;
- }
- if (stringList[2] == "が")
- {
- bool flag5 = false;
- TBodySkin slot4 = body.GetSlot(slotname2);
- if (slot4.m_strModelFileName == stringList[3])
- {
- flag5 = true;
- }
- if (stringList[4] == "なら")
- {
- if (flag5)
- {
- Menu.SetMaidItemTemp(maid, stringList[5], f_bTemp);
- goto IL_345;
- }
- goto IL_345;
- IL_345:
- goto IL_35C;
- }
- NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text7, false);
- goto IL_35C;
- IL_35C:
- goto IL_414;
- }
- if (!(stringList[2] == "のアイテムパラメータの"))
- {
- goto IL_414;
- }
- bool flag6 = false;
- TBodySkin slot5 = body.GetSlot(slotname2);
- string param = slot5.GetParam(stringList[3].ToLower());
- if (stringList[4] == "が")
- {
- if (stringList[5].ToLower() == param)
- {
- flag6 = true;
- }
- }
- else
- {
- NDebug.Assert("アイテム条件が不正です。「が」が必要です。\n" + text7, false);
- }
- if (stringList[6] == "なら")
- {
- if (flag6)
- {
- Menu.SetMaidItemTemp(maid, stringList[7], f_bTemp);
- goto IL_3FD;
- }
- goto IL_3FD;
- IL_3FD:
- goto IL_414;
- }
- NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text7, false);
- goto IL_414;
- IL_414:
- goto IL_14B9;
- }
- if (stringCom == "if")
- {
- if (stringList[1].IndexOf("maidprop[") != 0)
- {
- goto IL_594;
- }
- string value = stringList[1].Substring(9, stringList[1].Length - 9 - 1);
- MPN mpn = (MPN)Enum.Parse(typeof(MPN), value, false);
- MaidProp prop = maid.GetProp(mpn);
- if (!(stringList[2] == "==") || !(stringList[3] == "nothing") || prop.nFileNameRID != 0 || !(stringList[4] == "?") || stringList[5].IndexOf("setprop[") != 0)
- {
- goto IL_594;
- }
- string value2 = stringList[5].Substring(8, stringList[5].Length - 8 - 1);
- MPN idx = (MPN)Enum.Parse(typeof(MPN), value2, false);
- if (!(stringList[6] == "="))
- {
- goto IL_594;
- }
- string text10;
- if (stringList[7].IndexOf("getprop[") == 0)
- {
- string value3 = stringList[7].Substring(8, stringList[7].Length - 8 - 1);
- MPN mpn2 = (MPN)Enum.Parse(typeof(MPN), value3, false);
- MaidProp prop2 = maid.GetProp(mpn2);
- text10 = prop2.strFileName;
- }
- else
- {
- text10 = stringList[7];
- }
- if (!string.IsNullOrEmpty(text10))
- {
- maid.SetProp(idx, text10, 0, false, false);
- goto IL_594;
- }
- goto IL_594;
- IL_594:
- goto IL_14B9;
- }
- if (stringCom == "アイテムパラメータ")
- {
- if (stringList.Length == 4)
- {
- string text11 = stringList[1];
- string text12 = stringList[2].ToLower();
- string text13 = stringList[3].ToLower();
- list.Add(new Menu.LastParam(0, stringCom, new string[]
- {
- text11,
- text12,
- text13
- }));
- goto IL_609;
- }
- Debug.LogError("アイテムパラメータ 命令の引数が不正です。SlotNameを明示的に指定しする必要があります。アイテムパラメータ <スロット名> <変数名> <値> の順です。" + text7);
- goto IL_609;
- IL_609:
- goto IL_14B9;
- }
- if (stringCom == "半脱ぎ" || stringCom == "リソース参照")
- {
- string key;
- string value4;
- if (stringCom == "半脱ぎ")
- {
- key = "半脱ぎ";
- value4 = stringList[1];
- }
- else
- {
- key = stringList[1];
- value4 = stringList[2];
- }
- int hashCode = Path.GetFileName(text.ToLower()).ToLower().GetHashCode();
- SortedDictionary<string, string> sortedDictionary;
- if (Menu.m_dicResourceRef.TryGetValue(hashCode, out sortedDictionary))
- {
- string empty = string.Empty;
- if (sortedDictionary.TryGetValue(key, out empty))
- {
- sortedDictionary[key] = value4;
- goto IL_6BB;
- }
- sortedDictionary.Add(key, value4);
- goto IL_6BB;
- IL_6BB:
- goto IL_6E0;
- }
- sortedDictionary = new SortedDictionary<string, string>();
- sortedDictionary.Add(key, value4);
- Menu.m_dicResourceRef.Add(hashCode, sortedDictionary);
- goto IL_6E0;
- IL_6E0:
- goto IL_14B9;
- }
- if (stringCom == "set")
- {
- goto IL_14B9;
- }
- if (stringCom == "setname")
- {
- goto IL_14B9;
- }
- if (stringCom == "setslotitem")
- {
- string tag = stringList[1];
- uint val = uint.Parse(stringList[2]);
- maid.SetProp(tag, (int)val, false);
- goto IL_14B9;
- }
- if (stringCom == "additem")
- {
- string text14 = text9;
- if (stringList.Length > 1)
- {
- text14 = stringList[2];
- }
- slotname = text14;
- if (text14 == "body")
- {
- body.LoadBody_R(stringList[1], maid);
- }
- string attachSlot = string.Empty;
- string attachName = string.Empty;
- if (stringList.Length == 6)
- {
- if (stringList[3] == "アタッチ")
- {
- attachSlot = stringList[4];
- attachName = stringList[5];
- }
- }
- else if (stringList.Length == 5 && stringList[3] == "ボーンにアタッチ")
- {
- attachSlot = "ボーンにアタッチ";
- attachName = stringList[4];
- }
- if (text14 == "handitemr")
- {
- attachSlot = "ボーンにアタッチ";
- attachName = "_IK_handR";
- }
- if (text14 == "handiteml")
- {
- attachSlot = "ボーンにアタッチ";
- attachName = "_IK_handL";
- }
- body.AddItem((MPN)Enum.Parse(typeof(MPN), text9, true), text14, stringList[1], attachSlot, attachName, f_bTemp, version);
- body.SetVisibleNodeSlot(text14, true, "_ALL_");
- goto IL_14B9;
- }
- if (stringCom == "nofloory")
- {
- TBody.SlotID index = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
- body.goSlot[(int)index].m_bHitFloorY = false;
- goto IL_14B9;
- }
- if (stringCom == "saveitem")
- {
- text5 = stringList[1];
- goto IL_14B9;
- }
- if (stringCom == "category")
- {
- text9 = stringList[1];
- flag2 = (text9 == "skin");
- flag3 = (text9 == "haircolor");
- goto IL_14B9;
- }
- if (stringCom == "maskitem")
- {
- if (stringList.Length > 1)
- {
- string maskslot = stringList[1];
- body.AddMask(text9, maskslot);
- goto IL_92C;
- }
- goto IL_92C;
- IL_92C:
- goto IL_14B9;
- }
- if (stringCom == "delitem")
- {
- string slotname3 = text9;
- if (stringList.Length > 1)
- {
- slotname3 = stringList[1];
- }
- body.DelItem((MPN)Enum.Parse(typeof(MPN), text9, true), slotname3);
- goto IL_14B9;
- }
- if (stringCom == "node消去")
- {
- body.SetVisibleNodeSlot(text9, false, stringList[1]);
- goto IL_14B9;
- }
- if (stringCom == "node表示")
- {
- body.SetVisibleNodeSlot(text9, true, stringList[1]);
- goto IL_14B9;
- }
- if (stringCom == "パーツnode消去")
- {
- body.SetVisibleNodeSlotParts(text9, stringList[1], false, stringList[2]);
- goto IL_14B9;
- }
- if (stringCom == "パーツnode表示")
- {
- body.SetVisibleNodeSlotParts(text9, stringList[1], true, stringList[2]);
- goto IL_14B9;
- }
- if (stringCom == "color")
- {
- string name = stringList[1];
- int matno = int.Parse(stringList[2]);
- string prop_name = stringList[3];
- Color col = new Color(float.Parse(stringList[4]) / 255f, float.Parse(stringList[5]) / 255f, float.Parse(stringList[6]) / 255f, float.Parse(stringList[7]) / 255f);
- body.ChangeCol(name, matno, prop_name, col);
- goto IL_14B9;
- }
- if (stringCom == "mancolor")
- {
- Color manColor = new Color(float.Parse(stringList[1]) / 255f, float.Parse(stringList[2]) / 255f, float.Parse(stringList[3]) / 255f, 1f);
- maid.ManColor = manColor;
- maid.ManColorUpdate();
- goto IL_14B9;
- }
- if (stringCom == "tex" || stringCom == "テクスチャ変更")
- {
- string text15 = stringList[1];
- int num4 = int.Parse(stringList[2]);
- string text16 = stringList[3];
- string filename = stringList[4];
- MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
- if (stringList.Length == 6)
- {
- string text17 = stringList[5];
- try
- {
- parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text17.ToUpper());
- }
- catch
- {
- NDebug.Assert("無限色IDがありません。" + text17, false);
- }
- }
- if (mp.idx == 61)
- {
- num4 = 7;
- }
- if (flag2 && parts_COLOR == MaidParts.PARTS_COLOR.SKIN)
- {
- if (text15 == "body" && num4 == 0 && text16.ToLower() == "_maintex")
- {
- body.ChangeShader(text15, num4, "CM3D2_Toony_Lighted_Outline_Tex");
- flag = true;
- body.ChangeTex(text15, num4, "_OutlineTex", filename, null, MaidParts.PARTS_COLOR.SKIN_OUTLINE);
- body.ChangeTex(text15, num4, "_OutlineToonRamp", "toonBlackA1.tex", null, MaidParts.PARTS_COLOR.SKIN_OUTLINE);
- }
- else if (text15 == "head" && num4 == 5 && text16.ToLower() == "_maintex")
- {
- body.ChangeShader(text15, num4, "CM3D2_Toony_Lighted_Outline_Tex");
- flag = true;
- body.ChangeTex(text15, num4, "_OutlineTex", filename, null, MaidParts.PARTS_COLOR.SKIN_OUTLINE);
- body.ChangeTex(text15, num4, "_OutlineToonRamp", "toonBlackA1.tex", null, MaidParts.PARTS_COLOR.SKIN_OUTLINE);
- }
- }
- body.ChangeTex(text15, num4, text16, filename, null, parts_COLOR);
- if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
- {
- maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
- }
- if ((flag2 || flag3) && !flag)
- {
- body.RestoreShader(text15);
- goto IL_CBC;
- }
- goto IL_CBC;
- IL_CBC:
- goto IL_14B9;
- }
- if (stringCom == "prop")
- {
- string tag2 = stringList[1];
- string s = stringList[2];
- maid.SetProp(tag2, int.Parse(s), false);
- goto IL_14B9;
- }
- if (stringCom == "テクスチャ乗算")
- {
- goto IL_14B9;
- }
- if (stringCom == "テクスチャ合成")
- {
- if (stringList.Length != 7)
- {
- NDebug.Assert("テクスチャ合成 の引数が不正です。" + stringList.Length, false);
- }
- if ((text9 == "accTatoo" || text9 == "hokuro") && !text.Contains("_del"))
- {
- body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), true, 0, 0, 0f, 0f, true, f_SubProp, 1f, 1024);
- goto IL_E1F;
- }
- body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), false, 0, 0, 0f, 0f, false, null, 1f, 1024);
- goto IL_E1F;
- IL_E1F:
- goto IL_14B9;
- }
- if (stringCom == "テクスチャセット合成")
- {
- if (stringList.Length != 7)
- {
- NDebug.Assert("テクスチャセット合成 の引数が不正です。" + stringList.Length, false);
- }
- body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), true, 0, 0, 0f, 0f, true, null, 1f, 1024);
- goto IL_14B9;
- }
- if (stringCom == "マテリアル変更")
- {
- string f_strSlotName = stringList[1];
- int f_nMatNo = int.Parse(stringList[2]);
- string f_strFileName = stringList[3];
- body.ChangeMaterial(f_strSlotName, f_nMatNo, f_strFileName);
- goto IL_14B9;
- }
- if (stringCom == "shader")
- {
- string f_strSlotName2 = stringList[1];
- int f_nMatNo2 = int.Parse(stringList[2]);
- string f_strShaderFileName = stringList[3];
- body.ChangeShader(f_strSlotName2, f_nMatNo2, f_strShaderFileName);
- flag = true;
- goto IL_14B9;
- }
- if (stringCom == "アタッチポイントの設定")
- {
- if (stringList.Length < 5)
- {
- Debug.LogError("アタッチポイントの設定引数の数が不正です。 " + text7 + " " + text3);
- goto IL_FE2;
- }
- Vector3 v = new Vector3(float.Parse(stringList[2]), float.Parse(stringList[3]), float.Parse(stringList[4]));
- Quaternion q = Quaternion.identity;
- if (stringList.Length == 8)
- {
- q = Quaternion.Euler(float.Parse(stringList[5]), float.Parse(stringList[6]), float.Parse(stringList[7]));
- }
- else
- {
- Debug.LogError("アタッチポイントの設定引数に角度指定がありません。 " + text7 + " " + text3);
- }
- body.SetAttachPoint(slotname, stringList[1], v, q, f_bTemp);
- goto IL_FE2;
- IL_FE2:
- goto IL_14B9;
- }
- if (stringCom == "blendset")
- {
- string blendSetName = stringList[1];
- int num5 = (stringList.Length - 2) / 2;
- body.Face.morph.NewBlendSet(blendSetName);
- for (int j = 0; j < num5; j++)
- {
- string tag3 = stringList[2 + j * 2].ToLower();
- float val2 = float.Parse(stringList[3 + j * 2]);
- body.Face.morph.SetValueBlendSet(blendSetName, tag3, val2);
- }
- goto IL_14B9;
- }
- if (stringCom == "paramset")
- {
- body.Face.NewParamSet(text7);
- goto IL_14B9;
- }
- if (stringCom == "commenttype")
- {
- if (!maid.status.partsDic.ContainsKey(stringList[1]))
- {
- maid.status.partsDic.Add(stringList[1], string.Empty);
- }
- maid.status.partsDic[stringList[1]] = stringList[2];
- goto IL_14B9;
- }
- if (stringCom == "useredit")
- {
- if (stringList[2].ToLower() == "material")
- {
- body.SetMaterialProperty(text9, stringList[3], int.Parse(stringList[4]), stringList[5], stringList[6], stringList[7], false);
- goto IL_113A;
- }
- goto IL_113A;
- IL_113A:
- goto IL_14B9;
- }
- if (stringCom == "bonemorph")
- {
- if (9 > stringList.Length || stringList.Length > 10)
- {
- Debug.LogError("BoneMorpの設定引数の数が不正です。 " + text7 + " " + text3);
- }
- if (stringList.Length == 9)
- {
- body.bonemorph.ChangeMorphPosValue(stringList[1], stringList[2], new Vector3(float.Parse(stringList[3]), float.Parse(stringList[4]), float.Parse(stringList[5])), new Vector3(float.Parse(stringList[6]), float.Parse(stringList[7]), float.Parse(stringList[8])));
- goto IL_1300;
- }
- string text18 = stringList[1].ToLower();
- string strPropName = stringList[2];
- string f_strBoneName = stringList[3];
- Vector3 f_fAddMin = new Vector3(float.Parse(stringList[4]), float.Parse(stringList[5]), float.Parse(stringList[6]));
- Vector3 f_fAddMax = new Vector3(float.Parse(stringList[7]), float.Parse(stringList[8]), float.Parse(stringList[9]));
- if (text18 != null)
- {
- if (text18 == "pos")
- {
- body.bonemorph.ChangeMorphPosValue(strPropName, f_strBoneName, f_fAddMin, f_fAddMax);
- goto IL_1300;
- }
- if (text18 == "rot")
- {
- body.bonemorph.ChangeMorphRotatioValue(strPropName, f_strBoneName, f_fAddMin, f_fAddMax);
- goto IL_1300;
- }
- if (text18 == "scl")
- {
- body.bonemorph.ChangeMorphSclValue(strPropName, f_strBoneName, f_fAddMin, f_fAddMax);
- goto IL_1300;
- }
- }
- Debug.LogError(string.Concat(new string[]
- {
- "BoneMorpのタイプ指定が不正です[",
- text18,
- "]\n",
- text7,
- " ",
- text3
- }));
- goto IL_1300;
- IL_1300:
- goto IL_14B9;
- }
- if (stringCom == "length")
- {
- if (stringList.Length != 11)
- {
- Debug.LogError("lengthの設定引数の数が不正です。 " + text7 + " " + text3);
- }
- body.SetHairLengthDataList(stringList[1], stringList[2], stringList[3], stringList[4], new Vector3(float.Parse(stringList[5]), float.Parse(stringList[6]), float.Parse(stringList[7])), new Vector3(float.Parse(stringList[8]), float.Parse(stringList[9]), float.Parse(stringList[10])));
- goto IL_14B9;
- }
- if (stringCom == "anime")
- {
- if (stringList.Length < 3)
- {
- Debug.LogError("animeの設定引数の数が不正です。 " + text7 + " " + text3);
- }
- TBody.SlotID f_slot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
- body.ItemAnimationLoad(f_slot, stringList[2]);
- bool f_bLoop = false;
- if (3 < stringList.Length)
- {
- f_bLoop = (stringList[3] == "loop");
- }
- body.ItemAnimationPlay(f_slot, stringList[2], f_bLoop);
- goto IL_14B9;
- }
- if (stringCom == "param2")
- {
- if (stringList.Length == 4)
- {
- string slotname4 = stringList[1];
- body.GetSlot(slotname4).SetParam2(stringList[2], stringList[3]);
- goto IL_1473;
- }
- Debug.LogError("param2の設定引数の数が不正です。 " + text7 + " " + text3);
- goto IL_1473;
- IL_1473:
- goto IL_14B9;
- }
- if (stringCom == "animematerial")
- {
- TBody.SlotID f_slot2 = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
- string s2 = stringList[2];
- body.MaterialAnimatorAdd(f_slot2, int.Parse(s2));
- goto IL_14B9;
- }
- goto IL_14B9;
- IL_14B9:
- goto IL_153C;
- }
- catch (Exception ex)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "Exception ",
- Path.GetFileName(text),
- " 現在処理中だった行 = ",
- text7,
- " 以前の行 = ",
- text8,
- " ",
- ex.Message,
- "StackTrace:\n",
- ex.StackTrace
- }));
- NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(text), true);
- goto IL_153C;
- }
- IL_153C:
- goto IL_108;
- }
- list.Sort((Menu.LastParam a, Menu.LastParam b) => a.nOrder - a.nOrder);
- for (int k = 0; k < list.Count; k++)
- {
- Menu.LastParam lastParam = list[k];
- if (lastParam.strComm == "アイテムパラメータ")
- {
- TBodySkin slot6 = body.GetSlot(lastParam.aryArgs[0]);
- slot6.SetParam(lastParam.aryArgs[1], lastParam.aryArgs[2]);
- }
- }
- binaryReader.Close();
- binaryReader = null;
- }
- public static void SetMaidItemTemp(Maid maid, string filename, bool f_bTemp = false)
- {
- byte[] buffer = null;
- try
- {
- if (!GameUty.IsExistFile(filename, null))
- {
- return;
- }
- using (AFileBase afileBase = GameUty.FileOpen(filename, null))
- {
- if (!afileBase.IsValid())
- {
- NDebug.Assert("メニューファイルが見つかりません。" + filename, false);
- }
- buffer = afileBase.ReadAll();
- }
- }
- catch (Exception ex)
- {
- Debug.LogError("ProcScriptBin/SetMaidItemTemp アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
- }
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8);
- string text = binaryReader.ReadString();
- NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin/SetMaidItemTemp 例外 : " + filename + " のヘッダーが不正です。" + text);
- int num = binaryReader.ReadInt32();
- string text2 = binaryReader.ReadString();
- string text3 = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- if (text4 == "acctatoo")
- {
- maid.DelProp(MPN.acctatoo, false);
- maid.SetSubProp(MPN.acctatoo, 0, filename, 0);
- }
- else if (text4 == "hokuro")
- {
- maid.DelProp(MPN.hokuro, false);
- maid.SetSubProp(MPN.hokuro, 0, filename, 0);
- }
- else
- {
- maid.SetProp(text4, filename, 0, f_bTemp, false);
- }
- }
- public static bool ExportModScript(Maid maid, string filename, bool f_bTemp = false)
- {
- byte[] cd = null;
- try
- {
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(filename))
- {
- if (!afileBase.IsValid())
- {
- Debug.LogWarning("アイテムメニューファイルが見つかりません。" + filename);
- return false;
- }
- cd = afileBase.ReadAll();
- }
- }
- catch (Exception ex)
- {
- Debug.LogError("ExportModScript アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
- }
- string fullPath = Path.GetFullPath(".\\");
- string text = fullPath + "ModExport";
- if (!Directory.Exists(text))
- {
- Directory.CreateDirectory(text);
- }
- string text2 = "mod_" + Path.GetFileNameWithoutExtension(filename);
- text2 = text2.Trim();
- text = text + "\\" + text2;
- if (!Directory.Exists(text))
- {
- Directory.CreateDirectory(text);
- }
- StreamWriter streamWriter = new StreamWriter(text + "\\" + text2 + ".txt", false, Encoding.UTF8);
- streamWriter.WriteLine("出力バージョン\t" + 1270);
- streamWriter.WriteLine("基本アイテム\t" + filename.Replace(" ", ":"));
- try
- {
- Menu.ExportModScript(maid, cd, streamWriter, text + "\\" + text2, f_bTemp);
- NUty.WinMessageBox(NUty.GetWindowHandle(), string.Concat(new string[]
- {
- "MODテンプレート出力完了\n",
- text,
- "\\",
- text2,
- ".txt"
- }), "MOD Compile Completed", 0);
- }
- catch (Exception ex2)
- {
- Debug.LogError("ExportModScript 例外 : " + filename + " : " + ex2.Message);
- }
- finally
- {
- streamWriter.Close();
- streamWriter.Dispose();
- streamWriter = null;
- }
- return true;
- }
- public static void ExportModScript(Maid maid, byte[] cd, StreamWriter sw, string filename, bool f_bTemp = false)
- {
- TBody body = maid.body0;
- List<Menu.LastParam> list = new List<Menu.LastParam>();
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
- string text = binaryReader.ReadString();
- NDebug.Assert(text == "CM3D2_MENU", "ExportModScript 例外 : ヘッダーファイルが不正です。" + text);
- int num = binaryReader.ReadInt32();
- string path = binaryReader.ReadString();
- string str = binaryReader.ReadString();
- sw.WriteLine("アイテム名\t" + str);
- string str2 = binaryReader.ReadString();
- sw.WriteLine("カテゴリ名\t" + str2);
- string text2 = binaryReader.ReadString();
- sw.WriteLine("説明\t" + text2.Replace("\n", "《改行》"));
- sw.WriteLine("アイコン\t" + Path.GetFileName(filename + ".png"));
- long num2 = (long)binaryReader.ReadInt32();
- bool flag = false;
- List<string> list2 = new List<string>();
- string text3 = string.Empty;
- string text4 = string.Empty;
- string empty = string.Empty;
- string empty2 = string.Empty;
- try
- {
- for (;;)
- {
- int num3 = (int)binaryReader.ReadByte();
- text4 = text3;
- text3 = string.Empty;
- if (num3 == 0)
- {
- break;
- }
- for (int i = 0; i < num3; i++)
- {
- text3 = text3 + "\"" + binaryReader.ReadString() + "\" ";
- }
- if (!(text3 == string.Empty))
- {
- string stringCom = UTY.GetStringCom(text3);
- string[] stringList = UTY.GetStringList(text3);
- if (stringCom == "end")
- {
- break;
- }
- if (!(stringCom == "name"))
- {
- if (stringCom == "icon" || stringCom == "icons")
- {
- string f_strFileName = stringList[1];
- Texture2D texture2D = ImportCM.CreateTexture(f_strFileName);
- if (texture2D != null)
- {
- UTY.SaveImage(texture2D, filename + ".png");
- }
- }
- else if (stringCom == "additem")
- {
- sw.WriteLine("アイテム変更");
- string text5 = empty;
- if (stringList.Length > 1)
- {
- text5 = stringList[2];
- }
- list2.Add(text5);
- sw.WriteLine("\tスロット名\t" + text5);
- TBodySkin slot = maid.body0.GetSlot(text5);
- foreach (Transform transform in slot.obj.GetComponentsInChildren<Transform>(true))
- {
- Renderer component = transform.GetComponent<Renderer>();
- if (!(component == null) && component.materials != null)
- {
- Material[] materials = component.materials;
- for (int k = 0; k < materials.Length; k++)
- {
- Material f_mat = materials[k];
- sw.WriteLine("\t\tマテリアル番号\t" + k);
- Menu.ModMaterial(f_mat, sw);
- }
- }
- }
- }
- else if (!(stringCom == "color"))
- {
- if (stringCom == "tex" || stringCom == "テクスチャ変更")
- {
- string text6 = stringList[1];
- int num4 = int.Parse(stringList[2]);
- string str3 = stringList[3];
- string text7 = stringList[4];
- string text8 = (6 > stringList.Length) ? null : stringList[5];
- if (!list2.Contains(text6))
- {
- string text9 = "テクスチャ変更";
- text9 = text9 + "\t" + text6;
- text9 = text9 + "\t" + num4;
- text9 = text9 + "\t" + str3;
- text9 = text9 + "\t" + text7;
- if (!string.IsNullOrEmpty(text8))
- {
- text9 = text9 + "\t" + text8;
- }
- if (text7.Contains("*"))
- {
- string text10 = string.Empty;
- TBodySkin slot2 = maid.body0.GetSlot(text6);
- if (slot2 != null)
- {
- text10 += "参考)出力時のモデル名は ";
- text10 += Path.GetFileNameWithoutExtension(slot2.m_strModelFileName);
- text10 += " です。";
- }
- sw.WriteLine("// * の部分は現在装着されているモデル名に置換されます。" + text10);
- }
- if (!string.IsNullOrEmpty(text8) && !flag)
- {
- string text11 = "// 無限色ID群 ";
- IEnumerator enumerator = Enum.GetValues(typeof(MaidParts.PARTS_COLOR)).GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- text11 = text11 + ((MaidParts.PARTS_COLOR)obj).ToString() + " ";
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- sw.WriteLine(text11);
- flag = true;
- }
- sw.WriteLine(text9);
- }
- }
- else if (stringCom == "テクスチャ合成")
- {
- string item = stringList[1];
- int num5 = int.Parse(stringList[2]);
- string text12 = stringList[3];
- string text13 = stringList[4];
- if (!list2.Contains(item))
- {
- }
- }
- else if (stringCom == "マテリアル変更")
- {
- string text14 = stringList[1];
- int num6 = int.Parse(stringList[2]);
- string text15 = stringList[3];
- if (!list2.Contains(text14))
- {
- sw.WriteLine("マテリアル変更");
- sw.WriteLine("\tスロット名\t" + text14);
- TBodySkin slot3 = maid.body0.GetSlot(text14);
- foreach (Transform transform2 in slot3.obj.GetComponentsInChildren<Transform>(true))
- {
- Renderer component2 = transform2.GetComponent<Renderer>();
- if (!(component2 == null) && component2.materials != null)
- {
- Material[] materials2 = component2.materials;
- for (int m = 0; m < materials2.Length; m++)
- {
- Material f_mat2 = materials2[m];
- sw.WriteLine("\t\tマテリアル番号\t" + m);
- Menu.ModMaterial(f_mat2, sw);
- }
- }
- }
- }
- }
- else if (stringCom == "color_set")
- {
- if (stringList.Length >= 3)
- {
- string text16 = stringList[2];
- text16 = "mod_" + Path.GetFileNameWithoutExtension(text16) + ".mod";
- sw.WriteLine("色セット\t" + stringList[1] + "\t" + text16);
- }
- else
- {
- sw.WriteLine("色セット\t" + stringList[1]);
- }
- MPN f_mpn = (MPN)Enum.Parse(typeof(MPN), stringList[1].ToLower());
- maid.ExportModBaseMenu(f_mpn);
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "Exception ",
- Path.GetFileName(path),
- " 現在処理中だった行 = ",
- text3,
- " 以前の行 = ",
- text4,
- " ",
- ex.Message,
- "StackTrace:\n",
- ex.StackTrace
- }));
- NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(path), false);
- if (binaryReader != null)
- {
- binaryReader.Close();
- binaryReader = null;
- }
- throw ex;
- }
- if (binaryReader != null)
- {
- binaryReader.Close();
- binaryReader = null;
- }
- }
- public static string[] NeedTextureWildCard(string f_strTexName)
- {
- string[] array;
- if (f_strTexName.Contains("*"))
- {
- string strTexName = f_strTexName;
- strTexName = strTexName.Replace("*", ".*");
- if (Menu.m_strAllTexInFileSys == null)
- {
- Menu.m_strAllTexInFileSys = GameUty.FileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
- }
- array = Array.FindAll<string>(Menu.m_strAllTexInFileSys, (string i) => new Regex(strTexName).IsMatch(i));
- array = Array.FindAll<string>(array, (string i) => new Regex("^((?!_i_).)*$").IsMatch(i));
- IEnumerable<string> source = array;
- if (Menu.<>f__mg$cache0 == null)
- {
- Menu.<>f__mg$cache0 = new Func<string, string>(Path.GetFileName);
- }
- array = source.Select(Menu.<>f__mg$cache0).ToArray<string>();
- string strMatchGroup = strTexName.Replace(".*", "(?<WILD>.*)");
- array = array.Select(delegate(string i)
- {
- Match match = new Regex(strMatchGroup).Match(i);
- if (match.Success)
- {
- return match.Groups["WILD"].Value;
- }
- return i;
- }).ToArray<string>();
- }
- else
- {
- array = new string[]
- {
- Path.GetFileName(f_strTexName)
- };
- }
- return array;
- }
- private static void ModMaterial(Material f_mat, StreamWriter f_sw)
- {
- for (int i = 0; i < Menu.material_properties.GetLength(0); i++)
- {
- if (f_mat.HasProperty(Menu.material_properties[i, 0]))
- {
- if (Menu.material_properties[i, 1] == "tex")
- {
- Texture texture = f_mat.GetTexture(Menu.material_properties[i, 0]);
- f_sw.WriteLine("\t\t\tテクスチャ設定\t" + Menu.material_properties[i, 0] + "\t" + texture.name);
- }
- else if (Menu.material_properties[i, 1] == "col")
- {
- Color color = f_mat.GetColor(Menu.material_properties[i, 0]);
- f_sw.WriteLine(string.Concat(new object[]
- {
- "\t\t\t色設定\t",
- Menu.material_properties[i, 0],
- "\t",
- (int)(255f * color.r),
- "\t",
- (int)(255f * color.g),
- "\t",
- (int)(255f * color.b),
- "\t",
- (int)(255f * color.a)
- }));
- }
- else if (Menu.material_properties[i, 1] == "f")
- {
- float @float = f_mat.GetFloat(Menu.material_properties[i, 0]);
- f_sw.WriteLine(string.Concat(new object[]
- {
- "\t\t\t数値設定\t",
- Menu.material_properties[i, 0],
- "\t",
- @float
- }));
- }
- }
- }
- }
- private static string GetBaseItemFromMod(string f_strModMenu)
- {
- string empty = string.Empty;
- FileStream fileStream = new FileStream(f_strModMenu, FileMode.Open);
- if (fileStream == null)
- {
- return string.Empty;
- }
- BinaryReader binaryReader = new BinaryReader(fileStream);
- string a = binaryReader.ReadString();
- NDebug.Assert(a == "CM3D2_MOD", "セーブデータファイルのヘッダーが不正です。_MOD");
- int num = binaryReader.ReadInt32();
- string text = binaryReader.ReadString();
- string text2 = binaryReader.ReadString();
- text2 = text2.Replace(":", " ");
- string text3 = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- string text5 = binaryReader.ReadString();
- binaryReader.Close();
- fileStream.Close();
- fileStream.Dispose();
- return text2;
- }
- private static void ProcModScriptBin(Maid maid, byte[] cd, string filename, bool f_bTemp = false)
- {
- Menu.ProcModScriptBin(maid, cd, filename, null, f_bTemp);
- }
- private static void ProcModScriptBin(Maid maid, byte[] cd, string filename, MaidProp mp, bool f_bTemp = false)
- {
- if (mp != null && maid.body0 != null && (mp.idx == 61 || mp.idx == 64 || mp.idx == 65 || mp.idx == 66))
- {
- TBodySkin slot = maid.body0.GetSlot(1);
- if (slot.PartsVersion < 110)
- {
- return;
- }
- }
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
- string text = binaryReader.ReadString();
- NDebug.Assert(text == "CM3D2_MOD", "ProcModScriptBin 例外 : ヘッダーファイルが不正です。" + text);
- int num = binaryReader.ReadInt32();
- string text2 = binaryReader.ReadString();
- string text3 = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- string text5 = binaryReader.ReadString();
- string text6 = binaryReader.ReadString();
- string text7 = binaryReader.ReadString();
- MPN mpn = MPN.null_mpn;
- try
- {
- mpn = (MPN)Enum.Parse(typeof(MPN), text7);
- }
- catch
- {
- NDebug.Assert("カテゴリがありません。" + text7, false);
- }
- string text8 = string.Empty;
- if (mpn != MPN.null_mpn)
- {
- text8 = binaryReader.ReadString();
- }
- string s = binaryReader.ReadString();
- int num2 = binaryReader.ReadInt32();
- Dictionary<string, byte[]> dictionary = new Dictionary<string, byte[]>();
- for (int i = 0; i < num2; i++)
- {
- string key = binaryReader.ReadString();
- int count = binaryReader.ReadInt32();
- byte[] value = binaryReader.ReadBytes(count);
- dictionary.Add(key, value);
- }
- binaryReader.Close();
- binaryReader = null;
- using (StringReader stringReader = new StringReader(s))
- {
- Menu.IMode mode = Menu.IMode.Non;
- string slotname = string.Empty;
- TBodySkin tbodySkin = null;
- Material material = null;
- int num3 = 0;
- string text9;
- while ((text9 = stringReader.ReadLine()) != null)
- {
- string[] array = text9.Split(new char[]
- {
- '\t',
- ' '
- }, StringSplitOptions.RemoveEmptyEntries);
- if (array[0] == "アイテム変更" || array[0] == "マテリアル変更")
- {
- mode = Menu.IMode.ItemChange;
- }
- else if (array[0] == "テクスチャ変更")
- {
- mode = Menu.IMode.TexChange;
- }
- if (mode == Menu.IMode.ItemChange)
- {
- if (array[0] == "スロット名")
- {
- slotname = array[1];
- tbodySkin = maid.body0.GetSlot(slotname);
- }
- if (tbodySkin != null)
- {
- if (array[0] == "マテリアル番号")
- {
- num3 = int.Parse(array[1]);
- foreach (Transform transform in tbodySkin.obj.GetComponentsInChildren<Transform>(true))
- {
- Renderer component = transform.GetComponent<Renderer>();
- if (!(component == null) && component.materials != null)
- {
- Material[] materials = component.materials;
- for (int k = 0; k < materials.Length; k++)
- {
- if (k == num3)
- {
- material = materials[k];
- break;
- }
- }
- }
- }
- }
- if (material != null)
- {
- if (array[0] == "テクスチャ設定")
- {
- maid.body0.ChangeTex(slotname, num3, array[1], array[2].ToLower(), dictionary, MaidParts.PARTS_COLOR.NONE);
- }
- else if (array[0] == "色設定")
- {
- material.SetColor(array[1], new Color(float.Parse(array[2]) / 255f, float.Parse(array[3]) / 255f, float.Parse(array[4]) / 255f, float.Parse(array[5]) / 255f));
- }
- else if (array[0] == "数値設定")
- {
- material.SetFloat(array[1], float.Parse(array[2]));
- }
- }
- }
- }
- else if (mode == Menu.IMode.TexChange)
- {
- MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
- if (array.Length == 6)
- {
- string text10 = array[5];
- try
- {
- parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text10.ToUpper());
- }
- catch
- {
- NDebug.Assert("無限色IDがありません。" + text10, false);
- }
- }
- int matno = int.Parse(array[2]);
- if (mp != null && mp.idx == 61)
- {
- matno = 7;
- }
- maid.body0.ChangeTex(array[1], matno, array[3], array[4].ToLower(), dictionary, parts_COLOR);
- if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
- {
- maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
- }
- }
- }
- }
- }
- // Note: this type is marked as 'beforefieldinit'.
- static Menu()
- {
- string[,] array = new string[31, 2];
- array[0, 0] = "_MainTex";
- array[0, 1] = "tex";
- array[1, 0] = "_BumpMap";
- array[1, 1] = "tex";
- array[2, 0] = "_ToonRamp";
- array[2, 1] = "tex";
- array[3, 0] = "_ShadowTex";
- array[3, 1] = "tex";
- array[4, 0] = "_ShadowRateToon";
- array[4, 1] = "tex";
- array[5, 0] = "_SpecularTex";
- array[5, 1] = "tex";
- array[6, 0] = "_AnisoTex";
- array[6, 1] = "tex";
- array[7, 0] = "_RenderTex";
- array[7, 1] = "tex";
- array[8, 0] = "_HiTex";
- array[8, 1] = "tex";
- array[9, 0] = "_OutlineTex";
- array[9, 1] = "tex";
- array[10, 0] = "_OutlineToonRamp";
- array[10, 1] = "tex";
- array[11, 0] = "_Color";
- array[11, 1] = "col";
- array[12, 0] = "_ShadowColor";
- array[12, 1] = "col";
- array[13, 0] = "_RimColor";
- array[13, 1] = "col";
- array[14, 0] = "_SpecColor";
- array[14, 1] = "col";
- array[15, 0] = "_Emission";
- array[15, 1] = "col";
- array[16, 0] = "_ReflectColor";
- array[16, 1] = "col";
- array[17, 0] = "_OutlineColor";
- array[17, 1] = "col";
- array[18, 0] = "_MyLightColor0";
- array[18, 1] = "col";
- array[19, 0] = "_MyLightColor1";
- array[19, 1] = "col";
- array[20, 0] = "_TintColor";
- array[20, 1] = "col";
- array[21, 0] = "_ShadowColor";
- array[21, 1] = "col";
- array[22, 0] = "_Shininess";
- array[22, 1] = "f";
- array[23, 0] = "_FurLength";
- array[23, 1] = "f";
- array[24, 0] = "_OutlineWidth";
- array[24, 1] = "f";
- array[25, 0] = "_Cutoff";
- array[25, 1] = "f";
- array[26, 0] = "_AnisoOffset";
- array[26, 1] = "f";
- array[27, 0] = "_RimPower";
- array[27, 1] = "f";
- array[28, 0] = "_RimShift";
- array[28, 1] = "f";
- array[29, 0] = "_HiRate";
- array[29, 1] = "f";
- array[30, 0] = "_HiPow";
- array[30, 1] = "f";
- Menu.material_properties = array;
- }
- public static SortedDictionary<int, SortedDictionary<string, string>> m_dicResourceRef = new SortedDictionary<int, SortedDictionary<string, string>>();
- private static string[] m_strAllTexInFileSys = null;
- private static string[,] material_properties;
- [CompilerGenerated]
- private static Func<string, string> <>f__mg$cache0;
- private class LastParam
- {
- public LastParam(int f_nOrder, string f_strComm, params string[] f_argArgs)
- {
- this.nOrder = f_nOrder;
- this.strComm = f_strComm;
- this.aryArgs = new string[f_argArgs.Length];
- f_argArgs.CopyTo(this.aryArgs, 0);
- }
- public int nOrder;
- public string strComm = string.Empty;
- public string[] aryArgs;
- }
- private enum IMode
- {
- Non,
- ItemChange,
- TexChange
- }
- }
|