private SoundFilter(LocString name, params ushort[] blockSounds) { m_Name = name; m_Sounds = blockSounds; }
/// <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); }
private static void LoadEquipment() { LocString.CreateLocStringKeys(typeof(EQUIPMENT.PREFABS), "STRINGS.EQUIPMENT."); GeneratedEquipment.LoadGeneratedEquipment(); }
private static void Prefix() { LocString.CreateLocStringKeys(typeof(PREFABS), "STRINGS.BUILDINGS."); ModUtil.AddBuildingToPlanScreen("Base", ONIBuildingTemplateConfig.ID); }
private SoundFilter( LocString name, params ushort[] blockSounds ) { m_Name = name; m_Sounds = blockSounds; }
/// <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); }
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))); }
internal void OverheadMessage( LocString str ) { OverheadMessage( Language.GetString( str ) ); }
private static void BeforeDbInit() { LocString.CreateLocStringKeys(typeof(ModUpdateDateStrings.UI)); }
private static extern void Internal_create1(GUIVector4Field managedInstance, LocString labelText, int labelWidth, string style);
public override void Load() { LocString.CreateLocStringKeys(typeof(STRINGS.BUILDINGS)); LocString.CreateLocStringKeys(typeof(STRINGS.RESEARCH)); LocString.CreateLocStringKeys(typeof(STRINGS.UI)); }
/// <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; }
private void SetUI(LocString value) { StringTextLabel.Text = value.mString; IDTextBox.Text = value.mLocID.ToString(); StringTextLabel.ForeColor = System.Drawing.Color.Black; }
internal void SendMessage( LocString loc, params object[] args ) { SendMessage( MsgLevel.Info, Language.Format( loc, args ) ); }
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); }
public static string Format( LocString key, params object[] args ) { return String.Format( GetString( key ), args ); }
/// <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); }
public static KeyData Add( HKCategory cat, LocString name, HotKeyCallbackState callback, object state ) { return Add( cat, HKSubCat.None, (int)name, callback, state ); }
private static extern void Internal_create0(GUICurvesField managedInstance, CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style);
private LocMessageFilter( LocString name, MessageType type, int []msgs ) { m_Name = name; m_Nums = msgs; m_Type = type; }
private static extern void Internal_create5(GUICurvesField managedInstance, LocString labelText, string style);
/// <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); }
/// <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); }
/// <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); }
/// <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); }
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); }
private static extern void Internal_create2(GUIColorGradientHDRField managedInstance, LocString labelText, string style);
private static extern void Internal_create2(GUIFloatDistributionField managedInstance, LocString labelText, string style);
/// <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); }
internal void SendMessage( MsgLevel lvl, LocString loc ) { SendMessage( lvl, Language.GetString( loc ) ); }
private static extern void Internal_create2(GUIVector3Field managedInstance, LocString labelText, string style);
internal void SendMessage( LocString loc ) { SendMessage( MsgLevel.Info, Language.GetString( loc ) ); }
/// <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); }
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; }
/// <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); }
internal void OverheadMessage( LocString str, params object[] args ) { OverheadMessage( Language.Format( str, args ) ); }
/// <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); } } } }
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; }
public static void OnLoad() { LocString.CreateLocStringKeys(typeof(global::PipLib.STRINGS.ELEMENTS)); LocString.CreateLocStringKeys(typeof(global::PipLib.STRINGS.RESEARCH)); }
private AsciiMessageFilter( LocString name, MessageType type, string []msgs ) { m_Name = name; m_Strings = msgs; m_Type = type; }
private static extern void Internal_create1(GUIColorDistributionField managedInstance, LocString labelText, int labelWidth, string style);
public MacroMenuItem( LocString name, MacroMenuCallback call, params object[] args ) : base(Language.GetString( name )) { base.Click += new EventHandler( OnMenuClick ); m_Call = call; m_Args = args; }
/// <summary> /// Creates a new empty localized string in the editor string table. /// </summary> public LocEdString() { internalString = new LocString(EDITOR_STRING_TABLE_ID); }