protected void OnQuery_SORT() { GameSection.SetEventData(sortSettings.Clone()); }
public static SortSettings CreateMemSortSettings(SortBase.DIALOG_TYPE dialog_type, SETTINGS_TYPE memory_type) { if (memory_type >= SETTINGS_TYPE.MAX) { return(null); } if (memSettings == null) { memSettings = new SortSettings[13]; } SortSettings sortSettings = memSettings[(int)memory_type]; bool flag = sortSettings != null; if (!flag) { memSettings[(int)memory_type] = new SortSettings(); if (GetMemorySortData(memory_type, ref memSettings[(int)memory_type])) { flag = true; } sortSettings = memSettings[(int)memory_type]; } sortSettings.dialogType = dialog_type; switch (dialog_type) { case SortBase.DIALOG_TYPE.WEAPON: case SortBase.DIALOG_TYPE.ARMOR: case SortBase.DIALOG_TYPE.STORAGE_EQUIP: { sortSettings.TYPE_ALL = SortBase.TYPE.EQUIP_ALL; SortBase.SORT_REQUIREMENT sORT_REQUIREMENT = (dialog_type != SortBase.DIALOG_TYPE.ARMOR) ? SortBase.SORT_REQUIREMENT.REQUIREMENT_WEAPON_BIT : SortBase.SORT_REQUIREMENT.REQUIREMENT_ARMORS_BIT; if (!flag) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEMENT; } else if ((sortSettings.requirement & sORT_REQUIREMENT) == (SortBase.SORT_REQUIREMENT) 0) { if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.ATK) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.DEF; } else if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.DEF) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ATK; } else if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.ELEM_ATK) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEM_DEF; } else if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.ELEM_DEF) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEM_ATK; } else { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEMENT; } } break; } case SortBase.DIALOG_TYPE.SMITH_CREATE_WEAPON: case SortBase.DIALOG_TYPE.SMITH_CREATE_ARMOR: case SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_WEAPON: case SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_ARMOR: { sortSettings.TYPE_ALL = SortBase.TYPE.NONE; SortBase.SORT_REQUIREMENT sORT_REQUIREMENT2; switch (dialog_type) { default: sORT_REQUIREMENT2 = SortBase.SORT_REQUIREMENT.REQUIREMENT_CREATE_WEAPON_BIT; break; case SortBase.DIALOG_TYPE.SMITH_CREATE_ARMOR: sORT_REQUIREMENT2 = SortBase.SORT_REQUIREMENT.REQUIREMENT_CREATE_ARMORS_BIT; break; case SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_WEAPON: sORT_REQUIREMENT2 = SortBase.SORT_REQUIREMENT.REQUIREMENT_CREATE_PICKUP_WEAPON_BIT; break; case SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_ARMOR: sORT_REQUIREMENT2 = SortBase.SORT_REQUIREMENT.REQUIREMENT_CREATE_PICKUP_ARMORS_BIT; break; } if (!flag) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEMENT; } else if ((sortSettings.requirement & sORT_REQUIREMENT2) == (SortBase.SORT_REQUIREMENT) 0) { if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.ATK) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.DEF; } else if (sortSettings.requirement == SortBase.SORT_REQUIREMENT.DEF) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ATK; } else { sortSettings.requirement = SortBase.SORT_REQUIREMENT.ELEMENT; } } break; } case SortBase.DIALOG_TYPE.SKILL: case SortBase.DIALOG_TYPE.STORAGE_SKILL: sortSettings.TYPE_ALL = SortBase.TYPE.SKILL_ALL; if (!flag) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.SKILL_TYPE; } break; case SortBase.DIALOG_TYPE.USE_ITEM: case SortBase.DIALOG_TYPE.MATERIAL: sortSettings.TYPE_ALL = SortBase.TYPE.WEAPON_ALL; if (!flag) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.NUM; } break; case SortBase.DIALOG_TYPE.QUEST: sortSettings.TYPE_ALL = SortBase.TYPE.ENEMY_ALL; if (!flag) { sortSettings.requirement = SortBase.SORT_REQUIREMENT.RARITY; } break; default: sortSettings.requirement = SortBase.SORT_REQUIREMENT.RARITY; sortSettings.TYPE_ALL = SortBase.TYPE.NONE; break; } if (!flag && sortSettings.TYPE_ALL != 0) { sortSettings.type = (int)sortSettings.TYPE_ALL; } return(sortSettings.Clone()); }
public override void Initialize() { sortOrder = (SortSettings)GameSection.GetEventData(); baseSortOrder = sortOrder.Clone(); base.Initialize(); }