Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CM3D2.AddModsSlider.Plugin.0.0.3.4 : フリーコメント欄の各modパラメータをスライドバーで操作する UnityInjector 用プラグイン
- // 必須ファイル: \CM3D2\UnityInjector\Config\ModsParam.xml
- // (サンプル: http://pastebin.com/wiCL6ETM ) modパラメータ定義xml
- //
- // 機能1.
- // メイドエディット画面中にF5でUI表示トグル。 ( http://i.imgur.com/61U9Xzg.png )
- // コメント欄で操作する数値をスライドバーで調整する事が可能。
- // フリーコメント欄にそのmodの有効な書式が在れば、該当するスライドバーが表示される。
- //
- // 機能2.
- // 夜伽画面中にF5でUI表示トグル。( http://i.imgur.com/CohQ8Io.png )
- // 興奮・精神・理性をスライドバーで調整、または固定する事が可能。
- // また、各ボタン押下で夜伽中のメイドにFaceBlend(頬・涙・よだれの組合せ)とFaceAnime(エロ○○系表情)を適用出来る。
- // ※注意
- // 夜伽ステータスのスライドバーは夜伽コマンド実行画面まではEnabledにしないで下さい。
- // 会話画面やスキル選択画面でEnabledにすると、ロード画面でフリーズします。
- // 更新履歴
- // 0.0.3.4 夜伽時に興奮・精神・理性を変更できるスライドバーを追加。
- // 夜伽時にFaceBlend(頬・涙・よだれの組合せ)とFaceAnime(エロ○○系表情)を選べるボタンを追加。
- // 0.0.2.3 フォントサイズがウィンドウ幅と比例する様に。
- // スクロールバーが滑らかに。
- // ModsParam.xmlの<mod>属性 forced="..." が正常に機能していなかったのを修正。
- // リフレクションがフレーム毎に実行されてたのを修正。(軽量化)
- // 0.0.2.2 ModsParam.xmlの書式を変更。
- // ModsParam.xmlで<mod>の属性に forced="true" 指定で、フリーコメント欄にかかわらずそのmodのスライダーが表示される様に。
- // <value>の属性でtype="scale"指定の時、最小値をスライダーに反映してなかったのを修正。
- // 0.0.1.1 各mod定義をxmlファイルにして読み込む様に。
- // スライダーバーとフリーコメント欄が連動する様に。(改造スレその2>>192)
- // EYEBALL,TEST_EYE_ANGの縦横が逆だったのを修正。
- // 0.0.0.0 初版
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Xml;
- using UnityEngine;
- using UnityInjector.Attributes;
- namespace CM3D2.AddModsSlider.Plugin
- {
- [PluginFilter("CM3D2x64"),
- PluginFilter("CM3D2x86"),
- PluginFilter("CM3D2VRx64"),
- PluginName("CM3D2 AddModsSlider"),
- PluginVersion("0.0.3.4")]
- public class AddModsSlider : UnityInjector.PluginBase
- {
- public const string Version = "0.0.3.4";
- private int sceneLevel;
- private bool visible = false;
- private bool success = true;
- private ModsParam mp;
- private UIInput uiInputFreeComment;
- private YotogiParamBasicBar yotogiParamBasicBar;
- private Vector2 scrollViewVector = Vector2.zero;
- private bool[] fToggleEnabled = new bool[] { false, false };
- private bool[] fTogglePin = new bool[] { false, false, false };
- private bool fToggleYodare = false;
- private float[] fYotogiValue = new float[] { 100f, 100f, 100f};
- private int[] iFaceBlend = new int[] { 0, 0 };
- private string[][] sFaceBlend = new string[2][];
- private string[] sEroFaceAnime = new string[] {"-----","通常1","通常2","通常3"
- ,"興奮0","興奮1","興奮2","興奮3"
- ,"メソ泣き","羞恥1","羞恥2","羞恥3"
- ,"嫌悪1","好感1","好感2","好感3"
- ,"怯え","期待","絶頂","放心"
- ,"我慢1","我慢2","我慢3","舌責"
- ,"痛み1","痛み2","痛み3","舌責快楽"
- ,"痛み我慢2","痛み我慢3","舐め通常","舐め嫌悪"
- ,"フェラ愛情","フェラ快楽","フェラ嫌悪","フェラ通常"
- ,"舐め愛情","舐め愛情2","舐め快楽","舐め快楽2"
- };
- public class ModsParam
- {
- public string DefMatchPattern = @"([-+]?[0-9]*\.?[0-9]+)";
- public string XmlFileName = Directory.GetCurrentDirectory() + @"\UnityInjector\Config\ModsParam.xml";
- public string[] sKey;
- public Dictionary<string, float[]> fValue = new Dictionary<string, float[]>();
- public Dictionary<string, float[]> fVmin = new Dictionary<string, float[]>();
- public Dictionary<string, float[]> fVmax = new Dictionary<string, float[]>();
- public Dictionary<string, string[]> sLabel = new Dictionary<string, string[]>();
- public Dictionary<string, bool[]> bScale = new Dictionary<string, bool[]>();
- public Dictionary<string, string[]> sMatchPattern = new Dictionary<string, string[]>();
- public Dictionary<string, string> sDescription = new Dictionary<string, string>();
- public Dictionary<string, bool> bForced = new Dictionary<string, bool>();
- public Dictionary<string, bool> bEnabled = new Dictionary<string, bool>();
- public int KeyCount { get{return this.sKey.Length; } }
- public int ValCount(string key) { return this.fValue[key].Length; }
- //--------
- public ModsParam()
- {
- this.Init();
- }
- public bool Init()
- {
- if(!loadModsParamXML(this))
- {
- Debug.LogError("AddModsSlider : loadModsParamXML() failed.");
- return false;
- }
- return true;
- }
- private bool loadModsParamXML(ModsParam mp)
- {
- string fn = mp.XmlFileName;
- bool flag = true;
- if (File.Exists(fn))
- {
- XmlDocument doc = new XmlDocument();
- doc.Load(fn);
- XmlNode root = doc.DocumentElement;
- string format = ((XmlElement)root).GetAttribute("format");
- if (format != "1.0")
- {
- flag = false;
- }
- else if (root.HasChildNodes)
- {
- XmlNodeList mod_nodes = ((XmlElement)root).GetElementsByTagName("mod");
- if (mod_nodes.Count > 0)
- {
- mp.sKey = new string[mod_nodes.Count];
- }
- else
- {
- }
- for (int i=0; i<mod_nodes.Count; i++)
- {
- if (!flag) break;
- // modノード
- XmlNode mod_node = mod_nodes[i];
- string key = ((XmlElement)mod_node).GetAttribute("id");
- if (key != "" )
- {
- mp.sKey[i] = key;
- }
- else
- {
- flag = false;
- break;
- }
- // mod属性
- bool f,r;
- mp.sDescription[key] = ((XmlElement)mod_node).GetAttribute("description");
- r = Boolean.TryParse(((XmlElement)mod_node).GetAttribute("forced"), out f);
- mp.bForced[key] = (r) ? f :false;
- r = Boolean.TryParse(((XmlElement)mod_node).GetAttribute("enabled"), out f);
- mp.bEnabled[key] = (r) ? f :false;
- XmlNodeList values = ((XmlElement)mod_node).GetElementsByTagName("value");
- if (values.Count > 0)
- {
- int tmp = values.Count;
- mp.fValue[key] = new float[tmp];
- mp.fVmin[key] = new float[tmp];
- mp.fVmax[key] = new float[tmp];
- mp.sLabel[key] = new string[tmp];
- mp.bScale[key] = new bool[tmp];
- mp.sMatchPattern[key] = new string[tmp];
- }
- else flag = false;
- // valueノード
- for (int j=0; j<values.Count; j++)
- {
- if (!flag) break;
- mp.fValue[key][j] = 0f;
- mp.fVmin[key][j] = 0f;
- mp.fVmax[key][j] = 10f;
- mp.sLabel[key][j] = "";
- mp.bScale[key][j] = false;
- mp.sMatchPattern[key][j] = "";
- XmlNode val_node = values[j];
- int arg_no = -1;
- // value属性
- r = Int32.TryParse(((XmlElement)val_node).GetAttribute("arg_no"), out arg_no);
- arg_no = (r) ? arg_no-1 : -1;
- if (arg_no >= 0)
- {
- r = Single.TryParse(((XmlElement)val_node).GetAttribute("min"), out mp.fVmin[key][arg_no]);
- if(!r) mp.fVmin[key][arg_no] = 0f;
- r = Single.TryParse(((XmlElement)val_node).GetAttribute("max"), out mp.fVmax[key][arg_no]);
- if(!r) mp.fVmax[key][arg_no] = 10f;
- mp.sLabel[key][arg_no] = ((XmlElement)val_node).GetAttribute("label");
- mp.sMatchPattern[key][arg_no] = ((XmlElement)val_node).GetAttribute("match_pattern");
- string sv = ((XmlElement)mod_node).GetAttribute("type");
- switch (sv)
- {
- case "num": mp.bScale[key][arg_no] = false; break;
- case "scale": mp.bScale[key][arg_no] = true; break;
- default : mp.bScale[key][arg_no] = false; break;
- }
- }
- else flag = false;
- }
- }
- }
- }
- else
- {
- Debug.LogError("AddModsSlider : \"" + fn + "\" does not exist.");
- flag = false;
- }
- return flag;
- }
- }
- //--------
- public void Awake()
- {
- GameObject.DontDestroyOnLoad(this);
- this.mp = new ModsParam();
- sFaceBlend[0] = new string[] {"頬0", "頬1", "頬2", "頬3"};
- sFaceBlend[1] = new string[] {"涙0", "涙1", "涙2", "涙3"};
- }
- public void OnLevelWasLoaded(int level)
- {
- sceneLevel = level;
- if (sceneLevel == 5)
- {
- success = this.mp.Init();
- }
- else if (sceneLevel == 14)
- {
- for(int i=0; i<this.fToggleEnabled.Length; i++) this.fToggleEnabled[i] = false;
- for(int i=0; i<this.fTogglePin.Length; i++) this.fTogglePin[i] = false;
- this.fToggleYodare = false;
- }
- }
- public void Update()
- {
- if (sceneLevel == 5 && success) {
- if (Input.GetKeyDown(KeyCode.F5)) visible = !visible;
- if (!this.uiInputFreeComment)
- {
- this.uiInputFreeComment = getUIInputFreeComment();
- }
- }
- else if (sceneLevel == 14) {
- if (Input.GetKeyDown(KeyCode.F5)) visible = !visible;
- if (!this.yotogiParamBasicBar)
- {
- this.yotogiParamBasicBar = getYotogiParamBasicBar();
- }
- }
- else
- {
- if(visible) visible = false;
- }
- }
- public void OnGUI()
- {
- if (!visible) return;
- if (sceneLevel == 5 && success)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- string freeComment = null;
- if (maid == null) return;
- if (maid.Param != null && maid.Param.status != null && maid.Param.status.free_comment != null)
- {
- freeComment = maid.Param.status.free_comment;
- }
- if (freeComment == null) return;
- checkModsEnabled(this.mp, freeComment);
- addModsSlider(this.mp);
- updateFreeComment(maid, this.mp);
- }
- else if (sceneLevel == 14 && this.yotogiParamBasicBar)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- if (maid == null) return;
- addYotogiSlider(maid);
- }
- }
- //--------
- private void checkModsEnabled(ModsParam mp, string freeComment)
- {
- for(int i=0; i<mp.KeyCount; i++)
- {
- string key = mp.sKey[i];
- int val_num = mp.ValCount(key);
- Match match = Regex.Match(freeComment, getMatchPattern(mp, key));
- if (match.Groups.Count > val_num)
- {
- bool tpf = true;
- for(int j=0; j<val_num; j++)
- {
- mp.bEnabled[key] = true;
- tpf &= Single.TryParse(match.Groups[j + 1].Value, out mp.fValue[key][j]);
- }
- if(!tpf) mp.bEnabled[key] = false;
- }
- else mp.bEnabled[key] = false;
- if (mp.bForced[key]) mp.bEnabled[key] = true;
- }
- }
- private void addModsSlider(ModsParam mp)
- {
- int mod_num = mp.KeyCount;
- int margin = fixPx(10);
- int menuHeight = fixPx(45);
- int okButtonHeight = fixPx(95);
- int lineC = fixPx(14);
- int lineH = fixPx(22);
- int lineH2 = fixPx(24);
- int lineH3 = fixPx(30);
- int fontC = fixPx(11);
- int fontH = fixPx(14);
- int fontH2 = fixPx(16);
- int fontH3 = fixPx(20);
- int winTop = margin + menuHeight;
- int winLeft = margin + (int)((Screen.width - margin * 2) * 0.75);
- int winWidth = (int)((Screen.width - margin * 2) * 0.25);
- int winHeight = (int)(Screen.height- winTop - margin - okButtonHeight);
- int conTop = lineH3 + margin * 1;
- int conLeft = margin;
- int conWidth = winWidth - margin * 4 ;
- int conHeight = 0;
- for (int i=0; i<mod_num; i++)
- {
- string key = mp.sKey[i];
- if (!mp.bEnabled[key]) continue;
- int val_num = mp.ValCount(key);
- conHeight += lineH2;
- for (int j=0; j<val_num; j++) conHeight += lineH * 2;
- conHeight += margin * 2;
- }
- Rect outRect = new Rect(winLeft, winTop, winWidth, winHeight);
- GUI.BeginGroup(outRect);
- // 下地のボックス
- GUIStyle bStyle = "box";
- outRect.Set(0, 0, winWidth, winHeight);
- bStyle.fontSize = fontC;
- bStyle.alignment = TextAnchor.UpperRight;
- GUI.Box(outRect, AddModsSlider.Version, bStyle);
- GUIStyle lStyle = "label";
- lStyle.fontSize = fontH3;
- outRect.Set(margin, margin, conWidth, lineH3);
- GUI.Label(outRect, "Mods Slider", lStyle);
- // スクロールビュー
- outRect.Set(0, conTop, winWidth-margin/2, winHeight-conTop-margin);
- scrollViewVector = GUI.BeginScrollView(outRect, scrollViewVector, new Rect (0, 0, conWidth, conHeight));
- // 各modスライダーバー
- outRect.Set(margin, 0, conWidth, lineH2);
- for (int i=0; i<mod_num; i++)
- {
- string key = mp.sKey[i];
- if (!mp.bEnabled[key]) continue;
- int val_num = mp.ValCount(key);
- for (int j=0; j<val_num; j++)
- {
- float value = mp.fValue[key][j];
- float vmin = mp.fVmin[key][j];
- float vmax = mp.fVmax[key][j];
- string label = mp.sLabel[key][j] +" : "+ value.ToString("F");
- bool isScale = mp.bScale[key][j];
- if (j == 0)
- {
- lStyle.fontSize = fontH2;
- outRect.height = lineH2;
- GUI.Label(outRect, key, lStyle);
- outRect.y += outRect.height;
- }
- outRect.height = lineH;
- if (value < vmin) value = vmin;
- if (value > vmax) value = vmax;
- if (isScale && vmin < 1f)
- {
- if (vmin < 0f) vmin = 0f;
- if (value < 0f) value = 0f;
- float tmp = 0;
- float tmpmin = -Mathf.Abs(vmax - 1f);
- float tmpmax = Mathf.Abs(vmax - 1f);
- if (value < 1f)
- {
- tmp = Mathf.Abs((1f-value)/(1f-vmin)) * tmpmin;
- }
- else tmp = value - 1f;
- if(tmp < tmpmin) tmp = tmpmin;
- if(tmp > tmpmax) tmp = tmpmax;
- tmp = drawModValueSlider(outRect, tmp, tmpmin, tmpmax, label, fontH);
- if (tmp < 0f)
- {
- mp.fValue[key][j] = 1f - tmp/tmpmin * Mathf.Abs(1f-vmin);
- }
- else mp.fValue[key][j] = 1f + tmp;
- }
- else mp.fValue[key][j] = drawModValueSlider(outRect, value, vmin, vmax, label, fontH);
- outRect.y += outRect.height * 2;
- }
- outRect.y += margin*2;
- }
- GUI.EndScrollView();
- GUI.EndGroup();
- }
- private void addYotogiSlider(Maid maid)
- {
- int mod_num = 3;
- int margin = fixPx(10);
- int margin2 = fixPx( 5);
- int statusLeft = fixPx(14);
- int statusSHeight = fixPx(20);
- int statusHeight = fixPx(40);
- int statusWidth = fixPx(700);
- int commandWidth = fixPx(200);
- int btnWidth = fixPx(100);
- int btnHeight = fixPx(50);
- int okButtonHeight = fixPx(95);
- int lineC = fixPx(14);
- int lineC2 = fixPx(18);
- int lineH = fixPx(22);
- int lineH2 = fixPx(24);
- int lineH3 = fixPx(30);
- int fontC = fixPx(11);
- int fontC2 = fixPx(12);
- int fontH = fixPx(14);
- int fontH2 = fixPx(16);
- int fontH3 = fixPx(20);
- int winLeft = margin + (int)((Screen.width - margin * 2) * 0.80);
- int winTop = margin + (int)((Screen.height - margin * 2) * 0.32);
- int winWidth = (int)((Screen.width - margin * 2) * 0.18);
- int winHeight = (int)((Screen.height - margin * 2) * 0.68) - okButtonHeight;
- int conLeft = margin;
- int conTop = margin + lineC2;
- int conWidth = winWidth - margin * 2 ;
- int conHeight = winHeight - margin * 2;
- Rect outRect = new Rect(winLeft, winTop, winWidth, winHeight);
- GUI.BeginGroup(outRect);
- // 下地のボックス
- GUIStyle bStyle = "box";
- outRect.Set(0, 0, winWidth, winHeight);
- bStyle.fontSize = fontC;
- bStyle.alignment = TextAnchor.UpperRight;
- GUI.Box(outRect, AddModsSlider.Version, bStyle);
- GUIStyle lStyle = "label";
- lStyle.fontSize = fontH;
- lStyle.alignment = TextAnchor.UpperLeft;
- outRect.Set(margin, margin2, conWidth, lineH);
- GUI.Label(outRect, "Mods Slider", lStyle);
- // 各スライダー・ボタン
- lStyle.fontSize = fontC2;
- outRect.Set(conLeft, conTop, conWidth * 0.35f, lineC2);
- GUI.Label(outRect, "Status : ", lStyle);
- outRect.x += outRect.width;
- GUIStyle tStyle = "toggle";
- tStyle.fontSize = fontC2;
- tStyle.alignment = TextAnchor.MiddleLeft;
- tStyle.normal.textColor = (this.fToggleEnabled[0]) ? Color.white : Color.red;
- tStyle.hover.textColor = (this.fToggleEnabled[0]) ? Color.white : Color.red;
- outRect.width = conWidth * 0.35f;
- this.fToggleEnabled[0] = GUI.Toggle(outRect, this.fToggleEnabled[0], (this.fToggleEnabled[0]) ? "Enabled" : "Disabled", tStyle);
- lStyle.fontSize = fontC2;
- lStyle.alignment = TextAnchor.LowerRight;
- outRect.x = conWidth * 0.9f;
- outRect.width = conWidth * 0.15f;
- GUI.Label(outRect, "固定", lStyle);
- int min,max;
- lStyle.alignment = TextAnchor.LowerLeft;
- outRect.Set(conLeft, conTop + lineC2, conWidth, lineC2);
- for (int i=0; i<mod_num; i++)
- {
- switch(i)
- {
- case 0:
- min = -100;
- max = 300;
- if(!this.fTogglePin[i]) this.fYotogiValue[i] = maid.Param.status.cur_excite;
- outRect.width = conWidth * 0.3f;
- GUI.Label(outRect, "興奮 : "+ this.fYotogiValue[i], lStyle);
- outRect.x += outRect.width;
- outRect.width = conWidth * 0.6f;
- this.fYotogiValue[i] = GUI.HorizontalSlider(outRect, this.fYotogiValue[i], min, max);
- outRect.x += outRect.width;
- outRect.y -= fixPx(5);
- outRect.width = conWidth * 0.1f;
- this.fTogglePin[i] = GUI.Toggle(outRect, this.fTogglePin[i], "");
- outRect.y += fixPx(5);
- if(this.fToggleEnabled[0])
- {
- maid.Param.SetCurExcite((int)this.fYotogiValue[i]);
- this.yotogiParamBasicBar.SetCurrentExcite((int)this.fYotogiValue[i], true);
- }
- break;
- case 1:
- min = 0;
- max = maid.Param.status.mind + maid.Param.status.maid_class_bonus_status.mind;
- if(!this.fTogglePin[i]) this.fYotogiValue[i] = maid.Param.status.cur_mind;
- outRect.width = conWidth * 0.3f;
- GUI.Label(outRect, "精神 : "+ this.fYotogiValue[i], lStyle);
- outRect.x += outRect.width;
- outRect.width = conWidth * 0.6f;
- this.fYotogiValue[i] = GUI.HorizontalSlider(outRect, this.fYotogiValue[i], min, max);
- outRect.x += outRect.width;
- outRect.y -= fixPx(5);
- outRect.width = conWidth * 0.1f;
- this.fTogglePin[i] = GUI.Toggle(outRect, this.fTogglePin[i], "");
- outRect.y += fixPx(5);
- if(this.fToggleEnabled[0])
- {
- maid.Param.SetCurMind((int)this.fYotogiValue[i]);
- this.yotogiParamBasicBar.SetCurrentMind((int)this.fYotogiValue[i], true);
- }
- break;
- case 2:
- min = 0;
- max = maid.Param.status.reason;
- if(!this.fTogglePin[i]) this.fYotogiValue[i] = maid.Param.status.cur_reason;
- outRect.width = conWidth * 0.3f;
- GUI.Label(outRect, "理性 : "+ this.fYotogiValue[i], lStyle);
- outRect.x += outRect.width;
- outRect.width = conWidth * 0.6f;
- this.fYotogiValue[i] = GUI.HorizontalSlider(outRect, this.fYotogiValue[i], min, max);
- outRect.x += outRect.width;
- outRect.y -= fixPx(5);
- outRect.width = conWidth * 0.1f;
- this.fTogglePin[i] = GUI.Toggle(outRect, this.fTogglePin[i], "");
- outRect.y += fixPx(5);
- if(this.fToggleEnabled[0])
- {
- maid.Param.SetCurReason((int)this.fYotogiValue[i]);
- this.yotogiParamBasicBar.SetCurrentReason((int)this.fYotogiValue[i], true);
- }
- break;
- default: break;
- }
- outRect.x = conLeft;
- outRect.y += outRect.height;
- }
- outRect.y += margin2;
- outRect.width = conWidth * 0.35f;
- GUI.Label(outRect, "FaceBlend :", lStyle);
- outRect.x += outRect.width;
- outRect.width = conWidth * 0.35f;
- GUIStyle t1Style = "toggle";
- t1Style.alignment = TextAnchor.MiddleLeft;
- t1Style.normal.textColor = (this.fToggleEnabled[1]) ? Color.white : Color.red;
- t1Style.hover.textColor = (this.fToggleEnabled[1]) ? Color.white : Color.red;
- this.fToggleEnabled[1] = GUI.Toggle(outRect, this.fToggleEnabled[1], (this.fToggleEnabled[1]) ? "Enabled" : "Disabled", t1Style);
- outRect.x += outRect.width;
- outRect.width = conWidth * 0.30f;
- GUIStyle t2Style = "toggle";
- t2Style.alignment = TextAnchor.MiddleLeft;
- t2Style.hover.textColor = (this.fToggleYodare) ? Color.white : Color.white;
- t2Style.normal.textColor = (this.fToggleYodare) ? Color.white : Color.white;
- this.fToggleYodare = GUI.Toggle(outRect, this.fToggleYodare, (this.fToggleYodare) ? "よだれ有" : "よだれ無", t2Style);
- outRect.y += outRect.height;
- string tmp = "";
- GUIStyle btnStyle = "button";
- btnStyle.fontSize = fontC;
- outRect.x = conLeft;
- outRect.width = conWidth;
- for(int i=0; i<iFaceBlend.Length; i++)
- {
- this.iFaceBlend[i] = GUI.SelectionGrid(outRect, this.iFaceBlend[i], sFaceBlend[i], 4, btnStyle);
- tmp += sFaceBlend[i][iFaceBlend[i]];
- outRect.y += outRect.height;
- }
- if(this.fToggleEnabled[1])
- {
- if (this.fToggleYodare) tmp += "よだれ";
- maid.FaceBlend(tmp);
- }
- outRect.y += margin2;
- tStyle.normal.textColor = Color.white;
- outRect.x = conLeft;
- GUI.Label(outRect, "FaceAnime :", lStyle);
- outRect.y += outRect.height;
- outRect.width = conWidth * 0.25f;
- outRect.y += this.drawEroFaceAnimeButton(outRect, maid) * outRect.height;
- GUI.EndGroup();
- }
- private void updateFreeComment(Maid maid, ModsParam mp)
- {
- string freeComment = maid.Param.status.free_comment;
- for(int i=0; i<mp.KeyCount; i++)
- {
- string key = mp.sKey[i];
- int vnum = mp.ValCount(key);
- if (mp.bEnabled[key])
- {
- freeComment = Regex.Replace(freeComment, getMatchPattern(mp, key), "");
- string ws = @"#" + key;
- for(int j=0; j<vnum; j++)
- {
- ws += (j == 0) ? "=" : ",";
- ws += mp.fValue[key][j].ToString("F2");
- }
- ws += "#";
- freeComment += ws;
- }
- }
- if(this.uiInputFreeComment) this.uiInputFreeComment.value = freeComment;
- else maid.Param.SetFreeComment(freeComment);
- }
- //--------
- private float drawModValueSlider(Rect outRect, float value, float min, float max, string label, int fsize)
- {
- GUIStyle lStyle = "label";
- lStyle.fontSize = fsize;
- GUI.Label(outRect, label, lStyle);
- outRect.y += outRect.height;
- value = GUI.HorizontalSlider(outRect, value, min, max);
- return value;
- }
- private int drawEroFaceAnimeButton(Rect outRect, Maid maid)
- {
- int j = 0;
- for(int i = 0; i<this.sEroFaceAnime.Length; i++)
- {
- if(GUI.Button(outRect, this.sEroFaceAnime[i]))
- {
- maid.FaceAnime("エロ" + this.sEroFaceAnime[i], 1f, 0);
- }
- if((i + 1) % 4 == 0)
- {
- outRect.x -= outRect.width*3;
- outRect.y += outRect.height;
- if (j == 4 || j == 7) outRect.y += fixPx(5);
- j++;
- }
- else outRect.x += outRect.width;
- }
- return j;
- }
- private int fixPx(int px)
- {
- float mag = 1f + (Screen.width/1280f - 1f) * 0.6f;
- return (int)(mag * px);
- }
- private string getMatchPattern(ModsParam mp, string key)
- {
- string s = "#" + key;
- int val_num = mp.ValCount(key);
- for(int j=0; j<val_num; j++)
- {
- s += (j==0) ? "=" : ",";
- if(mp.sMatchPattern[key][j] == "")
- {
- s += mp.DefMatchPattern;
- }
- else
- {
- s += mp.sMatchPattern[key][j];
- }
- }
- s += "#";
- return s;
- }
- //--------
- // 改造スレその2 >>192
- private UIInput getUIInputFreeComment()
- {
- BindingFlags bf = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
- ProfileMgr profileMgr = BaseMgr<ProfileMgr>.Instance;
- if (profileMgr == null) return null;
- FieldInfo field_m_profileCtrl = typeof(ProfileMgr).GetField("m_profileCtrl", bf);
- if (field_m_profileCtrl == null) return null;
- ProfileCtrl profileCtrl = (ProfileCtrl)field_m_profileCtrl.GetValue(profileMgr);
- if (profileCtrl == null) return null;
- FieldInfo field_m_inFreeComment = typeof(ProfileCtrl).GetField("m_inFreeComment", bf);
- if (field_m_inFreeComment == null) return null;
- UIInput uiInputFreeComment = (UIInput)field_m_inFreeComment.GetValue(profileCtrl);
- if (uiInputFreeComment == null) return null;
- return uiInputFreeComment;
- }
- private YotogiParamBasicBar getYotogiParamBasicBar()
- {
- YotogiParamBasicBar ypbb = BaseMgr<YotogiParamBasicBar>.Instance;
- if (ypbb == null) return null;
- return ypbb;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement