コード例 #1
0
        void DrawVisualPresentation(string logicalKey, string logicalValue)
        {
            Rect  labelPosition;
            Rect  valuePosition;
            float height;

            // Draw the visual representation section
            content.text = LEConstants.VisualPresentation;
            drawHelper.TryGetCachedSize(LEConstants.SizeVisualPresentationKey, content, labelStyle, out size);
            EditorGUI.LabelField(new Rect(drawHelper.CurrentLinePosition, drawHelper.TopOfLine(), size.x, size.y), content, labelStyle);
            drawHelper.NewLine();

            // Key label position
            string visKey = LEStringTableEditor.GetPresentationFromCache(logicalKey);

            labelPosition = GetResizableTextBoxPosition(visKey, boxWidth, keyStyle);

            // Key box
            GUI.Box(labelPosition, string.Empty);

            // Key label
            EditorGUI.SelectableLabel(labelPosition, visKey, keyStyle);
            drawHelper.CurrentLinePosition += (labelPosition.width + 2);

            // Value label position
            string visValue = LEStringTableEditor.GetPresentationFromCache(logicalValue);

            valuePosition = GetResizableTextBoxPosition(visValue, boxWidth, valueStyle);

            // Value box
            GUI.Box(valuePosition, string.Empty);

            // Value label
            EditorGUI.SelectableLabel(valuePosition, visValue, valueStyle);

            height = Math.Max(labelPosition.height, valuePosition.height);
            drawHelper.NewLine(height / drawHelper.LineHeight + .2f);

            content.text = LEConstants.LogicalPresentation;
            drawHelper.TryGetCachedSize(LEConstants.SizeLogicalPresentationKey, content, labelStyle, out size);
            EditorGUI.LabelField(new Rect(drawHelper.CurrentLinePosition, drawHelper.TopOfLine(), size.x, size.y), content, labelStyle);
            drawHelper.NewLine();
        }
コード例 #2
0
        void DrawReadOnlyLocString(LELangDict langDict, KeyValuePair <string, string> locStringEntry)
        {
            // Draw read only loc section
            string visKey   = LEStringTableEditor.GetPresentationFromCache(locStringEntry.Key);
            string visValue = LEStringTableEditor.GetPresentationValue(locStringEntry.Key);

            // Key label position
            Rect labelPosition = GetResizableTextBoxPosition(locStringEntry.Key, boxWidth, keyStyle);

            // Key box
            GUI.Box(labelPosition, string.Empty);

            // Key label
            if (GUI.Button(labelPosition, visKey, keyStyle))
            {
                SetLocStringToEditMode(locStringEntry);
            }
            drawHelper.CurrentLinePosition += labelPosition.width + 2f;

            // Value label position
            Rect valuePosition = GetResizableTextBoxPosition(visValue, boxWidth, valueStyle);

            // Value box
            GUI.Box(valuePosition, string.Empty);

            // Value label
            if (GUI.Button(valuePosition, visValue, valueStyle))
            {
                SetLocStringToEditMode(locStringEntry);
            }
            drawHelper.CurrentLinePosition += valuePosition.width + 2f;

            float height = Math.Max(labelPosition.height, valuePosition.height);

            drawHelper.NewLine(height / drawHelper.LineHeight - 1);
        }