Example #1
0
        // Token: 0x06000374 RID: 884 RVA: 0x0001F2F8 File Offset: 0x0001D4F8
        private void OpenFileBrowser(int matNo1, ACCTexture acctex)
        {
            ACCTexturesView.fileBrowser = new FileBrowser(new Rect(0f, 0f, ACCTexturesView.uiParams.fileBrowserRect.width, ACCTexturesView.uiParams.fileBrowserRect.height), "テクスチャファイル選択", delegate(string path)
            {
                ACCTexturesView.fileBrowser = null;
                if (path == null)
                {
                    return;
                }
                acctex.filepath = (this.textureDir = Path.GetDirectoryName(path));
                string fileName = Path.GetFileName(path);
                if (acctex.editname != fileName)
                {
                    acctex.editname = fileName;
                    acctex.dirty    = true;
                }
                this.ChangeTexFile(this.textureDir, acctex.editname, matNo1, acctex.propName);
            });
            ResourceHolder instance = ResourceHolder.Instance;

            ACCTexturesView.fileBrowser.DirectoryImage    = instance.DirImage;
            ACCTexturesView.fileBrowser.FileImage         = instance.PictImage;
            ACCTexturesView.fileBrowser.NoFileImage       = instance.FileImage;
            ACCTexturesView.fileBrowser.labelStyle        = ACCTexturesView.uiParams.listStyle;
            ACCTexturesView.fileBrowser.SelectionPatterns = new string[]
            {
                "*.tex",
                "*.png"
            };
            if (!string.IsNullOrEmpty(this.textureDir))
            {
                ACCTexturesView.fileBrowser.CurrentDirectory = this.textureDir;
            }
        }
Example #2
0
        private void OpenFileBrowser(int matNo1, ACCTexture acctex)
        {
            fileBrowser = new FileBrowser(
                new Rect(0, 0, uiParams.fileBrowserRect.width, uiParams.fileBrowserRect.height),
                "テクスチャファイル選択",
                path => {
                fileBrowser = null;
                if (path == null)
                {
                    return;
                }

                acctex.filepath = textureDir = Path.GetDirectoryName(path);
                var name        = Path.GetFileName(path);
                if (acctex.editname != name)
                {
                    acctex.editname = name;
                    acctex.dirty    = true;
                }
                ChangeTexFile(textureDir, acctex.editname, matNo1, acctex.propName);
            });
            var resource = ResourceHolder.Instance;

            fileBrowser.DirectoryImage    = resource.DirImage;
            fileBrowser.FileImage         = resource.PictImage;
            fileBrowser.NoFileImage       = resource.FileImage;
            fileBrowser.labelStyle        = uiParams.listStyle;
            fileBrowser.SelectionPatterns = new[] { "*.tex", "*.png" };
            if (!string.IsNullOrEmpty(textureDir))
            {
                fileBrowser.CurrentDirectory = textureDir;
            }
        }
Example #3
0
        // Token: 0x0600036F RID: 879 RVA: 0x0001E744 File Offset: 0x0001C944
        public static List <ACCTexture> Load(Material mate, ShaderType type1)
        {
            if (type1 == null)
            {
                type1 = ShaderType.Resolve(mate.shader.name);
            }
            List <ACCTexture> list = new List <ACCTexture>(type1.texProps.Length);

            list.AddRange(from texProp in type1.texProps
                          select ACCTexture.Create(mate, texProp, type1) into tex
                          where tex != null
                          select tex);
            return(list);
        }
Example #4
0
        public static List <ACCTexture> Load(Material mate, ShaderType type1)
        {
            if (type1 == null)
            {
                type1 = ShaderType.Resolve(mate.shader.name);
            }

            var ret = new List <ACCTexture>(type1.texProps.Length);

            ret.AddRange(
                type1.texProps.Select(texProp => ACCTexture.Create(mate, texProp, type1))
                .Where(tex => tex != null));
            return(ret);
        }
Example #5
0
        public static List <ACCTexture> Load(Material mate, ShaderType type)
        {
            if (type == null)
            {
                type = ShaderType.Resolve(mate.shader.name);
            }

            var ret = new List <ACCTexture>(type.texProps.Length);

            foreach (var texProp in type.texProps)
            {
                var tex = ACCTexture.Create(mate, texProp, type);
                if (tex != null)
                {
                    ret.Add(tex);
                }
            }
            return(ret);
        }
Example #6
0
 // Token: 0x06000371 RID: 881 RVA: 0x0001E8C0 File Offset: 0x0001CAC0
 public void Show()
 {
     GUILayout.BeginVertical(ACCTexturesView.inboxStyle, new GUILayoutOption[0]);
     try
     {
         string text = (this.expand ? "- " : "+ ") + this.material.name;
         if (GUILayout.Button(text, ACCTexturesView.uiParams.lStyleC, new GUILayoutOption[0]))
         {
             this.expand = !this.expand;
         }
         if (this.expand)
         {
             foreach (ACCTexture acctexture in this.edited)
             {
                 bool flag = this.matNo == ACCTexturesView.editTarget.matNo && acctexture.propKey == ACCTexturesView.editTarget.propKey;
                 if (acctexture.prop.Keyword == Keyword.NONE || this.material.IsKeywordEnabled(acctexture.prop.KeywordString))
                 {
                     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                     try
                     {
                         if (!ACCTexturesView.textureModifier.IsValidTarget(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName))
                         {
                             bool enabled = GUI.enabled;
                             GUI.enabled = false;
                             GUILayout.Button("+変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                             {
                                 ACCTexturesView.buttonLWidth
                             });
                             GUI.enabled = enabled;
                         }
                         else if (flag)
                         {
                             if (GUILayout.Button("-変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                             {
                                 ACCTexturesView.buttonLWidth
                             }))
                             {
                                 ACCTexturesView.editTarget.Clear();
                             }
                         }
                         else if (GUILayout.Button("+変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.buttonLWidth
                         }))
                         {
                             ACCTexturesView.editTarget.slotName = ACCTexturesView.holder.CurrentSlot.Name;
                             ACCTexturesView.editTarget.matNo    = this.matNo;
                             ACCTexturesView.editTarget.propName = acctexture.propName;
                             ACCTexturesView.editTarget.propKey  = acctexture.propKey;
                         }
                         GUILayout.Label(acctexture.propName, ACCTexturesView.uiParams.lStyle, new GUILayoutOption[0]);
                         if (flag && acctexture.type.hasShadow && acctexture.propKey == ShaderPropType.MainTex.key && GUILayout.Button("_ShadowTexに反映", ACCTexturesView.uiParams.bStyleSC, new GUILayoutOption[0]))
                         {
                             ACCTexturesView.textureModifier.DuplicateFilter(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName, "_ShadowTex");
                         }
                         if (GUILayout.Button("opt", ACCTexturesView.uiParams.bStyleSC, new GUILayoutOption[]
                         {
                             ACCTexturesView.restWidth
                         }))
                         {
                             acctexture.expand = !acctexture.expand;
                         }
                     }
                     finally
                     {
                         GUILayout.EndHorizontal();
                     }
                     if (flag)
                     {
                         ACCTexturesView.textureModifier.ProcGUI(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName);
                     }
                     float      height     = (float)ACCTexturesView.uiParams.itemHeight;
                     ComboBoxLO comboBoxLO = null;
                     bool       flag2      = false;
                     if (acctexture.toonType != 0)
                     {
                         if (this.combos.TryGetValue(acctexture.propName, out comboBoxLO))
                         {
                             if (comboBoxLO.IsClickedComboButton)
                             {
                                 height = (float)(comboBoxLO.ItemCount * ACCTexturesView.uiParams.itemHeight) * 0.8f;
                             }
                         }
                         else
                         {
                             comboBoxLO = new ComboBoxLO(new GUIContent("選"), ACCTexturesView.ItemNames, ACCTexturesView.uiParams.bStyle, ACCTexturesView.uiParams.boxStyle, ACCTexturesView.uiParams.listStyle, true);
                             comboBoxLO.SetItemWidth(ACCTexturesView.comboWidth);
                             this.combos[acctexture.propName] = comboBoxLO;
                             comboBoxLO.SelectItem(acctexture.editname);
                         }
                     }
                     GUILayout.BeginHorizontal(new GUILayoutOption[]
                     {
                         GUILayout.Height(height)
                     });
                     try
                     {
                         bool   flag3 = false;
                         string text2 = acctexture.editname;
                         if (acctexture.toonType != 0)
                         {
                             int selectedItemIndex = comboBoxLO.SelectedItemIndex;
                             int num = comboBoxLO.Show(ACCTexturesView.uiParams.optBtnWidth);
                             if (num != selectedItemIndex)
                             {
                                 text2 = ACCTexturesView.ItemNames[num].text;
                                 flag2 = true;
                             }
                             flag3 = comboBoxLO.IsClickedComboButton;
                         }
                         else
                         {
                             GUILayout.Label(string.Empty, new GUILayoutOption[]
                             {
                                 ACCTexturesView.uiParams.optBtnWidth
                             });
                         }
                         if (flag3)
                         {
                             ACCTexturesView.uiParams.textStyle.fontSize = (int)((double)ACCTexturesView.fontSizeS * 0.8);
                         }
                         text2 = GUILayout.TextField(text2, ACCTexturesView.uiParams.textStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.contentWidth
                         });
                         acctexture.SetName(text2);
                         if (flag3)
                         {
                             ACCTexturesView.uiParams.textStyle.fontSize = ACCTexturesView.fontSize;
                         }
                         GUI.enabled = acctexture.dirty;
                         if ((ACCTexturesView.settings.toonComboAutoApply && flag2) || GUILayout.Button("適", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.uiParams.optBtnWidth
                         }))
                         {
                             Texture texture = this.ChangeTexFile(this.textureDir, acctexture.editname, this.matNo, acctexture.propName);
                             if (texture != null)
                             {
                                 acctexture.tex = texture;
                             }
                             acctexture.dirty = false;
                         }
                         GUI.enabled = true;
                         if (GUILayout.Button("...", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.uiParams.optBtnWidth
                         }))
                         {
                             this.OpenFileBrowser(this.matNo, acctexture);
                         }
                     }
                     finally
                     {
                         GUILayout.EndHorizontal();
                     }
                     if (acctexture.expand)
                     {
                         GUILayout.BeginVertical(new GUILayoutOption[0]);
                         try
                         {
                             Vector2    textureOffset = this.material.GetTextureOffset(acctexture.prop.propId);
                             ACCTexture tex           = acctexture;
                             if (this.DrawSliders("offset", ref textureOffset, -1f, 1f, () => tex.original.texOffset, false))
                             {
                                 this.material.SetTextureOffset(acctexture.prop.propId, textureOffset);
                             }
                             Vector2 textureScale = this.material.GetTextureScale(acctexture.prop.propId);
                             if (this.DrawSliders("scale ", ref textureScale, 0.001f, 20f, () => tex.original.texScale, true))
                             {
                                 this.material.SetTextureScale(acctexture.prop.propId, textureScale);
                             }
                         }
                         finally
                         {
                             GUILayout.EndVertical();
                         }
                     }
                 }
             }
         }
     }
     finally
     {
         GUILayout.EndVertical();
     }
 }