// Token: 0x06000113 RID: 275 RVA: 0x0000BF84 File Offset: 0x0000A184 private static void Load(BinaryReader reader, string filename, ACCMenu menu) { menu.version = reader.ReadInt32(); menu.txtpath = reader.ReadString(); reader.ReadString(); reader.ReadString(); reader.ReadString().Replace(FileConst.RET, "\n"); reader.ReadInt32(); for (;;) { int num = (int)reader.ReadByte(); if (num == 0) { break; } string text = reader.ReadString(); string[] array = new string[num - 1]; for (int i = 0; i < num - 1; i++) { array[i] = reader.ReadString(); } // 뭔 스위치가 이따위로 디컴파일 되냐;; switch (text) { case "category": menu.category = array[0]; continue; case "属性追加": case "color_set": continue; case "priority": menu.priority = array[0]; continue; case "name": menu.name = array[0]; continue; case "setumei": menu.desc = array[0].Replace(FileConst.RET, "\n"); continue; case "icon": case "icons": menu.icon = array[0]; menu.editicon = Path.GetFileNameWithoutExtension(menu.icon); continue; case "アイテムパラメータ": if (array.Length == 3) { menu.itemParam = array; continue; } continue; case "アイテム": menu.items.Add(Path.GetFileNameWithoutExtension(array[0])); continue; case "additem": { if (array.Length < 1) { continue; } Item item = new Item(array); if (!menu.itemFiles.TryGetValue(item.filename, out item.link)) { menu.itemFiles[item.filename] = item; } menu.addItems.Add(item); try { if (item.slot != null) { TBody.SlotID key2 = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), item.slot, true); menu.itemSlots[key2] = item; } continue; } catch (Exception ex) { LogUtil.Debug(new object[] { "failed to parse additem slot", item.slot, ex }); continue; } break; } case "maskitem": break; case "delitem": { string item2 = menu.category; if (array.Length >= 1) { item2 = array[0]; } menu.delItems.Add(item2); continue; } case "マテリアル変更": { string slot = array[0]; int matNo = int.Parse(array[1]); string filename2 = array[2]; menu.AddSlotMaterial(new TargetMaterial(slot, matNo, filename2)); continue; } case "node消去": menu.delNodes.Add(array[0]); continue; case "node表示": menu.showNodes.Add(array[0]); continue; case "パーツnode消去": menu.delPartsNodes.Add(array); continue; case "パーツnode表示": menu.showPartsNodes.Add(array); continue; case "リソース参照": { ResourceRef resourceRef = new ResourceRef(array[0], array[1]); resourceRef.menu = menu; menu.resources.Add(resourceRef); if (!menu.resFiles.TryGetValue(resourceRef.filename, out resourceRef.link)) { menu.resFiles[resourceRef.filename] = resourceRef; continue; } continue; } case "半脱ぎ": { ResourceRef resourceRef2 = new ResourceRef(text, array[0]); resourceRef2.menu = menu; menu.resources.Add(resourceRef2); if (!menu.resFiles.TryGetValue(resourceRef2.filename, out resourceRef2.link)) { menu.resFiles[resourceRef2.filename] = resourceRef2; continue; } continue; } default: continue; } if (array.Length >= 1) { menu.maskItems.Add(array[0]); } } }
private static void Load(BinaryReader reader, string filename, ACCMenu menu) { menu.version = reader.ReadInt32(); menu.txtpath = reader.ReadString(); // 未使用 var headerName = reader.ReadString(); var headerCategory = reader.ReadString(); var headerSetumei = reader.ReadString().Replace(FileConst.RET, "\n"); var num2 = reader.ReadInt32(); while (true) { var size = (int)reader.ReadByte(); if (size == 0) { break; } var key = reader.ReadString(); var param = new string[size - 1]; for (var i = 0; i < size - 1; i++) { param[i] = reader.ReadString(); } switch (key) { case "category": menu.category = param[0]; break; // case "メニューフォルダ": // menu.menuFolder = param[0]; // break; // case "catno": // menu.catno = param[0]; // break; case "属性追加": break; case "priority": menu.priority = param[0]; break; case "name": menu.name = param[0]; break; case "setumei": menu.desc = param[0].Replace(FileConst.RET, "\n"); break; case "icon": case "icons": menu.icon = param[0]; menu.editicon = Path.GetFileNameWithoutExtension(menu.icon); break; case "アイテムパラメータ": if (param.Length == 3) { menu.itemParam = param; //Array.Copy(param, 0, itemParam, 0, param.Length); } break; case "アイテム": menu.items.Add(Path.GetFileNameWithoutExtension(param[0])); break; case "additem": if (param.Length >= 1) { var item = new Item(param); if (!menu.itemFiles.TryGetValue(item.filename, out item.link)) { menu.itemFiles[item.filename] = item; } menu.addItems.Add(item); try { if (item.slot != null) { var slotId = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), item.slot, true); menu.itemSlots[slotId] = item; } } catch (Exception e) { LogUtil.Debug("failed to parse additem slot", item.slot, e); } } break; case "maskitem": if (param.Length >= 1) { menu.maskItems.Add(param[0]); } break; case "delitem": var slot0 = menu.category; if (param.Length >= 1) { slot0 = param[0]; } menu.delItems.Add(slot0); break; case "マテリアル変更": var slot = param[0]; var matNo = int.Parse(param[1]); var file = param[2]; menu.AddSlotMaterial(new TargetMaterial(slot, matNo, file)); break; case "node消去": menu.delNodes.Add(param[0]); break; case "node表示": menu.showNodes.Add(param[0]); break; case "パーツnode消去": menu.delPartsNodes.Add(param); break; case "パーツnode表示": menu.showPartsNodes.Add(param); break; case "リソース参照": var resRef1 = new ResourceRef(param[0], param[1]); resRef1.menu = menu; menu.resources.Add(resRef1); if (!menu.resFiles.TryGetValue(resRef1.filename, out resRef1.link)) { menu.resFiles[resRef1.filename] = resRef1; } break; case "半脱ぎ": var resRef2 = new ResourceRef(key, param[0]); resRef2.menu = menu; menu.resources.Add(resRef2); if (!menu.resFiles.TryGetValue(resRef2.filename, out resRef2.link)) { menu.resFiles[resRef2.filename] = resRef2; } break; case "color_set": break; //case "アタッチポイントの設定": // break; //case "tex": //case "テクスチャ変更": // break; //case "テクスチャ合成": // break; //case "unsetitem": // break; //case "commenttype": // break; //case "color_set" // break; } } }
private static void Load(BinaryReader reader, string filename, ACCMenu menu) { menu.version = reader.ReadInt32(); menu.txtpath = reader.ReadString(); // 未使用 var headerName = reader.ReadString(); var headerCategory = reader.ReadString(); var headerSetumei = reader.ReadString().Replace(FileConst.RET, "\n"); int num2 = (int)reader.ReadInt32(); while (true) { int size = (int) reader.ReadByte(); if (size == 0) break; string key = reader.ReadString(); var param = new string[size-1]; for (int i = 0; i < size-1; i++) { param[i] = reader.ReadString(); } switch (key) { case "category": menu.category = param[0]; break; // case "メニューフォルダ": // menu.menuFolder = param[0]; // break; // case "catno": // menu.catno = param[0]; // break; case "属性追加": break; case "priority": menu.priority = param[0]; break; case "name": menu.name = param[0]; break; case "setumei": menu.desc = param[0].Replace(FileConst.RET, "\n"); break; case "icon": case "icons": menu.icon = param[0]; menu.editicon = Path.GetFileNameWithoutExtension(menu.icon); break; case "アイテムパラメータ": if (param.Length == 3) { menu.itemParam = param; //Array.Copy(param, 0, itemParam, 0, param.Length); } break; case "アイテム": menu.items.Add(Path.GetFileNameWithoutExtension(param[0])); break; case "additem": if (param.Length >= 1) { var item = new Item(param); if (!menu.itemFiles.TryGetValue(item.filename, out item.link)) { menu.itemFiles[item.filename] = item; } menu.addItems.Add(item); try { if (item.slot != null) { var slotId = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), item.slot, true); menu.itemSlots[slotId] = item; } } catch(Exception e) { LogUtil.Debug("failed to parse additem slot", item.slot, e); } } break; case "maskitem": if (param.Length >= 1) menu.maskItems.Add(param[0]); break; case "delitem": string slot0 = menu.category; if (param.Length >= 1) slot0 = param[0]; menu.delItems.Add(slot0); break; case "マテリアル変更": string slot = param[0]; int matNo = int.Parse(param[1]); string file = param[2]; menu.AddSlotMaterial(new TargetMaterial(slot, matNo, file)); break; case "node消去": menu.delNodes.Add(param[0]); break; case "node表示": menu.showNodes.Add(param[0]); break; case "パーツnode消去": menu.delPartsNodes.Add(param); break; case "パーツnode表示": menu.showPartsNodes.Add(param); break; case "リソース参照": var resRef1 = new ResourceRef(param[0], param[1]); resRef1.menu = menu; menu.resources.Add(resRef1); if (!menu.resFiles.TryGetValue(resRef1.filename, out resRef1.link)) { menu.resFiles[resRef1.filename] = resRef1; } break; case "半脱ぎ": var resRef2 = new ResourceRef(key, param[0]); resRef2.menu = menu; menu.resources.Add(resRef2); if (!menu.resFiles.TryGetValue(resRef2.filename, out resRef2.link)) { menu.resFiles[resRef2.filename] = resRef2; } break; case "color_set": break; //case "アタッチポイントの設定": // break; //case "tex": //case "テクスチャ変更": // break; //case "テクスチャ合成": // break; //case "unsetitem": // break; //case "commenttype": // break; //case "color_set" // break; } } }