Ejemplo n.º 1
0
 public static GamePath Est(ObjectType type, EquipSlot equip, BodySlot slot)
 {
     return(type switch
     {
         ObjectType.Equipment => equip switch
         {
             EquipSlot.Body => GamePath.GenerateUnchecked("chara/xls/charadb/extra_top.est"),
             EquipSlot.Head => GamePath.GenerateUnchecked("chara/xls/charadb/extra_met.est"),
             _ => throw new NotImplementedException()
         },
            private void DrawFileSwapTabEdit()
            {
                if (!ImGui.BeginTabItem(LabelFileSwapTab))
                {
                    return;
                }

                ImGui.SetNextItemWidth(-1);
                if (ImGui.BeginListBox(LabelFileSwapHeader, AutoFillSize))
                {
                    var swaps = Meta.FileSwaps.Keys.ToArray();

                    var arrow = $"{( char )FontAwesomeIcon.LongArrowAltRight}";
                    ImGui.PushFont(UiBuilder.IconFont);
                    var arrowWidth = ImGui.CalcTextSize(arrow).X;
                    ImGui.PopFont();


                    var width = (ImGui.GetWindowWidth() - arrowWidth - 4 * ImGui.GetStyle().ItemSpacing.X) / 2;
                    for (var idx = 0; idx < swaps.Length + 1; ++idx)
                    {
                        var    key         = idx == swaps.Length ? GamePath.GenerateUnchecked("") : swaps[idx];
                        var    value       = idx == swaps.Length ? GamePath.GenerateUnchecked("") : Meta.FileSwaps[key];
                        string keyString   = key;
                        string valueString = value;

                        ImGui.SetNextItemWidth(width);
                        if (ImGui.InputTextWithHint($"##swapLhs_{idx}", "Enter new file to be replaced...", ref keyString,
                                                    GamePath.MaxGamePathLength, ImGuiInputTextFlags.EnterReturnsTrue))
                        {
                            var newKey = new GamePath(keyString);
                            if (newKey.CompareTo(key) != 0)
                            {
                                if (idx < swaps.Length)
                                {
                                    Meta.FileSwaps.Remove(key);
                                }

                                if (newKey != string.Empty)
                                {
                                    Meta.FileSwaps[newKey] = value;
                                }

                                _selector.SaveCurrentMod();
                                if (Mod.Enabled)
                                {
                                    _selector.ReloadCurrentMod();
                                }
                            }
                        }

                        if (idx < swaps.Length)
                        {
                            ImGui.SameLine();
                            ImGui.PushFont(UiBuilder.IconFont);
                            ImGui.TextUnformatted(arrow);
                            ImGui.PopFont();
                            ImGui.SameLine();

                            ImGui.SetNextItemWidth(width);
                            if (ImGui.InputTextWithHint($"##swapRhs_{idx}", "Enter new replacement path...", ref valueString,
                                                        GamePath.MaxGamePathLength,
                                                        ImGuiInputTextFlags.EnterReturnsTrue))
                            {
                                var newValue = new GamePath(valueString);
                                if (newValue.CompareTo(value) != 0)
                                {
                                    Meta.FileSwaps[key] = newValue;
                                    _selector.SaveCurrentMod();
                                    if (Mod.Enabled)
                                    {
                                        _selector.ReloadCurrentMod();
                                    }
                                }
                            }
                        }
                    }

                    ImGui.EndListBox();
                }

                ImGui.EndTabItem();
            }
Ejemplo n.º 3
0
 public static GamePath Gmp() => GamePath.GenerateUnchecked("chara/xls/equipmentparameter/gimmickparameter.gmp");
Ejemplo n.º 4
0
 public static GamePath Eqp() => GamePath.GenerateUnchecked("chara/xls/equipmentparameter/equipmentparameter.eqp");