Exemplo n.º 1
0
        public override void Draw(LocalizationObjectItem drawing, LocalizationObjectItem reference = null, params GUILayoutOption[] areaOptions)
        {
            EditableLabel_Auto currentLabel;
            SpriteSelector     currentSelector;

            if (labelDict == null)
            {
                labelDict = new Dictionary <int, EditableLabel_Auto>();
            }
            if (!labelDict.ContainsKey(drawing.GetInstanceID()))
            {
                currentLabel = new EditableLabel_Auto(drawing.SetID);
                labelDict.Add(drawing.GetInstanceID(), currentLabel);
            }
            else
            {
                currentLabel = labelDict[drawing.GetInstanceID()];
            }
            if (!selectorDict.ContainsKey(drawing.GetInstanceID()))
            {
                currentSelector = SpriteSelector.Create_ScaleByWidth();
                selectorDict.Add(drawing.GetInstanceID(), currentSelector);
            }
            else
            {
                currentSelector = selectorDict[drawing.GetInstanceID()];
            }

            if (reference != null && reference.ItemType != drawing.ItemType)
            {
                reference = null;
            }

            GUILayout.BeginVertical(areaOptions);
            drawing.Storage = currentSelector.DrawLayout(drawing.Get <Sprite>() as Sprite, false, areaOptions);
            Rect inputRect = GUILayoutUtility.GetLastRect();

            GUILayout.BeginHorizontal();
            GUILayout.Label("》", GUILayout.Width(10));
            currentLabel.Draw(drawing.ID, true);

            if (reference == null)
            {
                GUI.enabled = false;
            }
            if (GUILayout.Button("✦", GUILayout.Width(20)))
            {
                PopupWindow.Show(inputRect, new SpriteRefPeeker(reference.Get <Sprite>() as Sprite, reference.containerGroup.database.name, inputRect));
            }
            GUI.enabled = true;
            if (GUILayout.Button("X", GUILayout.Width(20)))
            {
                drawing.Destroy();
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
        public override void Draw(LocalizationObjectItem drawing, LocalizationObjectItem reference = null, params GUILayoutOption[] areaOptions)
        {
            EditableLabel_Auto currentLabel;
            AudioClipShowcase  currentShowcase;

            if (labelDict == null)
            {
                labelDict = new Dictionary <int, EditableLabel_Auto>();
            }
            if (!labelDict.ContainsKey(drawing.GetInstanceID()))
            {
                currentLabel = new EditableLabel_Auto(drawing.SetID);
                labelDict.Add(drawing.GetInstanceID(), currentLabel);
            }
            else
            {
                currentLabel = labelDict[drawing.GetInstanceID()];
            }
            if (!showcaseDict.ContainsKey(drawing.GetInstanceID()))
            {
                currentShowcase = new AudioClipShowcase(true, 240);
                showcaseDict.Add(drawing.GetInstanceID(), currentShowcase);
            }
            else
            {
                currentShowcase = showcaseDict[drawing.GetInstanceID()];
            }

            if (reference != null && reference.ItemType != drawing.ItemType)
            {
                reference = null;
            }

            GUILayout.BeginHorizontal(areaOptions);
            GUILayout.Label("》", GUILayout.Width(10));
            currentLabel.Draw_Advanced(drawing.ID, true, null, null, IDLabelFieldLayout, IDLabelFieldLayout);
            drawing.Storage = currentShowcase.DrawLayout(drawing.Get <AudioClip>() as AudioClip);

            Rect inputRect = GUILayoutUtility.GetLastRect();

            if (reference == null)
            {
                GUI.enabled = false;
            }
            if (GUILayout.Button("✦", GUILayout.Width(20)))
            {
                PopupWindow.Show(inputRect, new AudioRefPeeker(reference.Get <AudioClip>() as AudioClip, reference.containerGroup.database.name, inputRect));
            }
            GUI.enabled = true;
            if (GUILayout.Button("X", GUILayout.Width(20)))
            {
                drawing.Destroy();
            }
            GUILayout.EndHorizontal();
        }
Exemplo n.º 3
0
        public override void Draw(LocalizationObjectItem drawing, LocalizationObjectItem reference = null, params GUILayoutOption[] areaOptions)
        {
            EditableLabel_Auto currentLabel;

            if (labelDict == null)
            {
                labelDict = new Dictionary <int, EditableLabel_Auto>();
            }
            if (!labelDict.ContainsKey(drawing.GetInstanceID()))
            {
                currentLabel = new EditableLabel_Auto(drawing.SetID);
                labelDict.Add(drawing.GetInstanceID(), currentLabel);
            }
            else
            {
                currentLabel = labelDict[drawing.GetInstanceID()];
            }

            if (reference != null && reference.ItemType != drawing.ItemType)
            {
                reference = null;
            }

            GUILayout.BeginHorizontal(areaOptions);
            GUILayout.Label("》", IDLabelStyle, GUILayout.Width(10));
            currentLabel.Draw_Advanced(drawing.ID, true, null, null, IDLabelFieldLayout, IDLabelFieldLayout);
            drawing.StoredString = EditorGUILayout.TextArea(drawing.Get <string>() as string, TextAreaStyle, GUILayout.ExpandWidth(true));
            Rect textAreaRect = GUILayoutUtility.GetLastRect();

            if (reference == null)
            {
                GUI.enabled = false;
            }
            if (GUILayout.Button("✦", GUILayout.Width(20)))
            {
                PopupWindow.Show(textAreaRect, new TextRefPeeker(reference.Get <string>() as string,
                                                                 reference.containerGroup.database.name, textAreaRect, RefLabelStyle));
            }
            GUI.enabled = true;
            if (GUILayout.Button("X", GUILayout.Width(20)))
            {
                drawing.Destroy();
            }
            GUILayout.EndHorizontal();
        }