CM3D2.XTMasterSlave.2ndWnd.cs 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.IO;
  7. //
  8. using UnityEngine;
  9. using PluginExt;
  10. using CM3D2.XtMasterSlave.Plugin;
  11. namespace CM3D2.XtMasterSlave.Plugin
  12. {
  13. class XtMs2ndWnd
  14. {
  15. public static bool boShow = false;
  16. public static Vector2 EditScroll_cfg = Vector2.zero;
  17. static int EditScroll_cfg_sizeY = 0;
  18. public static Vector2 EditScroll_fn = Vector2.zero;
  19. static int EditScroll_fn_sizeX = 0;
  20. const int ItemX = 5;
  21. const int ItemWidth = XtMasterSlave.GUI_WIDTH - 16 - 5;//- 10;
  22. const int ItemHeight = 20;
  23. static UserConfig _UserCfg;
  24. static string _EditIniFN = string.Empty;
  25. static string _LoadIniFN = string.Empty;
  26. static string _memo = string.Empty;
  27. public static List<string> _UserIniFN = new List<string>();
  28. //名前で読み出し、表示も試みる
  29. //メインのcfgへ static bool boNameSelectAndLoad = false;
  30. public static void Init()
  31. {
  32. _EditIniFN = string.Empty;
  33. _LoadIniFN = string.Empty;
  34. _memo = string.Empty;
  35. //ファイル一覧取得
  36. GetUsersConfigs();
  37. }
  38. static string maidorman(Maid m)
  39. {
  40. if (m.boMAN)
  41. return "男 ";
  42. return "メイド";
  43. }
  44. public static void SaveWindowCallback_proc(int id, XtMasterSlave XtMS, ref int showWndMode, ref int _pageNum, XtMasterSlave.MsLinks[] p_MSlinks, XtMasterSlave.MsLinkConfig[] cfgs, XtMasterSlave.v3Offsets[] v3ofs, out string _WinprocPhase)
  45. {
  46. //XtMasterSlave.MsLinks ms_ = p_MSlinks[_pageNum];
  47. //bool boChrCng = false;
  48. _WinprocPhase = "[init]";
  49. GUIStyle gsLabel = new GUIStyle("label");
  50. gsLabel.fontSize = 12;
  51. gsLabel.alignment = TextAnchor.MiddleLeft;
  52. GUIStyle gsButton = new GUIStyle("button");
  53. gsButton.fontSize = 12;
  54. gsButton.alignment = TextAnchor.MiddleCenter;
  55. GUIStyle gsToggle = new GUIStyle("toggle");
  56. gsToggle.fontSize = 12;
  57. gsToggle.alignment = TextAnchor.MiddleLeft;
  58. GUIStyle gsText = new GUIStyle("textfield");
  59. gsText.fontSize = 12;
  60. gsText.alignment = TextAnchor.UpperLeft;
  61. GUIStyle gsTextAr = new GUIStyle("textArea");
  62. gsTextAr.fontSize = 12;
  63. gsTextAr.alignment = TextAnchor.UpperLeft;
  64. gsTextAr.wordWrap = true;
  65. GUIStyle gsCombo = new GUIStyle("button");
  66. gsCombo.fontSize = 12;
  67. gsCombo.alignment = TextAnchor.MiddleLeft;
  68. gsCombo.hover.textColor = Color.cyan;
  69. gsCombo.onHover.textColor = Color.cyan;
  70. gsCombo.onActive.textColor = Color.cyan;
  71. //GUIStyle gsScView = new GUIStyle("scrollView");
  72. _WinprocPhase = "[ctrl-1]";
  73. //GUI.enabled = false; //セーブ画面では閉じない
  74. if (GUI.Button(new Rect(240, 0, 20, 20), "x", gsButton))
  75. {
  76. //GizmoVisible(false);
  77. //GizmoHsVisible(false);
  78. //GuiFlag = false;
  79. boShow = false;
  80. }
  81. GUI.enabled = true;
  82. if (showWndMode == 1)
  83. GUI.enabled = false;
  84. if (GUI.Button(new Rect(240 - 70, 0, 20, 20), "-", gsButton))
  85. {
  86. showWndMode = 1;
  87. }
  88. GUI.enabled = true;
  89. if (showWndMode == 2)
  90. GUI.enabled = false;
  91. if (GUI.Button(new Rect(240 - 50, 0, 20, 20), "=", gsButton))
  92. {
  93. showWndMode = 2;
  94. }
  95. GUI.enabled = true;
  96. if (showWndMode == 0)
  97. GUI.enabled = false;
  98. if (GUI.Button(new Rect(240 - 30, 0, 20, 20), "□", gsButton))
  99. {
  100. showWndMode = 0;
  101. }
  102. GUI.enabled = true;
  103. EditScroll_cfg = GUI.BeginScrollView(new Rect(0, 20, XtMasterSlave.GUI_WIDTH, XtMasterSlave.GUI_HIGHT - 30), EditScroll_cfg,
  104. new Rect(0, 0, XtMasterSlave.GUI_WIDTH - 16, EditScroll_cfg_sizeY));
  105. try
  106. {
  107. //XtMasterSlave.MsLinkConfig p_mscfg = cfgs[_pageNum];
  108. //XtMasterSlave.v3Offsets p_v3of = v3ofs[_pageNum];
  109. int pos_y = 0;
  110. GUI.Label(new Rect(ItemX, pos_y, 200, ItemHeight), "【設定保存・読込】", gsLabel);
  111. pos_y += ItemHeight;
  112. if (GUI.Button(new Rect(ItemX, pos_y, ItemWidth, ItemHeight), "戻る", gsButton))
  113. {
  114. boShow = false;
  115. Init();
  116. }
  117. pos_y += ItemHeight;
  118. pos_y += ItemHeight / 2;
  119. GUI.Label(new Rect(ItemX, pos_y, 200, ItemHeight), "【デフォルト&一般設定】", gsLabel);
  120. if (GUI.Button(new Rect(ItemX, pos_y += ItemHeight, ItemWidth / 2, ItemHeight), "保存", gsButton))
  121. {
  122. // Iniファイル書き出し
  123. XtMS.SaveMyConfigs();
  124. }
  125. if (GUI.Button(new Rect(ItemX + ItemWidth / 2, pos_y, ItemWidth / 2, ItemHeight), "読込", gsButton))
  126. {
  127. // Iniファイル読み出し
  128. XtMS.LoadMyConfigs();
  129. }
  130. /*
  131. GUI.Label(new Rect(5 + ItemWidth - 25 - 35 - 35, pos_y, 25, ItemHeight), "設定", gsLabel);
  132. if (GUI.Button(new Rect(5 + ItemWidth - 35 - 35, pos_y, 35, 20), "保存", gsButton))
  133. {
  134. // Iniファイル書き出し
  135. XtMS.SaveMyConfigs();
  136. }
  137. if (GUI.Button(new Rect(5 + ItemWidth - 35, pos_y, 35, 20), "読込", gsButton))
  138. {
  139. // Iniファイル読み出し
  140. XtMS.LoadMyConfigs();
  141. }*/
  142. pos_y += ItemHeight;
  143. pos_y += ItemHeight/2;
  144. // 男0でもプリセ保存できてもいいかな?v0025 if (XtMasterSlave._MensList.Count <= 0)
  145. // GUI.enabled = false;
  146. try
  147. {
  148. GUI.Label(new Rect(ItemX, pos_y, 200, ItemHeight), "【プリセットの保存】", gsLabel);
  149. pos_y += ItemHeight;
  150. GUI.Label(new Rect(ItemX, pos_y, ItemWidth - 110, ItemHeight), "ファイル名(Save)", gsLabel);
  151. if (GUI.Button(new Rect(ItemWidth - 110, pos_y, 110, ItemHeight), "日時で付ける", gsButton))
  152. {
  153. _memo = string.Empty;
  154. _EditIniFN = "XtMS-" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".ini";
  155. }
  156. _EditIniFN = GUI.TextField(new Rect(5, pos_y += ItemHeight, ItemWidth, ItemHeight), _EditIniFN, gsText);
  157. if (GUI.Button(new Rect(ItemX, pos_y += ItemHeight, ItemWidth, ItemHeight), "保存", gsButton))
  158. {
  159. // Iniファイル書き出し
  160. _WinprocPhase = "[save-uIni]";
  161. if (string.IsNullOrEmpty(_EditIniFN))
  162. {
  163. NUty.WinMessageBox(NUty.GetWindowHandle(), "ファイル名を入力して下さい", "( ! )", NUty.MSGBOX.MB_OK | NUty.MSGBOX.MB_ICONERROR);
  164. }
  165. else
  166. {
  167. if (Path.GetExtension(_EditIniFN) != ".ini")
  168. {
  169. _EditIniFN = _EditIniFN + ".ini";
  170. }
  171. UserConfig ucfg = new UserConfig();
  172. string strmemo = "";
  173. for (int i = 0; i < cfgs.Length; i++)
  174. {
  175. XtMasterSlave.v3OffsetsToIniCfgs(ref cfgs[i], v3ofs[i]);
  176. }
  177. for (int i = 0; i < XtMasterSlave.MAX_PAGENUM; i++)
  178. {
  179. var ms = p_MSlinks[i];
  180. ucfg.cfgs_ms[i] = cfgs[i];
  181. ucfg.cfgs_p[i] = new UserConfigPage(ms.doMasterSlave, ms.Scc1_MasterMaid, ms);
  182. /*ucfg.cfgs_p[i] = new UserConfigPage(ms.doMasterSlave, ms.Scc1_MasterMaid,
  183. new XtMasterSlave.ManInfo(ms.mdMasters[ms.mdMaster_No].mem, ms.mdMaster_No),
  184. new XtMasterSlave.ManInfo(ms.mdSlaves[ms.mdSlave_No].mem, ms.mdSlave_No));
  185. */
  186. if (ms.doMasterSlave)
  187. {
  188. strmemo = strmemo + i+ "Master" + ": [" + maidorman(ms.mdMasters[0].mem) + ms.mdMaster_No + "] " + XtMasterSlave.GetMaidName(ms.mdMasters[ms.mdMaster_No]) + " [M⇔S]\r\n";
  189. strmemo = strmemo + " Slave" + ": [" + maidorman(ms.mdSlaves[0].mem) + ms.mdSlave_No + "] " + XtMasterSlave.GetMaidName(ms.mdSlaves[ms.mdSlave_No]) + " [M⇔S]\r\n";
  190. }
  191. else if (XtMasterSlave._MensList.Count <= 0)
  192. {
  193. // メイドのみモード
  194. strmemo = strmemo + i + "Master" + ": 不在" + "\r\n";
  195. if (ms.mdSlave_No < 0)
  196. strmemo = strmemo + " Slave" + ": [" + maidorman(ms.mdSlaves[0].mem) + "_] " + "未選択" + "\r\n";
  197. else
  198. strmemo = strmemo + " Slave" + ": [" + maidorman(ms.mdSlaves[0].mem) + ms.mdSlave_No + "] " + XtMasterSlave.GetMaidName(ms.mdSlaves[ms.mdSlave_No]) + "\r\n";
  199. }
  200. else
  201. {
  202. if (ms.mdMaster_No < 0)
  203. strmemo = strmemo + i + "Master" + ": [" + maidorman(ms.mdMasters[0].mem) + "_] " + "未選択" + "\r\n";
  204. else
  205. strmemo = strmemo + i + "Master" + ": [" + maidorman(ms.mdMasters[0].mem) + ms.mdMaster_No + "] " + XtMasterSlave.GetMaidName(ms.mdMasters[ms.mdMaster_No]) + "\r\n";
  206. if (ms.mdSlave_No < 0)
  207. strmemo = strmemo + " Slave" + ": [" + maidorman(ms.mdSlaves[0].mem) + "_] " + "未選択" + "\r\n";
  208. else
  209. strmemo = strmemo + " Slave" + ": [" + maidorman(ms.mdSlaves[0].mem) + ms.mdSlave_No + "] " + XtMasterSlave.GetMaidName(ms.mdSlaves[ms.mdSlave_No]) + "\r\n";
  210. }
  211. }
  212. if (strmemo.Length > 0)
  213. {
  214. //strmemo = "保存時のリンク状態\r\n" + strmemo;
  215. }
  216. _WinprocPhase = "[save-uIni2]";
  217. ucfg.cfg_h.CurPageNum = _pageNum;
  218. ucfg.cfg_h.Memo = strmemo;
  219. // ジッサイに保存
  220. SaveIni_UserCfg(_EditIniFN, ucfg);
  221. GetUsersConfigs();
  222. }
  223. }
  224. }
  225. catch
  226. {
  227. throw;
  228. }
  229. finally
  230. {
  231. GUI.enabled = true;
  232. }
  233. pos_y += ItemHeight;
  234. pos_y += ItemHeight;
  235. GUI.Label(new Rect(ItemX, pos_y, 200, ItemHeight), "【プリセットの読込】", gsLabel);
  236. pos_y += ItemHeight;
  237. List<string> slist = _UserIniFN;
  238. Rect boxrect = new Rect(ItemX, pos_y, ItemWidth, ItemHeight * 5);
  239. pos_y += ItemHeight * 5;
  240. GUI.Box(boxrect, "");
  241. EditScroll_fn = GUI.BeginScrollView(boxrect, EditScroll_fn, new Rect(0, 0, EditScroll_fn_sizeX, (ItemHeight * slist.Count())), false, true);
  242. EditScroll_fn_sizeX = (int)boxrect.width - 16;
  243. try
  244. {
  245. int pos_sy = 0;
  246. foreach (string str in slist)
  247. {
  248. bool chk = (_LoadIniFN == str);
  249. int pos_sx = 2;
  250. //ファイル名
  251. Vector2 v2Toggle = gsToggle.CalcSize(new GUIContent(str));
  252. v2Toggle.x += pos_sx + 10;
  253. if (EditScroll_fn_sizeX < v2Toggle.x)
  254. EditScroll_fn_sizeX = (int)v2Toggle.x;
  255. bool chk2 = GUI.Toggle(new Rect(pos_sx, pos_sy, /*boxrect.width*/v2Toggle.x, ItemHeight), chk, str, gsToggle);
  256. if (chk != chk2)
  257. {
  258. if (chk2)
  259. {
  260. _LoadIniFN = str;
  261. _UserCfg = LoadIni_UserCfg(str);
  262. _memo = _UserCfg.cfg_h.Memo;
  263. }/*
  264. else
  265. {
  266. _LoadIniFN = string.Empty;
  267. }*/
  268. }
  269. pos_sy += ItemHeight;
  270. }
  271. }
  272. catch (Exception)
  273. {
  274. _WinprocPhase = "スクロール1";
  275. throw;
  276. }
  277. finally
  278. {
  279. GUI.EndScrollView();
  280. }
  281. //pos_y += ItemHeight / 2;
  282. //ファイル名
  283. GUI.Label(new Rect(ItemX, pos_y, 200, ItemHeight), "ファイル名(Load)", gsLabel);
  284. GUI.TextField(new Rect(5, pos_y += ItemHeight, ItemWidth, ItemHeight), _LoadIniFN, gsText);
  285. GUI.Label(new Rect(ItemX, pos_y += ItemHeight, ItemWidth, ItemHeight), "保存時の情報", gsLabel);
  286. GUI.TextArea(new Rect(ItemX, pos_y += ItemHeight, ItemWidth, ItemHeight * 8), _memo, gsTextAr);
  287. pos_y += ItemHeight * 8;
  288. //pos_y += ItemHeight / 2;
  289. if (GUI.Button(new Rect(ItemX, pos_y, ItemWidth, ItemHeight), "読込", gsButton))
  290. {
  291. // 元のカーソルを保持
  292. System.Windows.Forms.Cursor preCursor = System.Windows.Forms.Cursor.Current;
  293. // カーソルを待機カーソルに変更
  294. System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
  295. try {
  296. // Iniファイル読み出し
  297. _UserCfg = LoadIni_UserCfg(_LoadIniFN);
  298. //ページ選択の復元
  299. _pageNum = _UserCfg.cfg_h.CurPageNum;
  300. //プリセットデータの反映を行う
  301. procUserCfg(p_MSlinks, cfgs, v3ofs);
  302. }
  303. catch
  304. {
  305. _WinprocPhase = "[load-uIni2]";
  306. throw;
  307. }
  308. finally
  309. {
  310. // カーソルを元に戻す
  311. System.Windows.Forms.Cursor.Current = preCursor;
  312. }
  313. //画面を閉じる
  314. boShow = false;
  315. Init();
  316. }//ボタン
  317. pos_y += ItemHeight;
  318. XtMasterSlave.cfg.boNameSelectAndLoad = GUI.Toggle(new Rect(ItemX, pos_y, ItemWidth, ItemHeight), XtMasterSlave.cfg.boNameSelectAndLoad, "キャラ名指定&呼び出し有効", gsToggle);
  319. pos_y += ItemHeight;
  320. GUI.Label(new Rect(ItemX, pos_y, ItemWidth, ItemHeight), "注:呼び出す人数が多いと時間が掛かります", gsLabel);
  321. pos_y += ItemHeight;
  322. GUI.Label(new Rect(ItemX, pos_y, ItemWidth, ItemHeight), "(※OFF時は表示キャラ順の番号指定)", gsLabel);
  323. pos_y += ItemHeight;
  324. pos_y += ItemHeight / 2;
  325. pos_y += ItemHeight * 2;
  326. EditScroll_cfg_sizeY = pos_y;
  327. }
  328. catch
  329. {
  330. throw;
  331. }
  332. finally
  333. {
  334. GUI.EndScrollView();
  335. }
  336. }
  337. static void procUserCfg(XtMasterSlave.MsLinks[] p_MSlinks, XtMasterSlave.MsLinkConfig[] cfgs, XtMasterSlave.v3Offsets[] v3ofs)
  338. {
  339. for (int i = 0; i < XtMasterSlave.MAX_PAGENUM; i++)
  340. {
  341. var ms = p_MSlinks[i];
  342. //v0031 fix
  343. ms.mdMaster_No = -1;
  344. ms.FixMaster();
  345. ms.mdSlave_No = -1;
  346. ms.FixSlave();
  347. cfgs[i] = _UserCfg.cfgs_ms[i];
  348. UserConfigPage cfgp = _UserCfg.cfgs_p[i];
  349. ms.Scc1_MasterMaid = cfgp.isMasterMaid;
  350. ms.mdMaster_No = cfgp.Master_ID;
  351. ms.mdSlave_No = cfgp.Slave_ID;
  352. if (!ms.Scc1_MasterMaid)
  353. {
  354. ms.mdMasters = XtMasterSlave._MensList;
  355. ms.mdSlaves = XtMasterSlave._MaidList;
  356. }
  357. else
  358. {
  359. ms.mdSlaves = XtMasterSlave._MensList;
  360. ms.mdMasters = XtMasterSlave._MaidList;
  361. }
  362. //名前指定&呼び出し
  363. if (XtMasterSlave.cfg.boNameSelectAndLoad)
  364. {
  365. //master
  366. int num = -1;
  367. if (!string.IsNullOrEmpty(cfgp.Master_Name))
  368. {
  369. if (!ms.Scc1_MasterMaid)
  370. {
  371. num = XtMasterSlave.SelectOrLoadMan(cfgp.Master_Name);
  372. if (num >= 0)
  373. ms.mdMasters = XtMasterSlave._MensList; //リストが更新された可能性ある
  374. }
  375. else
  376. {
  377. num = XtMasterSlave.SelectOrLoadMaid(cfgp.Master_Name);
  378. if (num >= 0)
  379. ms.mdMasters = XtMasterSlave._MaidList;
  380. }
  381. if (num >= 0)
  382. {
  383. ms.mdMaster_No = num;
  384. //公式撮影の非表示解除
  385. if(ms.mdMasters[ms.mdMaster_No].mem.gameObject.transform.GetChild(0).localScale == Vector3.zero)
  386. ms.mdMasters[ms.mdMaster_No].mem.gameObject.transform.GetChild(0).localScale = Vector3.one;
  387. }
  388. else
  389. {
  390. Console.WriteLine("指定キャラクターが見つかりません。" + (cfgp.doMasterSlave ? "リンク中止:" : ":") + cfgp.Master_Name);
  391. cfgp.doMasterSlave = false;
  392. }
  393. }
  394. //slave
  395. num = -1;
  396. if (!string.IsNullOrEmpty(cfgp.Slave_Name))
  397. {
  398. if (!ms.Scc1_MasterMaid)
  399. {
  400. num = XtMasterSlave.SelectOrLoadMaid(cfgp.Slave_Name);
  401. if (num >= 0)
  402. ms.mdSlaves = XtMasterSlave._MaidList; //リストが更新された可能性ある
  403. }
  404. else
  405. {
  406. num = XtMasterSlave.SelectOrLoadMan(cfgp.Slave_Name);
  407. if (num >= 0)
  408. ms.mdSlaves = XtMasterSlave._MensList;
  409. }
  410. if (num >= 0)
  411. {
  412. ms.mdSlave_No = num;
  413. //公式撮影の非表示解除
  414. if (ms.mdSlaves[ms.mdSlave_No].mem.gameObject.transform.GetChild(0).localScale == Vector3.zero)
  415. ms.mdSlaves[ms.mdSlave_No].mem.gameObject.transform.GetChild(0).localScale = Vector3.one;
  416. }
  417. else
  418. {
  419. Console.WriteLine("指定キャラクターが見つかりません。" + (cfgp.doMasterSlave ? "リンク中止:" : ":") + cfgp.Slave_Name);
  420. cfgp.doMasterSlave = false;
  421. }
  422. }
  423. }
  424. ms.doMasterSlave = false;
  425. ms.maidKeepSlaveYotogi = null;
  426. if (ms.mdMasters.Count > ms.mdMaster_No && ms.mdMaster_No >= 0)
  427. {
  428. Maid master = ms.mdMasters[ms.mdMaster_No].mem;
  429. if (ms.mdSlaves.Count > ms.mdSlave_No && ms.mdSlave_No >= 0)
  430. {
  431. Maid slave = ms.mdSlaves[ms.mdSlave_No].mem;
  432. Maid maid0 = null;
  433. if (!slave.boMAN && ms.mdSlave_No > 0 && ms.mdSlaves[0].mem)
  434. maid0 = ms.mdSlaves[0].mem;
  435. //設定の反映
  436. debugPrintConsole(i + ":設定の反映");
  437. cfgp.ProcParam(master, slave, maid0, cfgs[i]);
  438. //リンク開始
  439. if (master && slave && master.body0 && slave.body0)
  440. {
  441. ms.doMasterSlave = cfgp.doMasterSlave;
  442. //キープスレイブ反映
  443. if (cfgs[i].doKeepSlaveYotogi && !slave.boMAN && XtMasterSlave.IsKeepScene())
  444. ms.maidKeepSlaveYotogi = slave;
  445. //v0031 fix
  446. ms.FixMaster();
  447. ms.FixSlave();
  448. }
  449. }
  450. }
  451. else
  452. {
  453. if (ms.mdSlaves.Count > ms.mdSlave_No && ms.mdSlave_No >= 0)
  454. {
  455. // メイドのみでも設定反映 v0025
  456. Maid slave = ms.mdSlaves[ms.mdSlave_No].mem;
  457. Maid maid0 = null;
  458. if (!slave.boMAN && ms.mdSlave_No > 0 && ms.mdSlaves[0].mem)
  459. maid0 = ms.mdSlaves[0].mem;
  460. //設定の反映
  461. debugPrintConsole(i + ":設定の反映m/o");
  462. cfgp.ProcParam(null, slave, maid0, cfgs[i]);
  463. //v0031 fix
  464. ms.mdMaster_No = -1;
  465. ms.FixMaster();
  466. ms.FixSlave();
  467. }
  468. }
  469. if (ms.mdSlaves.Count > ms.mdSlave_No && ms.mdSlave_No >= 0)
  470. {
  471. Maid slave = ms.mdSlaves[ms.mdSlave_No].mem;
  472. cfgp.ProcParam2(slave, ms);
  473. }
  474. }
  475. //オフセットテーブルの更新
  476. for (int i = 0; i < cfgs.Length; i++)
  477. {
  478. XtMasterSlave.IniCfgsTov3Offsets(ref v3ofs[i], cfgs[i]);
  479. }
  480. }
  481. #if COM3D2
  482. const string dirIni = @"\Config\XtMasterSlave\User_SaveData\"; //UnityInjector
  483. #else
  484. const string dirIni = @"\Config\XtMsterSlave\User_SaveData\"; //UnityInjector
  485. #endif
  486. static string getPlginDir()
  487. {
  488. #if COM3D2
  489. return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  490. #else
  491. {
  492. string fullpath = Path.GetFullPath(".\\");
  493. string plginDirPath = Path.Combine(fullpath, @"Sybaris\Plugins\UnityInjector");
  494. return plginDirPath;
  495. }
  496. #endif
  497. }
  498. //プリセット用INIファイルリスト取得
  499. public static void GetUsersConfigs()
  500. {
  501. try
  502. {
  503. string plginDirPath = getPlginDir();
  504. //ディレクトリがなければ作成
  505. string dir = plginDirPath + Path.GetDirectoryName(dirIni);
  506. if (!System.IO.Directory.Exists(dir))
  507. System.IO.Directory.CreateDirectory(dir);
  508. _UserIniFN.Clear();
  509. HashSet<string> tmpset = new HashSet<string>();
  510. string[] files = Directory.GetFiles(plginDirPath + dirIni, "*.ini");
  511. foreach (string fn in files)
  512. {
  513. //debugPrintConsole(fn);
  514. //GetFilesは.ini?で検索してしまうのでチェックする
  515. if (Path.GetExtension(fn) == ".ini")
  516. {
  517. tmpset.Add(Path.GetFileName(fn));
  518. }
  519. }
  520. _UserIniFN = new List<string>(tmpset.ToArray());
  521. _UserIniFN.Sort();
  522. }
  523. catch (Exception e)
  524. {
  525. Console.WriteLine("GetUsersConfigs例外; " + e);
  526. }
  527. }
  528. //PluginExt用の相対パスに変更
  529. public static string extpath(string inipath)
  530. {
  531. #if COM3D2
  532. return getPlginDir() + @"\Config\XtMasterSlave\User_SaveData\" + System.IO.Path.GetFileName(inipath);
  533. #endif
  534. return @"XtMsterSlave\User_SaveData\" + System.IO.Path.GetFileName(inipath);
  535. }
  536. //プリセット用INIファイル読み書き
  537. public static string LoadIni_Memo(string inifn)
  538. {
  539. //ファイル名
  540. //string fileIni = @"UnityInjector\Config\XtMsterSlave\User_SaveData\" + inifn;
  541. string fileIni = @"User_SaveData\" + inifn;
  542. //bool isExist = false;
  543. try
  544. {
  545. string xfn = extpath(fileIni);
  546. Console.WriteLine("ユーザーセーブini設定読み込み :" + xfn);
  547. var tmpc = PluginExt.SharedConfig.ReadConfig<UserConfigHeader>("Config", xfn);
  548. //isExist = true;
  549. tmpc.Memo = tmpc.Memo.Replace("<改行>", "\r\n");
  550. //tmpc.Memo = tmpc.Memo.Replace("<改行>", "\n");
  551. return tmpc.Memo;
  552. }
  553. catch (Exception e)
  554. {
  555. UnityEngine.Debug.Log("XtMs+INI Error:" + e);
  556. }
  557. return null;
  558. }
  559. public static UserConfig LoadIni_UserCfg(string inifn)
  560. {
  561. //ファイル名
  562. //string fileIni = @"UnityInjector\Config\XtMsterSlave\User_SaveData\" + inifn;
  563. string fileIni = @"User_SaveData\" + inifn;
  564. //bool isExist = false;
  565. try
  566. {
  567. string xfn = extpath(fileIni);
  568. Console.WriteLine("ユーザーセーブini設定読み込み :" + xfn);
  569. UserConfig uc = new UserConfig();
  570. uc.cfg_h = SharedConfig.ReadConfig<UserConfigHeader>("Config", xfn);
  571. uc.cfg_h.Memo = uc.cfg_h.Memo.Replace("<改行>", "\r\n");
  572. //tmpc.Memo = tmpc.Memo.Replace("<改行>", "\n");
  573. for (int i = 0; i<XtMasterSlave.MAX_PAGENUM; i++)
  574. {
  575. uc.cfgs_p[i] = SharedConfig.ReadConfig<UserConfigPage>("Page-" + (i+1).ToString(), xfn);
  576. //debugPrintConsole(uc.cfgs_p[i].Master_Name);
  577. //勝手に取ってくれるっぽい…
  578. //uc.cfgs_p[i].Master_Name = uc.cfgs_p[i].Master_Name._dq();
  579. //uc.cfgs_p[i].Slave_Name = uc.cfgs_p[i].Slave_Name._dq();
  580. }
  581. //isExist = true;
  582. for (int i = 0; i < uc.cfgs_ms.Length; i++)
  583. uc.cfgs_ms[i] = SharedConfig.ReadConfig<XtMasterSlave.MsLinkConfig>("Config-" + (i + 1).ToString(), xfn);
  584. /*
  585. for (int i = 0; i < cfgs.Length; i++)
  586. {
  587. v3ofs[i].v3StackOffset = faTov3(cfgs[i].v3StackOffsetFA);
  588. v3ofs[i].v3StackOffsetRot = faTov3(cfgs[i].v3StackOffsetRotFA);
  589. v3ofs[i].v3HandLOffset = faTov3(cfgs[i].v3HandLOffsetFA);
  590. v3ofs[i].v3HandROffset = faTov3(cfgs[i].v3HandROffsetFA);
  591. }*/
  592. return uc;
  593. }
  594. catch (Exception e)
  595. {
  596. UnityEngine.Debug.Log("XtMs+INI Error:" + e);
  597. }
  598. return null;
  599. }
  600. #if false
  601. public static UserConfig SaveIni_UserCfg(string inifn)
  602. {
  603. //ファイル名
  604. string fileIni = @"UnityInjector\Config\XtMsterSlave\User_SaveData\" + inifn;
  605. //bool isExist = false;
  606. try
  607. {
  608. string xfn = extpath(fileIni);
  609. Console.WriteLine("ユーザーセーブini設定読み込み :" + xfn);
  610. UserConfig uc = new UserConfig();
  611. uc.cfg_h = SharedConfig.ReadConfig<UserConfigHeader>("Config", xfn);
  612. uc.cfg_h.Memo = uc.cfg_h.Memo.Replace("<改行>", "\r\n");
  613. //tmpc.Memo = tmpc.Memo.Replace("<改行>", "\n");
  614. for (int i = 0; i < XtMasterSlave.MAX_PAGENUM; i++)
  615. {
  616. uc.cfgs_p[i] = SharedConfig.ReadConfig<UserConfigPage>("Page-" + (i + 1).ToString(), xfn);
  617. }
  618. for (int i = 0; i < uc.cfgs_ms.Length; i++)
  619. SharedConfig.SaveConfig("Config-" + (i + 1).ToString(), xfn, uc.cfgs_ms[i]);
  620. /*
  621. for (int i = 0; i < cfgs.Length; i++)
  622. {
  623. v3ofs[i].v3StackOffset = faTov3(cfgs[i].v3StackOffsetFA);
  624. v3ofs[i].v3StackOffsetRot = faTov3(cfgs[i].v3StackOffsetRotFA);
  625. v3ofs[i].v3HandLOffset = faTov3(cfgs[i].v3HandLOffsetFA);
  626. v3ofs[i].v3HandROffset = faTov3(cfgs[i].v3HandROffsetFA);
  627. }*/
  628. return uc;
  629. }
  630. catch (Exception e)
  631. {
  632. UnityEngine.Debug.Log("XtMs+INI Error:" + e);
  633. }
  634. return null;
  635. }
  636. #endif
  637. //プリセット用INIファイル読み書き
  638. public static bool SaveIni_UserCfg(string inifn, UserConfig uc)
  639. {
  640. #if COM3D2
  641. string saveDirPath = Path.Combine(getPlginDir(), @"Config\");
  642. //ファイル名
  643. string fileIni = saveDirPath + @"XtMasterSlave\User_SaveData\" + inifn;
  644. #else
  645. string fullpath = Path.GetFullPath(".\\");
  646. string saveDirPath = Path.Combine(fullpath, @"Sybaris\Plugins\UnityInjector\Config\");
  647. //ファイル名
  648. //string fileIni = @"UnityInjector\Config\XtMsterSlave\User_SaveData\" + inifn;
  649. string fileIni = saveDirPath + @"XtMsterSlave\User_SaveData\" + inifn;
  650. #endif
  651. string xfn = extpath(fileIni);
  652. bool isSuccess = false;
  653. string strfn_d = null;
  654. try
  655. {
  656. if (File.Exists(fileIni))
  657. {
  658. var msgo = "上書きしますか?\r\nファイル名: " + inifn;
  659. var reto = NUty.WinMessageBox(NUty.GetWindowHandle(), msgo, "( ! )", NUty.MSGBOX.MB_OKCANCEL | NUty.MSGBOX.MB_ICONQUESTION);
  660. if (reto != (int)System.Windows.Forms.DialogResult.OK)
  661. {
  662. msgo = "保存はキャンセルされました";
  663. NUty.WinMessageBox(NUty.GetWindowHandle(), msgo, "( ! )", NUty.MSGBOX.MB_OK);
  664. return false;
  665. }
  666. else {
  667. strfn_d = fileIni + ".bak";
  668. File.Move(fileIni, strfn_d);
  669. }
  670. }
  671. if (!File.Exists(fileIni))
  672. {
  673. Console.WriteLine("ユーザーセーブini設定書き込み :" + xfn);
  674. uc.cfg_h.Memo = uc.cfg_h.Memo.Replace("\n", "<改行>");
  675. uc.cfg_h.Memo = uc.cfg_h.Memo.Replace("\r", "");
  676. SharedConfig.SaveConfig("Config", xfn, uc.cfg_h);
  677. for (int i = 0; i < XtMasterSlave.MAX_PAGENUM; i++)
  678. {
  679. //前後のスペースがトリムされるようなので""でエスケープする
  680. uc.cfgs_p[i].Master_Name = uc.cfgs_p[i].Master_Name.dq_();
  681. uc.cfgs_p[i].Slave_Name = uc.cfgs_p[i].Slave_Name.dq_();
  682. SharedConfig.SaveConfig("Page-" + (i + 1).ToString(), xfn, uc.cfgs_p[i]);
  683. }
  684. for (int i = 0; i < uc.cfgs_ms.Length; i++)
  685. SharedConfig.SaveConfig("Config-" + (i + 1).ToString(), xfn, uc.cfgs_ms[i]);
  686. }
  687. if (strfn_d != null && File.Exists(strfn_d))
  688. {
  689. File.Delete(strfn_d);
  690. }
  691. }
  692. catch (Exception e)
  693. {
  694. UnityEngine.Debug.Log("api+INI SaveError:" + e);
  695. var msg = "ファイル保存に失敗しました\r\nファイル名:" + inifn + "\r\n" + e.Message;
  696. NUty.WinMessageBox(NUty.GetWindowHandle(), msg, "( ! )", NUty.MSGBOX.MB_OK | NUty.MSGBOX.MB_ICONERROR);
  697. }
  698. return isSuccess;
  699. }
  700. // デバッグ用コンソール出力メソッド
  701. [Conditional("DEBUG")]
  702. private static void debugPrintConsole(string s)
  703. {
  704. Console.WriteLine(s);
  705. }
  706. }
  707. class UserConfig
  708. {
  709. public UserConfigHeader cfg_h = new UserConfigHeader();
  710. public UserConfigPage[] cfgs_p = new UserConfigPage[XtMasterSlave.MAX_PAGENUM];
  711. public XtMasterSlave.MsLinkConfig[] cfgs_ms = new XtMasterSlave.MsLinkConfig[XtMasterSlave.MAX_PAGENUM];
  712. public UserConfig()
  713. {
  714. for (int i = 0; i < cfgs_p.Length; i++)
  715. cfgs_p[i] = new UserConfigPage();
  716. for (int i = 0; i < cfgs_ms.Length; i++)
  717. cfgs_ms[i] = new XtMasterSlave.MsLinkConfig();
  718. }
  719. }
  720. class UserConfigHeader
  721. {
  722. public string Memo = string.Empty;
  723. public int CurPageNum = 0;
  724. }
  725. class UserConfigPage
  726. {
  727. public bool doMasterSlave = false;
  728. public bool isMasterMaid = false;
  729. public string Master_Name = string.Empty;
  730. public int Master_ID = 0;
  731. public bool Master_Hide = false;
  732. public string Slave_Name = string.Empty;
  733. public int Slave_ID = 0;
  734. public float Scale_Master = 1f;
  735. public float Scale_Slave = 1f;
  736. //public float Scale_HitCheck = 1f;
  737. public float manAlpha;
  738. public bool Cnk_Visible = true;
  739. public float Cnk_Scale = 1f;
  740. public float[] Cnk_OffsetPos = new float[3] { 0, 0, 0 };
  741. public bool Stgt_boHeadToCam = false;
  742. public bool Stgt_boEyeToCam = false;
  743. public int Stgt_hashTarget = 0;
  744. public string Stgt_sBoneName = string.Empty;
  745. public string[] Hold_SlaveMaskItems = new string[0];
  746. public UserConfigPage()
  747. {
  748. }
  749. /*public UserConfigPage(bool linking, bool isMasterMaid, XtMasterSlave.ManInfo master, XtMasterSlave.ManInfo slave)
  750. {
  751. SetParam(linking, isMasterMaid, master, slave);
  752. }
  753. public void SetParam(bool linking, bool isMasterMaid, XtMasterSlave.ManInfo master, XtMasterSlave.ManInfo slave)
  754. */
  755. public UserConfigPage(bool linking, bool isMasterMaid, XtMasterSlave.MsLinks ms)
  756. {
  757. SetParam(linking, isMasterMaid, ms);
  758. }
  759. //この保存用クラスに読込
  760. public void SetParam(bool linking, bool isMasterMaid, XtMasterSlave.MsLinks ms)
  761. {
  762. doMasterSlave = linking;
  763. this.isMasterMaid = isMasterMaid;
  764. XtMasterSlave.ManInfo master = null;
  765. XtMasterSlave.ManInfo slave = null;
  766. if (ms.mdMaster_No >= 0)
  767. master = new XtMasterSlave.ManInfo(ms.mdMasters[ms.mdMaster_No].mem, ms.mdMaster_No);
  768. if (ms.mdSlave_No >= 0)
  769. slave = new XtMasterSlave.ManInfo(ms.mdSlaves[ms.mdSlave_No].mem, ms.mdSlave_No);
  770. if (master != null)
  771. {
  772. if (master.mem.boMAN)
  773. Master_Name = XtMasterSlave.GetMaidName(master);
  774. else
  775. Master_Name = XtMasterSlave.GetMaidName(master.mem);
  776. Master_ID = master.mem_id;
  777. }
  778. else
  779. {
  780. Master_Name = string.Empty;
  781. Master_ID = ms.mdMaster_No;
  782. }
  783. if (slave != null)
  784. {
  785. if (slave.mem.boMAN)
  786. Slave_Name = XtMasterSlave.GetMaidName(slave);
  787. else
  788. Slave_Name = XtMasterSlave.GetMaidName(slave.mem);
  789. Slave_ID = slave.mem_id;
  790. }
  791. else
  792. {
  793. Slave_Name = string.Empty;
  794. Slave_ID = ms.mdSlave_No;
  795. }
  796. if (master != null)
  797. Scale_Master = (master.mem.gameObject.transform.localScale.x + master.mem.gameObject.transform.localScale.y + master.mem.gameObject.transform.localScale.z) / 3;
  798. if (slave != null)
  799. Scale_Slave = (slave.mem.gameObject.transform.localScale.x + slave.mem.gameObject.transform.localScale.y + slave.mem.gameObject.transform.localScale.z) / 3;
  800. if (master != null)
  801. {
  802. if (master.mem.boMAN)
  803. {
  804. Master_Hide = !XtMasterSlave.GetManVisible(master.mem);
  805. Cnk_Visible = XtMasterSlave.GetChinkoVisible(master.mem.body0);
  806. Cnk_Scale = XtMasterSlave.GetChinkoScale(master.mem.body0).x;
  807. manAlpha = XtMasterSlave.GetManAlpha(master.mem);
  808. Cnk_OffsetPos = XtMasterSlave.v3Tofa(XtMasterSlave.GetChinkoPos(master.mem.body0));
  809. }
  810. else
  811. {
  812. Master_Hide = XtMasterSlave.GetStateMaskItemsAll(master.mem);
  813. if (slave.mem.boMAN)
  814. {
  815. Cnk_Visible = XtMasterSlave.GetChinkoVisible(slave.mem.body0);
  816. Cnk_Scale = XtMasterSlave.GetChinkoScale(slave.mem.body0).x;
  817. manAlpha = XtMasterSlave.GetManAlpha(slave.mem);
  818. Cnk_OffsetPos = XtMasterSlave.v3Tofa(XtMasterSlave.GetChinkoPos(slave.mem.body0));
  819. }
  820. }
  821. }
  822. if (slave != null)
  823. {
  824. if (!slave.mem.boMAN)
  825. {
  826. Stgt_boHeadToCam = slave.mem.body0.boHeadToCam;
  827. Stgt_boEyeToCam = slave.mem.body0.boEyeToCam;
  828. //Stgt_hashTarget = slave.mem.body0.trsLookTarget.GetHashCode();
  829. Stgt_sBoneName = slave.mem.body0.trsLookTarget.name;
  830. switch (Stgt_sBoneName)
  831. {
  832. case "Bip01 Head":
  833. break;
  834. case "_IK_vagina":
  835. break;
  836. case "ManBip Head":
  837. break;
  838. case "chinko2":
  839. break;
  840. default:
  841. Stgt_sBoneName = string.Empty;
  842. break;
  843. }
  844. }
  845. }
  846. if (slave != null)
  847. {
  848. if (!slave.mem.boMAN)
  849. {
  850. //アイテムマスク
  851. if (ms.holdSlvMask && ms.holdSlvMaskMaid == slave.mem)
  852. Hold_SlaveMaskItems = ms.holdSlvMaskItems.ToArray();
  853. else
  854. Hold_SlaveMaskItems = new string[0];
  855. }
  856. }
  857. }
  858. public void ProcParam(Maid master, Maid slave, Maid maid0, XtMasterSlave.MsLinkConfig p_mscfg)
  859. {
  860. //v0025 masterの不在を許可 if (!master && !master.body0 && !slave && !slave.body0)
  861. if (!slave && !slave.body0)
  862. return;
  863. //サイズ変更
  864. if (master && master.body0)
  865. {
  866. master.gameObject.transform.localScale = new Vector3(Scale_Master, Scale_Master, Scale_Master);
  867. if (!master.boMAN)
  868. XtMasterSlave.UpdateHitScale(master, Scale_Master, p_mscfg);
  869. // XtMasterSlave.UpdateHitScale(master, Scale_Master * p_mscfg.Scale_HitCheckEffect);
  870. }
  871. slave.gameObject.transform.localScale = new Vector3(Scale_Slave, Scale_Slave, Scale_Slave);
  872. if (!slave.boMAN)
  873. XtMasterSlave.UpdateHitScale(slave, Scale_Slave, p_mscfg);
  874. // XtMasterSlave.UpdateHitScale(slave, Scale_Slave * p_mscfg.Scale_HitCheckEffect);
  875. if (master && master.body0)
  876. {
  877. // 男設定 chinkoサイズ・位置など
  878. if (master.boMAN)
  879. {
  880. XtMasterSlave.SetManVisible(master, !Master_Hide);
  881. //master.body0.SetChinkoVisible(Cnk_Visible);
  882. XtMasterSlave.SetChinkoVisible(master.body0, Cnk_Visible); //v0030 fix
  883. if (Cnk_Visible)
  884. {
  885. XtMasterSlave.SetChinkoScale(master.body0, Cnk_Scale);
  886. XtMasterSlave.SetChinkoPos(master.body0, XtMasterSlave.faTov3(Cnk_OffsetPos));
  887. }
  888. XtMasterSlave.SetManAlpha(master, manAlpha);
  889. }
  890. else
  891. {
  892. XtMasterSlave.SetStateMaskItemsAll(master, Master_Hide);
  893. if (slave.boMAN)
  894. {
  895. //slave.body0.SetChinkoVisible(Cnk_Visible);
  896. XtMasterSlave.SetChinkoVisible(master.body0, Cnk_Visible); //v0030 fix
  897. if (Cnk_Visible)
  898. {
  899. XtMasterSlave.SetChinkoScale(slave.body0, Cnk_Scale);
  900. XtMasterSlave.SetChinkoPos(slave.body0, XtMasterSlave.faTov3(Cnk_OffsetPos));
  901. }
  902. XtMasterSlave.SetManAlpha(slave, manAlpha);
  903. }
  904. }
  905. }
  906. #if DEBUG
  907. Console.WriteLine(string.Format("+Stgt_boHeadToCam={0} Stgt_boEyeToCam={1}", Stgt_boHeadToCam, Stgt_boEyeToCam));
  908. #endif
  909. if (!slave.boMAN)
  910. {
  911. #if DEBUG
  912. Console.WriteLine(string.Format("-Stgt_boHeadToCam={0} Stgt_boEyeToCam={1}", Stgt_boHeadToCam, Stgt_boEyeToCam));
  913. #endif
  914. slave.body0.boHeadToCam = Stgt_boHeadToCam;
  915. slave.body0.boEyeToCam = Stgt_boEyeToCam;
  916. Maid tgt = null;
  917. switch (Stgt_sBoneName)
  918. {
  919. case "Bip01 Head":
  920. if (maid0 && maid0.body0 && slave != maid0)
  921. {
  922. tgt = maid0;
  923. }
  924. break;
  925. case "_IK_vagina":
  926. if (maid0 && maid0.body0 && slave != maid0)
  927. {
  928. tgt = maid0;
  929. }
  930. break;
  931. case "ManBip Head":
  932. if (master && master.body0)
  933. {
  934. tgt = master;
  935. }
  936. break;
  937. case "chinko2":
  938. if (master && master.body0)
  939. {
  940. tgt = master;
  941. }
  942. break;
  943. default:
  944. Stgt_sBoneName = string.Empty;
  945. break;
  946. }
  947. if (tgt)
  948. {
  949. Transform tgt_tr = BoneLink.BoneLink.SearchObjName(tgt.body0.m_Bones.transform, Stgt_sBoneName, true);
  950. slave.EyeToTarget(tgt, GameUty.MillisecondToSecond(0), Stgt_sBoneName);
  951. }
  952. else
  953. {
  954. slave.EyeToReset(GameUty.MillisecondToSecond(0));
  955. }
  956. slave.body0.boHeadToCam = Stgt_boHeadToCam;
  957. slave.body0.boEyeToCam = Stgt_boEyeToCam;
  958. }
  959. }
  960. public void ProcParam2(Maid slave, XtMasterSlave.MsLinks ms)
  961. {
  962. if (slave && !slave.boMAN && this.Hold_SlaveMaskItems.Length > 0)
  963. {
  964. //衣装マスク設定あり
  965. ms.holdSlvMask = true;
  966. ms.holdSlvMaskMaid = slave;
  967. ms.holdSlvMaskItems.Clear();
  968. foreach (var s in this.Hold_SlaveMaskItems)
  969. ms.holdSlvMaskItems.Add(s);
  970. }
  971. }
  972. }
  973. static class Extensions
  974. {
  975. public static string dq_(this string str)
  976. {
  977. return @"""" + str + @"""";
  978. }
  979. public static string _dq(this string str)
  980. {
  981. if (str.Length <= 2)
  982. return string.Empty;
  983. return str.Substring(1, str.Length - 2);
  984. }
  985. }
  986. }