コード例 #1
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndexes = base.GetUIndexes(game);

            uIndexes.Add((SourceStaticMesh, nameof(SourceStaticMesh)));
            return(uIndexes);
        }
コード例 #2
0
        public Guid LightingGuid; //ME3

        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex uIndex, string)> uIndexes = base.GetUIndexes(game);

            uIndexes.Add((Terrain, nameof(Terrain)));
            return(uIndexes);
        }
コード例 #3
0
            public GameBackup(MEGame game, IEnumerable <GameTarget> availableBackupSources, MainWindow window)
            {
                this.window = window;
                this.Game   = game;
                this.AvailableBackupSources.AddRange(availableBackupSources);
                this.AvailableBackupSources.Add(new GameTarget(Game, M3L.GetString(M3L.string_linkBackupToAnExistingGameCopy), false, true));
                LoadCommands();
                switch (Game)
                {
                case MEGame.ME1:
                    GameTitle      = @"Mass Effect";
                    GameIconSource = @"/images/gameicons/ME1_48.ico";
                    break;

                case MEGame.ME2:
                    GameTitle      = @"Mass Effect 2";
                    GameIconSource = @"/images/gameicons/ME2_48.ico";
                    break;

                case MEGame.ME3:
                    GameTitle      = @"Mass Effect 3";
                    GameIconSource = @"/images/gameicons/ME3_48.ico";
                    break;
                }

                ResetBackupStatus();
            }
コード例 #4
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((Children, "ChildListStart"));
            return(uIndices);
        }
コード例 #5
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((ArraySizeEnum, "ArraySizeEnum"));
            return(uIndices);
        }
コード例 #6
0
            public OIGGame(MEGame game, IEnumerable <GameTarget> targets)
            {
                Game = game;
                Targets.ReplaceAll(targets);
                ToggleDisablerCommand = new GenericCommand(ToggleDisabler, CanToggleDisabler);
                switch (Game)
                {
                case MEGame.ME1:
                    GameTitle      = @"Mass Effect";
                    GameIconSource = @"/images/gameicons/ME1_48.ico";
                    break;

                case MEGame.ME2:
                    GameTitle      = @"Mass Effect 2";
                    GameIconSource = @"/images/gameicons/ME2_48.ico";
                    break;

                case MEGame.ME3:
                    GameTitle      = @"Mass Effect 3";
                    GameIconSource = @"/images/gameicons/ME3_48.ico";
                    break;
                }
                SelectedTarget = Targets.FirstOrDefault();
                if (SelectedTarget == null)
                {
                    D3D9Status = M3L.GetString(M3L.string_noOriginBasedTargetsInstalledForThisGame);
                }
            }
コード例 #7
0
        public List <(UIndex, string)> GetUIndexes(MEGame game, string prefix = "")
        {
            var uIndexes = new List <(UIndex, string)>();

            switch (this)
            {
            case LightMap_1D lightMap_1D:
                uIndexes.Add((lightMap_1D.Owner, $"{prefix}LightMap.Owner"));
                break;

            case LightMap_2D lightMap2D:
                uIndexes.Add((lightMap2D.Texture1, $"{prefix}LightMap.Texture1"));
                uIndexes.Add((lightMap2D.Texture2, $"{prefix}LightMap.Texture2"));
                uIndexes.Add((lightMap2D.Texture3, $"{prefix}LightMap.Texture3"));
                if (game < MEGame.ME3)
                {
                    uIndexes.Add((lightMap2D.Texture4, $"{prefix}LightMap.Texture4"));
                }
                break;

            case LightMap_4or6 lightMap4Or6:
                uIndexes.Add((lightMap4Or6.Texture1, $"{prefix}LightMap.Texture1"));
                uIndexes.Add((lightMap4Or6.Texture2, $"{prefix}LightMap.Texture2"));
                uIndexes.Add((lightMap4Or6.Texture3, $"{prefix}LightMap.Texture3"));
                break;
            }

            return(uIndexes);
        }
コード例 #8
0
 private void TryChangeGameTo(MEGame newgame)
 {
     if (newgame == SelectedGame)
     {
         return;                          //don't care
     }
     if (ModsInGroup.Count > 0 && newgame != SelectedGame)
     {
         var result = M3L.ShowDialog(this, M3L.GetString(M3L.string_dialog_changingGameWillClearGroup), M3L.GetString(M3L.string_changingGameWillClearGroup), MessageBoxButton.YesNo, MessageBoxImage.Warning);
         if (result == MessageBoxResult.Yes)
         {
             ModsInGroup.ClearEx();
             SelectedGame = newgame;
         }
         else
         {
             //reset choice
             SetGameRadioUI(SelectedGame); //reset back
         }
     }
     else
     {
         SelectedGame = newgame;
     }
 }
コード例 #9
0
ファイル: TOCCreator.cs プロジェクト: ME3Tweaks/AutoTOC
        /// <summary>
        /// Creates the binary for a TOC file for a specified directory root
        /// </summary>
        /// <param name="directory">The BIOGame directory of the game.</param>
        /// <param name="game"></param>
        /// <returns>Memorystream of TOC created, null if there are no entries or input was invalid</returns>
        public static MemoryStream CreateBasegameTOCForDirectory(string directory, MEGame game)
        {
            bool isLe2Le3 = game == MEGame.LE2 || game == MEGame.LE3;
            var  files    = GetFiles(directory, isLe2Le3);

            if (game == MEGame.LE1)
            {
                files = GetLE1Files(files, directory);
            }

            if (files.Count > 0)
            {
                // Basegame TOC
                string file0fullpath = files[0];
                int    biogameStrPos = file0fullpath.IndexOf("BIOGame", StringComparison.InvariantCultureIgnoreCase);
                if (game != MEGame.ME3)
                {
                    files.AddRange(GetFiles(Path.Combine(directory.Substring(0, biogameStrPos), "Engine", "Shaders"), isLe2Le3));
                }

                var originalFilesList = files; // Original file paths, to use for getting filesizes after we shorten the paths

                if (biogameStrPos > 0)
                {
                    files = files.Select(x => x.Substring(biogameStrPos)).ToList();
                }

                var entries = originalFilesList.Select((t, i) => (files[i], (int)new FileInfo(t).Length)).ToList();

                return(CreateTOCForEntries(entries));
            }
            throw new Exception("There are no TOCable files in the specified directory.");
        }
コード例 #10
0
        public EmbeddedWEMFile(byte[] WemData, string DisplayString, MEGame game, uint Id = 0)
        {
            this.Id            = Id;
            this.Game          = game;
            this.WemData       = WemData;
            this.DisplayString = DisplayString;


            int size          = BitConverter.ToInt32(WemData, 4);
            int subchunk2size = BitConverter.ToInt32(WemData, 0x5A);

            if (size != WemData.Length - 8)
            {
                OriginalWemData = WemData.TypedClone(); //store copy of the original data in the event the user rewrites a WEM

                //Some clips in ME3 are just the intro to the audio. The raw data is literally cutoff and the first ~.5 seconds are inserted into the soundbank.
                //In order to attempt to even listen to these we have to fix the headers for size and subchunk2size.
                size                = WemData.Length - 8;
                HasBeenFixed        = true;
                this.DisplayString += " - Preloading";
                int offset = 4;
                WemData[offset]     = (byte)size;          // fourth byte
                WemData[offset + 1] = (byte)(size >> 8);   // third byte
                WemData[offset + 2] = (byte)(size >> 16);  // second byte
                WemData[offset + 3] = (byte)(size >> 24);  // last byte

                offset              = 0x5A;                //Subchunk2 size offset
                size                = WemData.Length - 94; //size of data to follow
                WemData[offset]     = (byte)size;          // fourth byte
                WemData[offset + 1] = (byte)(size >> 8);   // third byte
                WemData[offset + 2] = (byte)(size >> 16);  // second byte
                WemData[offset + 3] = (byte)(size >> 24);  // last byte
            }
        }
コード例 #11
0
 public StructProperty ToStructProperty(MEGame game, NameReference?name = null)
 {
     return(new StructProperty(VectorType <T>(), new PropertyCollection
     {
         new ArrayProperty <StructProperty>(Points.Select(p => p.ToStructProperty(game)), "Points"),
     }, name));
 }
コード例 #12
0
        /// <summary>
        ///// Fetches the specified ASI by it's hash for the specified game
        /// </summary>
        /// <param name="asi"></param>
        /// <returns></returns>
        public static ASIModVersion GetASIVersionByHash(string hash, MEGame game)
        {
            List <ASIMod> relevantGroups = null;

            switch (game)
            {
            case MEGame.ME1:
                relevantGroups = MasterME1ASIUpdateGroups;
                break;

            case MEGame.ME2:
                relevantGroups = MasterME2ASIUpdateGroups;
                break;

            case MEGame.ME3:
                relevantGroups = MasterME3ASIUpdateGroups;
                break;

            default:
                return(null);
            }

            if (relevantGroups.Any())
            {
                return(relevantGroups.FirstOrDefault(x => x.HashMatchingHash(hash))?.Versions.First(x => x.Hash == hash));
            }

            return(null);
        }
コード例 #13
0
            public GameRestoreObject(MEGame game, IEnumerable <GameTarget> availableBackupSources, MainWindow window)
            {
                this.window = window;
                this.Game   = game;
                this.AvailableBackupSources.AddRange(availableBackupSources);
                AvailableBackupSources.Add(new GameTarget(Game, M3L.GetString(M3L.string_restoreToCustomLocation), false, true));
                LoadCommands();
                switch (Game)
                {
                case MEGame.ME1:
                    GameTitle      = @"Mass Effect";
                    GameIconSource = @"/images/gameicons/ME1_48.ico";
                    break;

                case MEGame.ME2:
                    GameTitle      = @"Mass Effect 2";
                    GameIconSource = @"/images/gameicons/ME2_48.ico";
                    break;

                case MEGame.ME3:
                    GameTitle      = @"Mass Effect 3";
                    GameIconSource = @"/images/gameicons/ME3_48.ico";
                    break;
                }

                ResetRestoreStatus();
            }
コード例 #14
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.AddRange(LocalFunctionMap.Select((kvp, i) => (kvp.Value, $"LocalFunctions[{i}]")));
            return(uIndices);
        }
コード例 #15
0
ファイル: Texture2D.cs プロジェクト: henbagle/ME3Explorer
 public byte[] GetImageBytesForMip(Texture2DMipInfo info, MEGame game, bool useLowerMipsIfTFCMissing, string gamePathToUse = null, List <string> additionalTFCs = null)
 {
     byte[] imageBytes = null;
     try
     {
         imageBytes = GetTextureData(info, game, gamePathToUse, true, additionalTFCs);
     }
     catch (FileNotFoundException e)
     {
         if (useLowerMipsIfTFCMissing)
         {
             //External archive not found - using built in mips (will be hideous, but better than nothing)
             info = Mips.FirstOrDefault(x => x.storageType == StorageTypes.pccUnc);
             if (info != null)
             {
                 imageBytes = GetTextureData(info, game, gamePathToUse);
             }
         }
         else
         {
             throw e; //rethrow
         }
     }
     if (imageBytes == null)
     {
         throw new Exception(GetLocalizedCouldNotFetchTextureDataMessage(info?.Export.InstancedFullPath, info?.Export.FileRef.FilePath));
     }
     return(imageBytes);
 }
コード例 #16
0
        public List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            var uIndexes = new List <(UIndex, string)>();

            switch (this)
            {
            case LightMap_1D lightMap_1D:
                uIndexes.Add((lightMap_1D.Owner, "LightMap Owner"));
                break;

            case LightMap_2D lightMap2D:
                uIndexes.Add((lightMap2D.Texture1, "LightMap Texture1"));
                uIndexes.Add((lightMap2D.Texture2, "LightMap Texture2"));
                uIndexes.Add((lightMap2D.Texture3, "LightMap Texture3"));
                if (game != MEGame.ME3)
                {
                    uIndexes.Add((lightMap2D.Texture4, "LightMap Texture4"));
                }
                break;

            case LightMap_4or6 lightMap4Or6:
                uIndexes.Add((lightMap4Or6.Texture1, "LightMap Texture1"));
                uIndexes.Add((lightMap4Or6.Texture2, "LightMap Texture2"));
                uIndexes.Add((lightMap4Or6.Texture3, "LightMap Texture3"));
                break;
            }

            return(uIndexes);
        }
コード例 #17
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((Reference2, "2ndReference"));
            return(uIndices);
        }
コード例 #18
0
 public static PropertyInfo GetPropertyInfo(MEGame game, string propname, string typeName)
 {
     bool inStruct = false;
     PropertyInfo p = null;
     switch (game)
     {
         case MEGame.ME1:
             p = ME1UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
             break;
         case MEGame.ME2:
             p = ME2UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
             break;
         case MEGame.ME3:
             p = ME3UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
             break;
     }
     if (p == null)
     {
         inStruct = true;
         switch (game)
         {
             case MEGame.ME1:
                 p = ME1UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
                 break;
             case MEGame.ME2:
                 p = ME2UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
                 break;
             case MEGame.ME3:
                 p = ME3UnrealObjectInfo.getPropertyInfo(typeName, propname, inStruct);
                 break;
         }
     }
     return p;
 }
コード例 #19
0
        public static string GetDefaultKeybindsOverride(MEGame game)
        {
            var path = Utilities.GetKeybindsOverrideFolder();

            if (game == MEGame.ME1)
            {
                return(Path.Combine(path, @"me1-bioinput.ini"));
            }
            if (game == MEGame.ME2)
            {
                return(Path.Combine(path, @"me2-bioinput.ini"));
            }
            if (game == MEGame.ME3)
            {
                return(Path.Combine(path, @"me3-bioinput.xml"));
            }
            if (game == MEGame.LE1)
            {
                return(Path.Combine(path, @"le1-bioinput.ini"));
            }
            if (game == MEGame.LE2)
            {
                return(Path.Combine(path, @"le2-bioinput.ini"));
            }
            if (game == MEGame.LE3)
            {
                return(Path.Combine(path, @"le3-bioinput.xml"));
            }
            return(null);
        }
コード例 #20
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            var uIndexes = new List <(UIndex, string)>();

            uIndexes.Add((Self, nameof(Self)));
            uIndexes.AddRange(Actors.Select((u, i) => (u, $"{nameof(Actors)}[{i}]")));
            uIndexes.Add((Model, nameof(Model)));
            uIndexes.AddRange(ModelComponents.Select((u, i) => (u, $"{nameof(ModelComponents)}[{i}]")));
            uIndexes.AddRange(GameSequences.Select((u, i) => (u, $"{nameof(GameSequences)}[{i}]")));
            uIndexes.AddRange(TextureToInstancesMap.Select((kvp, i) => (kvp.Key, $"{nameof(TextureToInstancesMap)}[{i}]")));
            uIndexes.AddRange(CachedPhysSMDataMap.Select((kvp, i) => (kvp.Key, $"{nameof(CachedPhysSMDataMap)}[{i}]")));
            uIndexes.AddRange(CachedPhysPerTriSMDataMap.Select((kvp, i) => (kvp.Key, $"{nameof(CachedPhysPerTriSMDataMap)}[{i}]")));
            uIndexes.AddRange(ForceStreamTextures.Select((kvp, i) => (kvp.Key, $"{nameof(ForceStreamTextures)}[{i}]")));
            uIndexes.Add((NavListStart, nameof(NavListStart)));
            uIndexes.Add((NavListEnd, nameof(NavListEnd)));
            uIndexes.Add((CoverListStart, nameof(CoverListStart)));
            uIndexes.Add((CoverListEnd, nameof(CoverListEnd)));
            if (game == MEGame.ME3)
            {
                uIndexes.Add((PylonListStart, nameof(PylonListStart)));
                uIndexes.Add((PylonListEnd, nameof(PylonListEnd)));
                uIndexes.AddRange(CoverLinks.Select((u, i) => (u, $"{nameof(CoverLinks)}[{i}]")));
                uIndexes.AddRange(NavPoints.Select((u, i) => (u, $"{nameof(NavPoints)}[{i}]")));
            }
            uIndexes.AddRange(CrossLevelActors.Select((u, i) => (u, $"{nameof(CrossLevelActors)}[{i}]")));
            if (game == MEGame.ME1)
            {
                uIndexes.Add((ArtPlaceable1, nameof(ArtPlaceable1)));
                uIndexes.Add((ArtPlaceable2, nameof(ArtPlaceable2)));
            }

            return(uIndexes);
        }
コード例 #21
0
        /// <summary>
        /// Gets the list of ASI mods by game from the manifest
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        public static List <ASIMod> GetASIModsByGame(MEGame game)
        {
            switch (game)
            {
            case MEGame.ME1:
                return(MasterME1ASIUpdateGroups);

            case MEGame.ME2:
                return(MasterME2ASIUpdateGroups);

            case MEGame.ME3:
                return(MasterME3ASIUpdateGroups);

            case MEGame.LE1:
                return(MasterLE1ASIUpdateGroups);

            case MEGame.LE2:
                return(MasterLE2ASIUpdateGroups);

            case MEGame.LE3:
                return(MasterLE3ASIUpdateGroups);

            default:
                return(null);
            }
        }
コード例 #22
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((Struct, nameof(Struct)));
            return(uIndices);
        }
コード例 #23
0
        public static byte[] ConvertPrePropBinary(ExportEntry export, MEGame newGame)
        {
            if (export.HasStack)
            {
                var   ms        = new MemoryStream(export.Data);
                int   node      = ms.ReadInt32();
                int   stateNode = ms.ReadInt32();
                ulong probeMask = ms.ReadUInt64();
                if (export.Game == MEGame.ME3)
                {
                    ms.SkipInt16();
                }
                else
                {
                    ms.SkipInt32();
                }

                int    count      = ms.ReadInt32();
                byte[] stateStack = ms.ReadToBuffer(count * 12);
                int    offset     = 0;
                if (node != 0)
                {
                    offset = ms.ReadInt32();
                }

                int netIndex = ms.ReadInt32();

                var os = new MemoryStream();
                os.WriteInt32(node);
                os.WriteInt32(stateNode);
                os.WriteUInt64(probeMask);
                if (newGame == MEGame.ME3)
                {
                    os.WriteUInt16(0);
                }
                else
                {
                    os.WriteUInt32(0);
                }
                os.WriteInt32(count);
                os.WriteFromBuffer(stateStack);
                if (node != 0)
                {
                    os.WriteInt32(offset);
                }
                os.WriteInt32(netIndex);

                return(os.ToArray());
            }

            switch (export.ClassName)
            {
            case "DominantSpotLightComponent":
            case "DominantDirectionalLightComponent":
                //todo: do conversion for these
                break;
            }

            return(export.Data.Slice(0, export.GetPropertyStart()));
        }
コード例 #24
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((ElementType, nameof(ElementType)));
            return(uIndices);
        }
コード例 #25
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((ObjectRef, nameof(ObjectRef)));
            return(uIndices);
        }
コード例 #26
0
        public override List <(NameReference, string)> GetNames(MEGame game)
        {
            var names = base.GetNames(game);

            names.Add((FriendlyName, nameof(FriendlyName)));

            return(names);
        }
コード例 #27
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            List <(UIndex, string)> uIndices = base.GetUIndexes(game);

            uIndices.Add((Function, nameof(Function)));
            uIndices.Add((Delegate, nameof(Delegate)));
            return(uIndices);
        }
コード例 #28
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            var uIndexes = new List <(UIndex, string)>();

            uIndexes.AddRange(SM3StaticPermutationResource.GetUIndexes(game));
            uIndexes.AddRange(SM2StaticPermutationResource.GetUIndexes(game));
            return(uIndexes);
        }
コード例 #29
0
        public override List <(NameReference, string)> GetNames(MEGame game)
        {
            var names = base.GetNames(game);

            names.Add((Category, nameof(Category)));

            return(names);
        }
コード例 #30
0
        public override List <(UIndex, string)> GetUIndexes(MEGame game)
        {
            var uIndexes = new List <(UIndex, string)>();

            uIndexes.AddRange(SM3MaterialResource.GetUIndexes(game));
            uIndexes.AddRange(SM2MaterialResource.GetUIndexes(game));
            return(uIndexes);
        }
コード例 #31
0
        public override List <(NameReference, string)> GetNames(MEGame game)
        {
            var names = base.GetNames(game);

            names.AddRange(Names.Select((name, i) => (name, $"Names[{i}]")));

            return(names);
        }
コード例 #32
0
 public static string GetEnumType(MEGame game, string propName, string typeName)
 {
     switch (game)
     {
         case MEGame.ME1:
             return ME1UnrealObjectInfo.getEnumTypefromProp(typeName, propName);
         case MEGame.ME2:
             return ME2UnrealObjectInfo.getEnumTypefromProp(typeName, propName);
         case MEGame.ME3:
             return ME3UnrealObjectInfo.getEnumTypefromProp(typeName, propName);
     }
     return null;
 }
コード例 #33
0
 public static ArrayType GetArrayType(MEGame game, string propName, string typeName)
 {
     switch (game)
     {
         case MEGame.ME1:
             return ME1UnrealObjectInfo.getArrayType(typeName, propName);
         case MEGame.ME2:
             return ME2UnrealObjectInfo.getArrayType(typeName, propName);
         case MEGame.ME3:
             return ME3UnrealObjectInfo.getArrayType(typeName, propName);
     }
     return ArrayType.Int;
 }
コード例 #34
0
 public static string GetProperty(string className, List<string> _extantProps, MEGame game)
 {
     string temp = className;
     List<string> classes = new List<string>();
     Dictionary<string, ClassInfo> classList;
     switch (game)
     {
         case MEGame.ME1:
             classList = ME1Explorer.Unreal.ME1UnrealObjectInfo.Classes;
             break;
         case MEGame.ME2:
             classList = ME2Explorer.Unreal.ME2UnrealObjectInfo.Classes;
             break;
         case MEGame.ME3:
         default:
             classList = ME3UnrealObjectInfo.Classes;
             break;
     }
     while (classList.ContainsKey(temp) && temp != "Object")
     {
         classes.Add(temp);
         temp = classList[temp].baseClass;
     }
     classes.Reverse();
     AddPropertyDialog prompt = new AddPropertyDialog();
     prompt.classList = classList;
     prompt.extantProps = _extantProps;
     prompt.classListBox.DataSource = classes;
     prompt.classListBox.SelectedItem = className;
     if(prompt.ShowDialog() == DialogResult.OK && prompt.propListBox.SelectedIndex != -1)
     {
         return prompt.propListBox.SelectedItem as string;
     }
     else
     {
         return null;
     }
 }