Exemplo n.º 1
0
 private void checkDialog(DlgResource dialog) {
   List<StructEntry> flatList = dialog.getFlatList();
   for (int i = 0; i < flatList.size(); i++) {
     if (flatList.get(i) instanceof StringRef) {
       StringRef ref = (StringRef) flatList.get(i);
       if (ref.getValue() >= 0 && ref.getValue() < strUsed.length) strUsed[ref.getValue()] = true;
     } else if (flatList.get(i) instanceof AbstractCode) {
       AbstractCode code = (AbstractCode) flatList.get(i);
       try {
         String compiled =
             infinity.resource.bcs.Compiler.getInstance()
                 .compileDialogCode(code.toString(), code instanceof Action);
         if (code instanceof Action) Decompiler.decompileDialogAction(compiled, true);
         else Decompiler.decompileDialogTrigger(compiled, true);
         Set<Integer> used = Decompiler.getStringRefsUsed();
         for (final Integer stringRef : used) {
           int u = stringRef.intValue();
           if (u >= 0 && u < strUsed.length) strUsed[u] = true;
         }
       } catch (Exception e) {
         e.printStackTrace();
       }
     }
   }
 }
Exemplo n.º 2
0
 private void checkStruct(AbstractStruct struct) {
   List<StructEntry> flatList = struct.getFlatList();
   for (int i = 0; i < flatList.size(); i++) {
     if (flatList.get(i) instanceof StringRef) {
       StringRef ref = (StringRef) flatList.get(i);
       if (ref.getValue() >= 0 && ref.getValue() < strUsed.length) strUsed[ref.getValue()] = true;
     }
   }
 }