Ignore:
Timestamp:
Jan 14, 2013, 6:49:25 PM (12 years ago)
Author:
alloc
Message:

AEI2:

  • Added BSL handling to installation
  • Updated config-terms for dependencies/incompatibilities
  • Fixed mod counts for types
  • Open Edition folder through menu
  • Open folder of already downloaded mod through context menu
  • (Semi?)Fixed launching Oni on MacOS
  • Settings: Added checkbox for update notification
Location:
AE/installer2/src/net/oni2/aeinstaller/backend/mods
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • AE/installer2/src/net/oni2/aeinstaller/backend/mods/EBSLInstallType.java

    r600 r608  
    55 */
    66public enum EBSLInstallType {
    7         /**
    8          * No BSL files
    9          */
    10         NONE,
    117        /**
    128         * Normal BSL install mode
  • AE/installer2/src/net/oni2/aeinstaller/backend/mods/Mod.java

    r604 r608  
    2929        private String version = "";
    3030        private String creator = "";
    31         private EBSLInstallType bslInstallType = null;
     31        private EBSLInstallType bslInstallType = EBSLInstallType.NORMAL;
    3232        private String description = "";
    3333        private double aeVersion = 0;
     
    3636        private net.oni2.aeinstaller.backend.depot.model.File file = null;
    3737
    38         private HashSet<Integer> conflicts = new HashSet<Integer>();
     38        private HashSet<Integer> incompatibilities = new HashSet<Integer>();
    3939        private HashSet<Integer> dependencies = new HashSet<Integer>();
    4040
     
    5151                name = nm.getTitle();
    5252                packageNumber = nm.getPackageNumber();
     53                platform = nm.getPlatform();
    5354                for (TaxonomyTerm tt : nm.getTypes()) {
    5455                        Type t = ModManager.getInstance().getTypeByName(tt.getName());
    5556                        types.add(t);
    56                         if (!nm.isTool())
     57                        if (!nm.isTool() && isValidOnPlatform())
    5758                                t.addEntry(this);
    5859                }
    59                 platform = nm.getPlatform();
    6060                version = nm.getVersion();
    6161                creator = nm.getCreator();
     
    101101                                                if (sVal.equalsIgnoreCase("addon"))
    102102                                                        bslInstallType = EBSLInstallType.ADDON;
    103                                                 else if (sVal.equalsIgnoreCase("yes"))
    104                                                         bslInstallType = EBSLInstallType.NORMAL;
    105                                                 else
    106                                                         bslInstallType = EBSLInstallType.NONE;
    107103                                        } else if (sName.equalsIgnoreCase("ModVersion")) {
    108104                                                if (node == null)
     
    111107                                                if (node == null)
    112108                                                        description = sVal.replaceAll("\\\\n", "<br>");
    113                                         } else if (sName.equalsIgnoreCase("Depends")) {
     109                                        } else if (sName.equalsIgnoreCase("DependsOn")) {
    114110                                                String[] depsS = sVal.split(",");
    115111                                                for (String s : depsS) {
     
    123119                                                        }
    124120                                                }
    125                                         } else if (sName.equalsIgnoreCase("Conflicts")) {
     121                                        } else if (sName.equalsIgnoreCase("IncompatibleWith")) {
    126122                                                String[] confS = sVal.split(",");
    127123                                                for (String s : confS) {
    128124                                                        try {
    129125                                                                int conf = Integer.parseInt(s);
    130                                                                 conflicts.add(conf);
     126                                                                incompatibilities.add(conf);
    131127                                                        } catch (NumberFormatException e) {
    132128                                                                System.err
    133                                                                                 .format("Mod %05d does contain a non-number dependency: '%s'\n",
     129                                                                                .format("Mod %05d does contain a non-number incompatibility: '%s'\n",
    134130                                                                                                packageNumber, s);
    135131                                                        }
     
    182178                updateLocalData();
    183179
    184                 Type t = ModManager.getInstance().getTypeByName("-Local-");
    185                 types.add(t);
    186                 t.addEntry(this);
    187 
    188180                platform = ECompatiblePlatform.BOTH;
    189181        }
     
    323315
    324316        /**
    325          * @return the conflicts
    326          */
    327         public HashSet<Integer> getConflicts() {
    328                 return conflicts;
     317         * @return the incompabitilities
     318         */
     319        public HashSet<Integer> getIncompabitilities() {
     320                return incompatibilities;
    329321        }
    330322
     
    339331         * @return Is this mod valid on the running platform?
    340332         */
    341         public boolean validOnPlatform() {
    342                 ECompatiblePlatform plat = platform;
    343                 switch (plat) {
     333        public boolean isValidOnPlatform() {
     334                switch (platform) {
    344335                        case BOTH:
    345336                                return true;
  • AE/installer2/src/net/oni2/aeinstaller/backend/mods/ModManager.java

    r604 r608  
    4343                Vector<Integer> res = new Vector<Integer>();
    4444                try {
    45                         FileInputStream fis = new FileInputStream(f);
    46                         XStream xs = new XStream(new StaxDriver());
    47                         Object obj = xs.fromXML(fis);
    48                         if (obj instanceof Vector<?>)
    49                                 res = (Vector<Integer>) obj;
    50                         fis.close();
     45                        if (f.exists()) {
     46                                FileInputStream fis = new FileInputStream(f);
     47                                XStream xs = new XStream(new StaxDriver());
     48                                Object obj = xs.fromXML(fis);
     49                                if (obj instanceof Vector<?>)
     50                                        res = (Vector<Integer>) obj;
     51                                fis.close();
     52                        }
    5153                } catch (FileNotFoundException e) {
    5254                        e.printStackTrace();
     
    8789                mods = new HashMap<Integer, Mod>();
    8890
    89                 types.put("-Local-", new Type("-Local-", null));
     91                Type localType = new Type("-Local-", null);
     92                types.put("-Local-", localType);
    9093
    9194                for (TaxonomyTerm tt : DepotManager.getInstance()
     
    120123
    121124                for (Mod m : modFolders.values()) {
     125                        if (!m.isMandatoryMod()) {
     126                                localType.addEntry(m);
     127                                m.getTypes().add(localType);
     128                        }
    122129                        mods.put(m.getPackageNumber(), m);
    123130                }
     
    152159
    153160        /**
    154          * @return Collection of mods
    155          */
    156         public Collection<Mod> getMods() {
    157                 return mods.values();
    158         }
    159 
    160         /**
    161          * @return Mods which are always installed
     161         * @return Collection of mods valid on this platform and not mandatory
     162         */
     163        public Collection<Mod> getModsValidAndNotMandatory() {
     164                Vector<Mod> res = new Vector<Mod>();
     165                for (Mod m : mods.values())
     166                        if (m.isValidOnPlatform() && !m.isMandatoryMod())
     167                                res.add(m);
     168                return res;
     169        }
     170
     171        /**
     172         * @return Mods which are always installed and valid on this platform
    162173         */
    163174        public TreeSet<Mod> getMandatoryMods() {
    164175                TreeSet<Mod> res = new TreeSet<Mod>();
    165176                for (Mod m : mods.values()) {
    166                         if (m.isMandatoryMod())
    167                                 res.add(m);
    168                 }
    169                 return res;
    170         }
    171 
    172         /**
    173          * @return Collection of tools
     177                        if (m.isValidOnPlatform() && m.isMandatoryMod())
     178                                res.add(m);
     179                }
     180                return res;
     181        }
     182
     183        /**
     184         * @return Collection of tools valid on this platform and not mandatory
    174185         */
    175186        public Collection<Mod> getTools() {
    176                 return tools.values();
    177         }
    178 
    179         /**
    180          * @return Tools which are always installed
     187                Vector<Mod> res = new Vector<Mod>();
     188                for (Mod m : tools.values())
     189                        if (m.isValidOnPlatform() && !m.isMandatoryMod())
     190                                res.add(m);
     191                return res;
     192        }
     193
     194        /**
     195         * @return Tools which are always installed and valid on this platform
    181196         */
    182197        public TreeSet<Mod> getMandatoryTools() {
    183198                TreeSet<Mod> res = new TreeSet<Mod>();
    184199                for (Mod m : tools.values()) {
    185                         if (m.isMandatoryMod())
     200                        if (m.isValidOnPlatform() && m.isMandatoryMod())
    186201                                res.add(m);
    187202                }
     
    230245
    231246        /**
    232          * Check for conflicts between given mods
     247         * Check for incompabitilites between given mods
    233248         *
    234249         * @param mods
    235250         *            Mods to check
    236          * @return Conflicting mods
    237          */
    238         public HashMap<Mod, HashSet<Mod>> checkConflicts(TreeSet<Mod> mods) {
     251         * @return Incompatible mods
     252         */
     253        public HashMap<Mod, HashSet<Mod>> checkIncompabitilites(TreeSet<Mod> mods) {
    239254                // TODO: Verify functionality
    240255                HashMap<Mod, HashSet<Mod>> res = new HashMap<Mod, HashSet<Mod>>();
    241256
    242257                for (Mod m : mods) {
    243                         for (int confNum : m.getConflicts()) {
     258                        for (int confNum : m.getIncompabitilities()) {
    244259                                Mod other = getModByNumber(confNum);
    245260                                if (mods.contains(other)) {
Note: See TracChangeset for help on using the changeset viewer.