Example #1
0
 public ModConfigMenu(IModConsole console, IModData modData, IModBehaviour mod) : base(console)
 {
     _console = console;
     ModData  = modData;
     Mod      = mod;
     _storage = new ModStorage(console, modData.Manifest);
 }
Example #2
0
        private IModHelper CreateModHelper(IModData modData)
        {
            var logger      = new ModLogger(_owmlConfig, modData.Manifest);
            var console     = OutputFactory.CreateOutput(_owmlConfig, _logger, modData.Manifest);
            var assets      = new ModAssets(console, modData.Manifest);
            var storage     = new ModStorage(console, modData.Manifest);
            var events      = new ModEvents(logger, console, _harmonyHelper);
            var interaction = new ModInteraction(_modList, new InterfaceProxyFactory(), modData.Manifest);

            return(new ModHelper.ModHelper(logger, console, _harmonyHelper,
                                           events, assets, storage, _menus, modData.Manifest, modData.Config,
                                           _owmlConfig, interaction));
        }
Example #3
0
        private Type LoadMod(IModData modData)
        {
            if (!modData.Config.Enabled)
            {
                _logger.Log($"{modData.Manifest.UniqueName} is disabled");
                return(null);
            }
            _logger.Log("Loading assembly: " + modData.Manifest.AssemblyPath);
            var assembly = Assembly.LoadFile(modData.Manifest.AssemblyPath);

            _logger.Log($"Loaded {assembly.FullName}");
            try
            {
                return(assembly.GetTypes().FirstOrDefault(x => x.IsSubclassOf(typeof(ModBehaviour))));
            }
            catch (Exception ex)
            {
                _console.WriteLine($"Error while trying to get {typeof(ModBehaviour)}: {ex.Message}");
                return(null);
            }
        }
Example #4
0
        protected override void AddBaseNodes(object Obj)
        {
            // Set default object
            if (CurrentType == null)
            {
                SetCurrentType(new ModDataMtrl().GetType());
                return;
            }
            IModData obj = Obj != null ? (IModData)Obj : new ModDataMtrl();

            // Add nodes
            Childs.Add(new JMXAttribute("UnkFloat01", obj.UnkFloat01));
            Childs.Add(new JMXAttribute("UnkUInt01", obj.UnkUInt01));
            Childs.Add(new JMXAttribute("UnkUInt02", obj.UnkUInt02));
            Childs.Add(new JMXAttribute("UnkUInt03", obj.UnkUInt03));
            Childs.Add(new JMXAttribute("UnkUInt04", obj.UnkUInt04));
            Childs.Add(new JMXAttribute("UnkUInt05", obj.UnkUInt05));
            Childs.Add(new JMXAttribute("UnkByte01", obj.UnkByte01));
            Childs.Add(new JMXAttribute("UnkByte02", obj.UnkByte02));
            Childs.Add(new JMXAttribute("UnkByte03", obj.UnkByte03));
            Childs.Add(new JMXAttribute("UnkByte04", obj.UnkByte04));
        }
Example #5
0
 public void AddMod(IModData modData, IModBehaviour mod)
 {
     _modConfigMenus.Add(new ModConfigMenu(OwmlConsole, modData, mod));
 }
Example #6
0
 public ModConfigMenu(IModConsole console, IModData modData, IModBehaviour mod)
     : base(console, modData.Manifest)
 {
     ModData = modData;
     Mod     = mod;
 }
Example #7
0
        public override object GetClassFrom(JMXStructure Structure)
        {
            IModData data = null;

            // Check abstract formats
            if (CurrentType == typeof(ModDataMtrl))
            {
                data = (ModDataMtrl) new ModDataMtrlVM(string.Empty, new ModDataMtrl()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataTexAni))
            {
                data = (ModDataTexAni) new ModDataTexAniVM(string.Empty, new ModDataTexAni()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataMultiTex))
            {
                data = (ModDataMultiTex) new ModDataMultiTexVM(string.Empty, new ModDataMultiTex()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataMultiTexRev))
            {
                data = (ModDataMultiTexRev) new ModDataMultiTexRevVM(string.Empty, new ModDataMultiTexRev()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataParticle))
            {
                data = (ModDataParticle) new ModDataParticleVM(string.Empty, new ModDataParticle()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataEnvMap))
            {
                data = (ModDataEnvMap) new ModDataEnvMapVM(string.Empty, new ModDataEnvMap()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataBumpEnv))
            {
                data = (ModDataBumpEnv) new ModDataBumpEnvVM(string.Empty, new ModDataBumpEnv()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataSound))
            {
                data = (ModDataSound) new ModDataSoundVM(string.Empty, new ModDataSound()).GetClassFrom(this, 10);
            }
            else if (CurrentType == typeof(ModDataDyVertex))
            {
                data = new ModDataDyVertex();
            }
            else if (CurrentType == typeof(ModDataDyJoint))
            {
                data = new ModDataDyJoint();
            }
            else if (CurrentType == typeof(ModDataDyLattice))
            {
                data = new ModDataDyLattice();
            }
            else if (CurrentType == typeof(ModDataProgEquipPow))
            {
                data = new ModDataProgEquipPow();
            }
            // Set base nodes
            data.UnkFloat01 = (float)((JMXAttribute)Structure.Childs[0]).Value;
            data.UnkUInt01  = (uint)((JMXAttribute)Structure.Childs[1]).Value;
            data.UnkUInt02  = (uint)((JMXAttribute)Structure.Childs[2]).Value;
            data.UnkUInt03  = (uint)((JMXAttribute)Structure.Childs[3]).Value;
            data.UnkUInt04  = (uint)((JMXAttribute)Structure.Childs[4]).Value;
            data.UnkUInt05  = (uint)((JMXAttribute)Structure.Childs[5]).Value;
            data.UnkByte01  = (byte)((JMXAttribute)Structure.Childs[6]).Value;
            data.UnkByte02  = (byte)((JMXAttribute)Structure.Childs[7]).Value;
            data.UnkByte03  = (byte)((JMXAttribute)Structure.Childs[8]).Value;
            data.UnkByte04  = (byte)((JMXAttribute)Structure.Childs[9]).Value;
            // return abstract class
            return(data);
        }