예제 #1
0
        public ChangeInfo SetDisplayName(String newDisplayName)
        {
            if (newDisplayName == null)
            {
                return(ChangeInfo.None);
            }
            if (DisplayName.CompareTo(newDisplayName) == 0)
            {
                return(ChangeInfo.None);
            }

            DisplayName.Clear();
            DisplayName.Append(newDisplayName);
            return(ChangeInfo.DisplayName);
        }
예제 #2
0
        public override bool Init(MyObjectBuilder_ToolbarItem data)
        {
            bool init = base.Init(data);

            ActivateOnClick = false;

            var objectBuilder = data as MyObjectBuilder_ToolbarItemWeapon;

            if (objectBuilder != null)
            {
                m_isDeconstructor = objectBuilder.IsDeconstructor;
                if (m_isDeconstructor)
                {
                    SetDisplayName(DisplayName.Append(" Deconstructor").ToString());
                    var split = Icon.Split(new char[] { '_' });                         // MK: TODO: Change icon properly.
                    SetIcon(split[0] + "_Deconstruction.dds");
                }
            }

            return(init);
        }