コード例 #1
0
 private SoundFilter(LocString name, params ushort[] blockSounds)
 {
     m_Name   = name;
     m_Sounds = blockSounds;
 }
コード例 #2
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="labelWidth">Width of the label in pixels.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUIFloatDistributionField(LocString labelText, int labelWidth, string style = "")
 {
     Internal_create1(this, labelText, labelWidth, style);
 }
コード例 #3
0
 private static void LoadEquipment()
 {
     LocString.CreateLocStringKeys(typeof(EQUIPMENT.PREFABS), "STRINGS.EQUIPMENT.");
     GeneratedEquipment.LoadGeneratedEquipment();
 }
コード例 #4
0
        private static void Prefix()
        {
            LocString.CreateLocStringKeys(typeof(PREFABS), "STRINGS.BUILDINGS.");

            ModUtil.AddBuildingToPlanScreen("Base", ONIBuildingTemplateConfig.ID);
        }
コード例 #5
0
ファイル: SoundFilters.cs プロジェクト: herculesjr/razor
 private SoundFilter( LocString name, params ushort[] blockSounds )
 {
     m_Name = name;
     m_Sounds = blockSounds;
 }
コード例 #6
0
 /// <summary>
 /// Creates a new localized string with the specified identifier in the editor string table. If the identifier
 /// doesn't previously exist in the string table, identifier value will also be used for initializing the default
 /// language version of the string.
 /// </summary>
 /// <param name="identifier">String you can use for later referencing the localized string.</param>
 public LocEdString(string identifier)
 {
     internalString = new LocString(identifier, EDITOR_STRING_TABLE_ID);
 }
コード例 #7
0
 protected new static SkillModifiedValue CreateCalorieValue(float startValue, Type skillType, Type beneficiary, LocString beneficiaryText)
 {
     return(CreateSkillModifiedValue(startValue, calorieMultiplicativeStrategy, skillType, beneficiary, beneficiaryText, Localizer.DoStr("calorie consumption"), typeof(Calorie)));
 }
コード例 #8
0
ファイル: Mobile.cs プロジェクト: WildGenie/Razor
 internal void OverheadMessage( LocString str )
 {
     OverheadMessage( Language.GetString( str ) );
 }
コード例 #9
0
 private static void BeforeDbInit()
 {
     LocString.CreateLocStringKeys(typeof(ModUpdateDateStrings.UI));
 }
コード例 #10
0
 private static extern void Internal_create1(GUIVector4Field managedInstance, LocString labelText, int labelWidth, string style);
コード例 #11
0
 public override void Load()
 {
     LocString.CreateLocStringKeys(typeof(STRINGS.BUILDINGS));
     LocString.CreateLocStringKeys(typeof(STRINGS.RESEARCH));
     LocString.CreateLocStringKeys(typeof(STRINGS.UI));
 }
コード例 #12
0
                /// <summary>
                /// Creates a new rectangle offset GUI.
                /// </summary>
                /// <param name="title">Text to display on the title bar.</param>
                /// <param name="layout">Layout to append the GUI elements to.</param>
                public RectOffsetGUI(LocString title, GUILayout layout)
                {
                    GUILayoutX rectLayout = layout.AddLayoutX();

                    rectLayout.AddElement(new GUILabel(title, GUIOption.FixedWidth(100)));
                    GUILayoutY rectContentLayout = rectLayout.AddLayoutY();

                    GUILayoutX rectTopRow = rectContentLayout.AddLayoutX();
                    GUILayoutX rectBotRow = rectContentLayout.AddLayoutX();

                    offsetLeftField   = new GUIIntField(new LocEdString("Left"), 40);
                    offsetRightField  = new GUIIntField(new LocEdString("Right"), 40);
                    offsetTopField    = new GUIIntField(new LocEdString("Top"), 40);
                    offsetBottomField = new GUIIntField(new LocEdString("Bottom"), 40);

                    rectTopRow.AddElement(offsetLeftField);
                    rectTopRow.AddElement(offsetRightField);
                    rectBotRow.AddElement(offsetTopField);
                    rectBotRow.AddElement(offsetBottomField);

                    offsetLeftField.OnChanged += x =>
                    {
                        offset.left = x;

                        if (OnChanged != null)
                        {
                            OnChanged(offset);
                        }
                    };

                    offsetRightField.OnChanged += x =>
                    {
                        offset.right = x;

                        if (OnChanged != null)
                        {
                            OnChanged(offset);
                        }
                    };

                    offsetTopField.OnChanged += x =>
                    {
                        offset.top = x;

                        if (OnChanged != null)
                        {
                            OnChanged(offset);
                        }
                    };

                    offsetBottomField.OnChanged += x =>
                    {
                        offset.bottom = x;

                        if (OnChanged != null)
                        {
                            OnChanged(offset);
                        }
                    };

                    Action DoOnConfirmed = () =>
                    {
                        if (OnConfirmed != null)
                        {
                            OnConfirmed();
                        }
                    };

                    offsetLeftField.OnConfirmed   += DoOnConfirmed;
                    offsetLeftField.OnFocusLost   += DoOnConfirmed;
                    offsetRightField.OnConfirmed  += DoOnConfirmed;
                    offsetRightField.OnFocusLost  += DoOnConfirmed;
                    offsetTopField.OnConfirmed    += DoOnConfirmed;
                    offsetTopField.OnFocusLost    += DoOnConfirmed;
                    offsetBottomField.OnConfirmed += DoOnConfirmed;
                    offsetBottomField.OnFocusLost += DoOnConfirmed;
                }
コード例 #13
0
 private void SetUI(LocString value)
 {
     StringTextLabel.Text      = value.mString;
     IDTextBox.Text            = value.mLocID.ToString();
     StringTextLabel.ForeColor = System.Drawing.Color.Black;
 }
コード例 #14
0
ファイル: Player.cs プロジェクト: WildGenie/Razor
 internal void SendMessage( LocString loc, params object[] args )
 {
     SendMessage( MsgLevel.Info, Language.Format( loc, args ) );
 }
コード例 #15
0
        protected new static SkillModifiedValue CreateSkillModifiedValue(float startValue, ModificationStrategy strategy, Type skillType, Type beneficiary, LocString beneficiaryText, LocString benefitText, Type modifierType)
        {
            SkillModifiedValue value = new SkillModifiedValue(startValue, strategy, skillType, benefitText, modifierType);

            SkillModifiedValueManager.AddBenefitForObject(beneficiary, beneficiaryText, value);
            SkillModifiedValueManager.AddSkillBenefit(beneficiary, beneficiaryText, value);
            return(value);
        }
コード例 #16
0
ファイル: Languages.cs プロジェクト: herculesjr/razor
 public static string Format( LocString key, params object[] args )
 {
     return String.Format( GetString( key ), args );
 }
コード例 #17
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUICurvesField(LocString labelText, string style = "")
 {
     Internal_create5(this, labelText, style);
 }
コード例 #18
0
ファイル: HotKeys.cs プロジェクト: herculesjr/razor
 public static KeyData Add( HKCategory cat, LocString name, HotKeyCallbackState callback, object state )
 {
     return Add( cat, HKSubCat.None, (int)name, callback, state );
 }
コード例 #19
0
 private static extern void Internal_create0(GUICurvesField managedInstance, CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style);
コード例 #20
0
ファイル: MessageFilter.cs プロジェクト: herculesjr/razor
 private LocMessageFilter( LocString name, MessageType type, int []msgs )
 {
     m_Name = name;
     m_Nums = msgs;
     m_Type = type;
 }
コード例 #21
0
 private static extern void Internal_create5(GUICurvesField managedInstance, LocString labelText, string style);
コード例 #22
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUIColorDistributionField(LocString labelText, string style = "")
 {
     Internal_create2(this, labelText, style);
 }
コード例 #23
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="drawOptions">Options that control which additional curve elements to draw.</param>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="labelWidth">Width of the label in pixels.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUICurvesField(CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style = "")
 {
     Internal_create0(this, drawOptions, labelText, labelWidth, style);
 }
コード例 #24
0
            /// <summary>
            /// Builds the inspectable dictionary GUI elements. Must be called at least once in order for the contents to
            /// be populated.
            /// </summary>
            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
            /// <param name="title">Label to display on the list GUI title.</param>
            /// <param name="path">Full path to this property (includes name of this property and all parent properties).
            /// </param>
            /// <param name="property">Serializable property referencing a dictionary</param>
            /// <param name="layout">Layout to which to append the list GUI elements to.</param>
            /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
            ///                     nested containers whose backgrounds are overlaping. Also determines background style,
            ///                     depths divisible by two will use an alternate style.</param>
            public static InspectableDictionaryGUI Create(InspectableContext context, LocString title, string path,
                                                          SerializableProperty property, GUILayout layout, int depth = 0)
            {
                InspectableDictionaryGUI guiDictionary = new InspectableDictionaryGUI(context, title, path, property,
                                                                                      layout, depth);

                guiDictionary.BuildGUI();

                return(guiDictionary);
            }
コード例 #25
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="labelWidth">Width of the label in pixels.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUICurvesField(LocString labelText, uint labelWidth, string style = "")
 {
     Internal_create4(this, labelText, labelWidth, style);
 }
コード例 #26
0
    private static SkillModifiedValue CreateSmv(float startValue, ModificationStrategy strategy, Type skillType, LocString benefitsDescription)
    {
        SkillModifiedValue smv = new SkillModifiedValue(startValue, strategy, skillType, benefitsDescription);

        SkillModifiedValueManager.AddSkillBenefit(Localizer.DoStr("You"), smv);
        return(smv);
    }
コード例 #27
0
 private static extern void Internal_create2(GUIColorGradientHDRField managedInstance, LocString labelText, string style);
コード例 #28
0
 private static extern void Internal_create2(GUIFloatDistributionField managedInstance, LocString labelText, string style);
コード例 #29
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUIColorGradientHDRField(LocString labelText, string style = "")
 {
     Internal_create2(this, labelText, style);
 }
コード例 #30
0
ファイル: Player.cs プロジェクト: WildGenie/Razor
 internal void SendMessage( MsgLevel lvl, LocString loc )
 {
     SendMessage( lvl, Language.GetString( loc ) );
 }
コード例 #31
0
 private static extern void Internal_create2(GUIVector3Field managedInstance, LocString labelText, string style);
コード例 #32
0
ファイル: Player.cs プロジェクト: WildGenie/Razor
 internal void SendMessage( LocString loc )
 {
     SendMessage( MsgLevel.Info, Language.GetString( loc ) );
 }
コード例 #33
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="labelWidth">Width of the label in pixels.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUIVector3Field(LocString labelText, int labelWidth, string style = "")
 {
     Internal_create1(this, labelText, labelWidth, style);
 }
コード例 #34
0
ファイル: Languages.cs プロジェクト: herculesjr/razor
 public static string GetString( LocString key )
 {
     string value = m_Strings[key] as string;
     if ( value == null )
         value = String.Format( "LanguageString \"{0}\" not found!", key );//throw new MissingFieldException( String.Format( "Razor requested Language Pack string '{0}', but it does not exist in the current language pack.", key ) );
     return value;
 }
コード例 #35
0
 /// <summary>Creates a new GUI editor field with a label.</summary>
 /// <param name="labelText">String to display in the editor field label.</param>
 /// <param name="style">
 /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
 /// If not specified default style is used.
 /// </param>
 public GUIVector3Field(LocString labelText, string style = "")
 {
     Internal_create2(this, labelText, style);
 }
コード例 #36
0
ファイル: Mobile.cs プロジェクト: WildGenie/Razor
 internal void OverheadMessage( LocString str, params object[] args )
 {
     OverheadMessage( Language.Format( str, args	) );
 }
コード例 #37
0
        /// <summary>
        /// Recreates all the GUI elements used by this inspector.
        /// </summary>
        private void BuildGUI()
        {
            Layout.Clear();

            Animation animation = InspectedObject as Animation;

            if (animation == null)
            {
                return;
            }

            animationClipField.OnChanged += x =>
            {
                AnimationClip clip = Resources.Load <AnimationClip>(x.UUID);

                animation.DefaultClip = clip;
                MarkAsModified();
                ConfirmModify();
            };

            wrapModeField.OnSelectionChanged += x =>
            {
                animation.WrapMode = (AnimWrapMode)x;
                MarkAsModified();
                ConfirmModify();
            };

            speedField.OnChanged   += x => { animation.Speed = x; MarkAsModified(); };
            speedField.OnConfirmed += ConfirmModify;
            speedField.OnFocusLost += ConfirmModify;

            cullingField.OnChanged        += x => { animation.Cull = x; MarkAsModified(); ConfirmModify(); };
            overrideBoundsField.OnChanged += x => { animation.UseBounds = x; MarkAsModified(); ConfirmModify(); };
            centerField.OnChanged         += x =>
            {
                AABox   bounds = animation.Bounds;
                Vector3 min    = x - bounds.Size * 0.5f;
                Vector3 max    = x + bounds.Size * 0.5f;

                animation.Bounds = new AABox(min, max);
                MarkAsModified();
            };
            centerField.OnConfirmed += ConfirmModify;
            centerField.OnFocusLost += ConfirmModify;

            sizeField.OnChanged += x =>
            {
                AABox   bounds = animation.Bounds;
                Vector3 min    = bounds.Center - x * 0.5f;
                Vector3 max    = bounds.Center + x * 0.5f;

                animation.Bounds = new AABox(min, max);
                MarkAsModified();
            };
            sizeField.OnConfirmed += ConfirmModify;
            sizeField.OnFocusLost += ConfirmModify;

            Layout.AddElement(animationClipField);
            Layout.AddElement(wrapModeField);
            Layout.AddElement(speedField);
            Layout.AddElement(cullingField);
            Layout.AddElement(overrideBoundsField);

            GUILayoutX boundsLayout = Layout.AddLayoutX();

            boundsLayout.AddElement(new GUILabel(new LocEdString("Bounds"), GUIOption.FixedWidth(100)));

            GUILayoutY boundsContent = boundsLayout.AddLayoutY();

            boundsContent.AddElement(centerField);
            boundsContent.AddElement(sizeField);

            // Morph shapes
            Renderable  renderable  = animation.SceneObject.GetComponent <Renderable>();
            MorphShapes morphShapes = renderable?.Mesh?.MorphShapes;

            if (morphShapes != null)
            {
                GUIToggle morphShapesToggle = new GUIToggle(new LocEdString("Morph shapes"), EditorStyles.Foldout);

                Layout.AddElement(morphShapesToggle);
                GUILayoutY channelsLayout = Layout.AddLayoutY();

                morphShapesToggle.OnToggled += x =>
                {
                    channelsLayout.Active = x;
                    Persistent.SetBool("Channels_Expanded", x);
                };

                channelsLayout.Active = Persistent.GetBool("Channels_Expanded");

                MorphChannel[] channels = morphShapes.Channels;
                for (int i = 0; i < channels.Length; i++)
                {
                    GUILayoutY channelLayout = channelsLayout.AddLayoutY();

                    GUILayoutX channelTitleLayout = channelLayout.AddLayoutX();
                    channelLayout.AddSpace(5);
                    GUILayoutY channelContentLayout = channelLayout.AddLayoutY();

                    string    channelName      = channels[i].Name;
                    GUIToggle channelNameField = new GUIToggle(channelName, EditorStyles.Expand, GUIOption.FlexibleWidth());

                    channelTitleLayout.AddSpace(15); // Indent
                    channelTitleLayout.AddElement(channelNameField);
                    channelTitleLayout.AddFlexibleSpace();

                    channelNameField.OnToggled += x =>
                    {
                        channelContentLayout.Active = x;

                        Persistent.SetBool(channelName + "_Expanded", x);
                    };

                    channelContentLayout.Active = Persistent.GetBool(channelName + "_Expanded");

                    MorphShape[] shapes = channels[i].Shapes;
                    for (int j = 0; j < shapes.Length; j++)
                    {
                        GUILayoutX shapeLayout = channelContentLayout.AddLayoutX();
                        channelContentLayout.AddSpace(5);

                        LocString nameString = new LocString("[{0}]. {1}");
                        nameString.SetParameter(0, j.ToString());
                        nameString.SetParameter(1, shapes[j].Name);
                        GUILabel shapeNameField = new GUILabel(shapes[j].Name);

                        LocString weightString = new LocEdString("Weight: {0}");
                        weightString.SetParameter(0, shapes[j].Weight.ToString());
                        GUILabel weightField = new GUILabel(weightString);

                        shapeLayout.AddSpace(30); // Indent
                        shapeLayout.AddElement(shapeNameField);
                        shapeLayout.AddFlexibleSpace();
                        shapeLayout.AddElement(weightField);
                    }
                }
            }
        }
コード例 #38
0
ファイル: HotKeys.cs プロジェクト: herculesjr/razor
 public static KeyData Add( HKCategory cat, HKSubCat sub, LocString name, HotKeyCallbackState callback, object state )
 {
     KeyData kd = new KeyData( (int)name, cat, sub, callback, state );
     m_List.Add( kd );
     return kd;
 }
コード例 #39
0
ファイル: PipLib.cs プロジェクト: CynicalBusiness/PipLib
 public static void OnLoad()
 {
     LocString.CreateLocStringKeys(typeof(global::PipLib.STRINGS.ELEMENTS));
     LocString.CreateLocStringKeys(typeof(global::PipLib.STRINGS.RESEARCH));
 }
コード例 #40
0
ファイル: MessageFilter.cs プロジェクト: herculesjr/razor
 private AsciiMessageFilter( LocString name, MessageType type, string []msgs )
 {
     m_Name = name;
     m_Strings = msgs;
     m_Type = type;
 }
コード例 #41
0
 private static extern void Internal_create1(GUIColorDistributionField managedInstance, LocString labelText, int labelWidth, string style);
コード例 #42
0
ファイル: Actions.cs プロジェクト: WildGenie/Razor
 public MacroMenuItem( LocString name, MacroMenuCallback call, params object[] args )
     : base(Language.GetString( name ))
 {
     base.Click += new EventHandler( OnMenuClick );
     m_Call = call;
     m_Args = args;
 }
コード例 #43
0
 /// <summary>
 /// Creates a new empty localized string in the editor string table.
 /// </summary>
 public LocEdString()
 {
     internalString = new LocString(EDITOR_STRING_TABLE_ID);
 }