dirk-cfx-react 1.1.67 → 1.1.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1654,6 +1654,119 @@ var INPUT_MAPPER_KEYS_BY_PRIMARY = {
1654
1654
  TOUCHPAD_ABSOLUTE_AXIS: [],
1655
1655
  TOUCHPAD_CENTERED_AXIS: []
1656
1656
  };
1657
+
1658
+ // src/utils/gtaControls.ts
1659
+ var GTA_CONTROLS = [
1660
+ // ── Camera ─────────────────────────────────────────────────────────────────
1661
+ { id: 0, symbol: "INPUT_NEXT_CAMERA", label: "Switch Camera", defaultKey: "V", group: "Camera" },
1662
+ { id: 1, symbol: "INPUT_LOOK_LR", label: "Look Left/Right", defaultKey: "Mouse X", group: "Camera" },
1663
+ { id: 2, symbol: "INPUT_LOOK_UD", label: "Look Up/Down", defaultKey: "Mouse Y", group: "Camera" },
1664
+ { id: 3, symbol: "INPUT_LOOK_UP_ONLY", label: "Look Up Only", group: "Camera" },
1665
+ { id: 4, symbol: "INPUT_LOOK_DOWN_ONLY", label: "Look Down Only", group: "Camera" },
1666
+ { id: 5, symbol: "INPUT_LOOK_LEFT_ONLY", label: "Look Left Only", group: "Camera" },
1667
+ { id: 6, symbol: "INPUT_LOOK_RIGHT_ONLY", label: "Look Right Only", group: "Camera" },
1668
+ { id: 8, symbol: "INPUT_CINEMATIC_SLOWMO", label: "Cinematic Slowmo", defaultKey: "Insert", group: "Camera" },
1669
+ { id: 26, symbol: "INPUT_LOOK_BEHIND", label: "Look Behind", defaultKey: "C", group: "Camera" },
1670
+ { id: 27, symbol: "INPUT_PHONE", label: "Phone", defaultKey: "Up Arrow", group: "Phone" },
1671
+ // ── Movement ───────────────────────────────────────────────────────────────
1672
+ { id: 21, symbol: "INPUT_SPRINT", label: "Sprint", defaultKey: "Left Shift", group: "Movement" },
1673
+ { id: 22, symbol: "INPUT_JUMP", label: "Jump", defaultKey: "Space", group: "Movement" },
1674
+ { id: 23, symbol: "INPUT_ENTER", label: "Enter Vehicle", defaultKey: "F", group: "Movement" },
1675
+ { id: 30, symbol: "INPUT_MOVE_LR", label: "Move Left/Right", group: "Movement" },
1676
+ { id: 31, symbol: "INPUT_MOVE_UD", label: "Move Up/Down", group: "Movement" },
1677
+ { id: 32, symbol: "INPUT_MOVE_UP_ONLY", label: "Move Forward (W)", group: "Movement" },
1678
+ { id: 33, symbol: "INPUT_MOVE_DOWN_ONLY", label: "Move Back (S)", group: "Movement" },
1679
+ { id: 34, symbol: "INPUT_MOVE_LEFT_ONLY", label: "Move Left (A)", group: "Movement" },
1680
+ { id: 35, symbol: "INPUT_MOVE_RIGHT_ONLY", label: "Move Right (D)", group: "Movement" },
1681
+ { id: 36, symbol: "INPUT_DUCK", label: "Duck / Stealth", defaultKey: "Left Ctrl", group: "Movement" },
1682
+ { id: 37, symbol: "INPUT_SELECT_WEAPON", label: "Weapon Wheel", defaultKey: "Tab", group: "Combat" },
1683
+ { id: 38, symbol: "INPUT_PICKUP", label: "Pickup / Interact", defaultKey: "E", group: "Movement" },
1684
+ // ── Combat ─────────────────────────────────────────────────────────────────
1685
+ { id: 24, symbol: "INPUT_ATTACK", label: "Attack / Fire", defaultKey: "Mouse 1", group: "Combat" },
1686
+ { id: 25, symbol: "INPUT_AIM", label: "Aim", defaultKey: "Mouse 2", group: "Combat" },
1687
+ { id: 45, symbol: "INPUT_RELOAD", label: "Reload", defaultKey: "R", group: "Combat" },
1688
+ { id: 47, symbol: "INPUT_DETONATE", label: "Detonate", defaultKey: "G", group: "Combat" },
1689
+ { id: 257, symbol: "INPUT_ATTACK2", label: "Attack 2", group: "Combat" },
1690
+ { id: 140, symbol: "INPUT_MELEE_ATTACK_LIGHT", label: "Melee Light", defaultKey: "R", group: "Combat" },
1691
+ { id: 141, symbol: "INPUT_MELEE_ATTACK_HEAVY", label: "Melee Heavy", defaultKey: "Q", group: "Combat" },
1692
+ { id: 142, symbol: "INPUT_MELEE_ATTACK_ALTERNATE", label: "Melee Alternate", defaultKey: "Mouse 1", group: "Combat" },
1693
+ { id: 263, symbol: "INPUT_MELEE_ATTACK1", label: "Melee Attack 1", group: "Combat" },
1694
+ { id: 264, symbol: "INPUT_MELEE_ATTACK2", label: "Melee Attack 2", group: "Combat" },
1695
+ // ── Cover ──────────────────────────────────────────────────────────────────
1696
+ { id: 44, symbol: "INPUT_COVER", label: "Cover", defaultKey: "Q", group: "Cover" },
1697
+ // ── Vehicle (general) ──────────────────────────────────────────────────────
1698
+ { id: 59, symbol: "INPUT_VEH_MOVE_LR", label: "Vehicle Steering", group: "Vehicle" },
1699
+ { id: 63, symbol: "INPUT_VEH_MOVE_LEFT_ONLY", label: "Vehicle Steer Left", group: "Vehicle" },
1700
+ { id: 64, symbol: "INPUT_VEH_MOVE_RIGHT_ONLY", label: "Vehicle Steer Right", group: "Vehicle" },
1701
+ { id: 71, symbol: "INPUT_VEH_ACCELERATE", label: "Vehicle Accelerate", defaultKey: "W", group: "Vehicle" },
1702
+ { id: 72, symbol: "INPUT_VEH_BRAKE", label: "Vehicle Brake", defaultKey: "S", group: "Vehicle" },
1703
+ { id: 73, symbol: "INPUT_VEH_DUCK", label: "Vehicle Duck", defaultKey: "X", group: "Vehicle" },
1704
+ { id: 74, symbol: "INPUT_VEH_HEADLIGHT", label: "Headlights", defaultKey: "H", group: "Vehicle" },
1705
+ { id: 75, symbol: "INPUT_VEH_EXIT", label: "Exit Vehicle", defaultKey: "F", group: "Vehicle" },
1706
+ { id: 76, symbol: "INPUT_VEH_HANDBRAKE", label: "Handbrake", defaultKey: "Space", group: "Vehicle" },
1707
+ { id: 80, symbol: "INPUT_VEH_CIN_CAM", label: "Cinematic Cam", defaultKey: "R", group: "Vehicle" },
1708
+ { id: 81, symbol: "INPUT_VEH_NEXT_RADIO", label: "Radio Next", group: "Vehicle" },
1709
+ { id: 82, symbol: "INPUT_VEH_PREV_RADIO", label: "Radio Prev", group: "Vehicle" },
1710
+ { id: 83, symbol: "INPUT_VEH_NEXT_RADIO_TRACK", label: "Radio Next Track", group: "Vehicle" },
1711
+ { id: 84, symbol: "INPUT_VEH_PREV_RADIO_TRACK", label: "Radio Prev Track", group: "Vehicle" },
1712
+ { id: 85, symbol: "INPUT_VEH_RADIO_WHEEL", label: "Radio Wheel", defaultKey: "Q", group: "Vehicle" },
1713
+ { id: 86, symbol: "INPUT_VEH_HORN", label: "Horn", defaultKey: "E", group: "Vehicle" },
1714
+ { id: 90, symbol: "INPUT_VEH_AIM", label: "Vehicle Aim", group: "Vehicle" },
1715
+ { id: 91, symbol: "INPUT_VEH_ATTACK", label: "Vehicle Attack", group: "Vehicle" },
1716
+ { id: 92, symbol: "INPUT_VEH_ATTACK2", label: "Vehicle Attack 2", group: "Vehicle" },
1717
+ { id: 99, symbol: "INPUT_VEH_SELECT_NEXT_WEAPON", label: "Veh Next Weapon", group: "Vehicle" },
1718
+ { id: 100, symbol: "INPUT_VEH_SELECT_PREV_WEAPON", label: "Veh Prev Weapon", group: "Vehicle" },
1719
+ // ── Vehicle (Plane/Heli) ───────────────────────────────────────────────────
1720
+ { id: 152, symbol: "INPUT_VEH_FLY_THROTTLE_UP", label: "Plane Throttle Up", defaultKey: "W", group: "Vehicle (Plane/Heli)" },
1721
+ { id: 153, symbol: "INPUT_VEH_FLY_THROTTLE_DOWN", label: "Plane Throttle Down", defaultKey: "S", group: "Vehicle (Plane/Heli)" },
1722
+ { id: 154, symbol: "INPUT_VEH_FLY_YAW_LEFT", label: "Plane Yaw Left", defaultKey: "A", group: "Vehicle (Plane/Heli)" },
1723
+ { id: 155, symbol: "INPUT_VEH_FLY_YAW_RIGHT", label: "Plane Yaw Right", defaultKey: "D", group: "Vehicle (Plane/Heli)" },
1724
+ { id: 158, symbol: "INPUT_VEH_FLY_ATTACK", label: "Plane Attack", defaultKey: "Mouse 1", group: "Vehicle (Plane/Heli)" },
1725
+ // ── Vehicle (Boat / Bike) ──────────────────────────────────────────────────
1726
+ { id: 198, symbol: "INPUT_VEH_BICYCLE_PEDAL", label: "Bike Pedal", group: "Vehicle (Boat/Bike)" },
1727
+ // ── Phone ──────────────────────────────────────────────────────────────────
1728
+ { id: 137, symbol: "INPUT_FRONTEND_SOCIAL_CLUB_SECONDARY", label: "Toggle Phone (alt)", group: "Phone" },
1729
+ // ── Frontend / UI ──────────────────────────────────────────────────────────
1730
+ { id: 199, symbol: "INPUT_FRONTEND_PAUSE", label: "Pause Menu", defaultKey: "P", group: "Frontend / UI" },
1731
+ { id: 200, symbol: "INPUT_FRONTEND_PAUSE_ALTERNATE", label: "Pause Menu (alt)", defaultKey: "Esc", group: "Frontend / UI" },
1732
+ { id: 201, symbol: "INPUT_FRONTEND_ACCEPT", label: "Accept", defaultKey: "Enter", group: "Frontend / UI" },
1733
+ { id: 202, symbol: "INPUT_FRONTEND_CANCEL", label: "Cancel", defaultKey: "Esc", group: "Frontend / UI" },
1734
+ { id: 244, symbol: "INPUT_INTERACTION_MENU", label: "Interaction Menu", defaultKey: "M", group: "Frontend / UI" },
1735
+ // ── Multiplayer ────────────────────────────────────────────────────────────
1736
+ { id: 245, symbol: "INPUT_MP_TEXT_CHAT_ALL", label: "Chat (All)", defaultKey: "T", group: "Multiplayer" },
1737
+ { id: 246, symbol: "INPUT_MP_TEXT_CHAT_TEAM", label: "Chat (Team)", defaultKey: "Y", group: "Multiplayer" },
1738
+ { id: 247, symbol: "INPUT_MP_TEXT_CHAT_FRIENDS", label: "Chat (Friends)", group: "Multiplayer" },
1739
+ { id: 248, symbol: "INPUT_MP_TEXT_CHAT_CREW", label: "Chat (Crew)", group: "Multiplayer" },
1740
+ { id: 249, symbol: "INPUT_PUSH_TO_TALK", label: "Push To Talk", defaultKey: "N", group: "Multiplayer" },
1741
+ // ── Misc ───────────────────────────────────────────────────────────────────
1742
+ { id: 51, symbol: "INPUT_CONTEXT", label: "Context (E)", defaultKey: "E", group: "Misc" },
1743
+ { id: 52, symbol: "INPUT_CONTEXT_SECONDARY", label: "Context Secondary", defaultKey: "Q", group: "Misc" },
1744
+ { id: 19, symbol: "INPUT_CHARACTER_WHEEL", label: "Character Wheel", defaultKey: "Left Alt", group: "Misc" },
1745
+ { id: 105, symbol: "INPUT_HUD_SPECIAL", label: "Special Ability", defaultKey: "Caps Lock", group: "Misc" },
1746
+ { id: 121, symbol: "INPUT_MULTIPLAYER_INFO", label: "Player List", defaultKey: "Z", group: "Misc" },
1747
+ { id: 170, symbol: "INPUT_SAVE_REPLAY_CLIP", label: "Save Replay Clip", defaultKey: "F1", group: "Misc" },
1748
+ { id: 288, symbol: "INPUT_REPLAY_START_STOP_RECORDING", label: "Replay Record", defaultKey: "F1", group: "Misc" },
1749
+ { id: 289, symbol: "INPUT_REPLAY_START_STOP_RECORDING_SECONDARY", label: "Replay Record (alt)", group: "Misc" }
1750
+ ];
1751
+ var BY_ID = new Map(GTA_CONTROLS.map((c) => [c.id, c]));
1752
+ function formatGtaControl(id) {
1753
+ const c = BY_ID.get(id);
1754
+ if (!c) return `Control ${id}`;
1755
+ return c.defaultKey ? `${c.label} (${id} \xB7 ${c.defaultKey})` : `${c.label} (${id})`;
1756
+ }
1757
+ var GTA_CONTROL_GROUP_ORDER = [
1758
+ "Camera",
1759
+ "Movement",
1760
+ "Combat",
1761
+ "Cover",
1762
+ "Vehicle",
1763
+ "Vehicle (Plane/Heli)",
1764
+ "Vehicle (Boat/Bike)",
1765
+ "Phone",
1766
+ "Frontend / UI",
1767
+ "Multiplayer",
1768
+ "Misc"
1769
+ ];
1657
1770
  function BorderedIcon(props) {
1658
1771
  const theme = core.useMantineTheme();
1659
1772
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4438,6 +4551,86 @@ var FiveMKeyBindInput = Object.assign(Root, {
4438
4551
  Category,
4439
4552
  Key
4440
4553
  });
4554
+ function buildGroupedData(extraIds = []) {
4555
+ const groups = /* @__PURE__ */ new Map();
4556
+ const seen = /* @__PURE__ */ new Set();
4557
+ for (const c of GTA_CONTROLS) {
4558
+ if (seen.has(c.id)) continue;
4559
+ seen.add(c.id);
4560
+ if (!groups.has(c.group)) groups.set(c.group, []);
4561
+ groups.get(c.group).push(c);
4562
+ }
4563
+ const data = GTA_CONTROL_GROUP_ORDER.flatMap((g) => {
4564
+ const items = groups.get(g);
4565
+ if (!items || items.length === 0) return [];
4566
+ return [
4567
+ {
4568
+ group: g,
4569
+ items: items.map((c) => ({
4570
+ value: String(c.id),
4571
+ label: formatGtaControl(c.id)
4572
+ }))
4573
+ }
4574
+ ];
4575
+ });
4576
+ const knownIds = new Set(GTA_CONTROLS.map((c) => c.id));
4577
+ const customs = extraIds.filter((id) => !knownIds.has(id));
4578
+ if (customs.length > 0) {
4579
+ data.push({
4580
+ group: "Custom",
4581
+ items: customs.map((id) => ({ value: String(id), label: `Control ${id}` }))
4582
+ });
4583
+ }
4584
+ return data;
4585
+ }
4586
+ function ControlSelect({
4587
+ value,
4588
+ onChange,
4589
+ label = "Control",
4590
+ size = "xs",
4591
+ searchable = true,
4592
+ ...rest
4593
+ }) {
4594
+ const data = buildGroupedData(value != null ? [value] : []);
4595
+ return /* @__PURE__ */ jsxRuntime.jsx(
4596
+ core.Select,
4597
+ {
4598
+ label,
4599
+ size,
4600
+ searchable,
4601
+ maxDropdownHeight: 320,
4602
+ nothingFoundMessage: "No matching controls",
4603
+ ...rest,
4604
+ data,
4605
+ value: value != null ? String(value) : null,
4606
+ onChange: (v) => onChange(v == null ? null : Number(v))
4607
+ }
4608
+ );
4609
+ }
4610
+ function ControlMultiSelect({
4611
+ value,
4612
+ onChange,
4613
+ label = "Controls",
4614
+ size = "xs",
4615
+ searchable = true,
4616
+ ...rest
4617
+ }) {
4618
+ const data = buildGroupedData(value);
4619
+ return /* @__PURE__ */ jsxRuntime.jsx(
4620
+ core.MultiSelect,
4621
+ {
4622
+ label,
4623
+ size,
4624
+ searchable,
4625
+ maxDropdownHeight: 320,
4626
+ nothingFoundMessage: "No matching controls",
4627
+ ...rest,
4628
+ data,
4629
+ value: value.map(String),
4630
+ onChange: (vals) => onChange(vals.map((v) => Number(v)).filter((n) => Number.isFinite(n)))
4631
+ }
4632
+ );
4633
+ }
4441
4634
  function AsyncSaveButton({
4442
4635
  onSave,
4443
4636
  color,
@@ -4655,6 +4848,8 @@ exports.BlipIconSelect = BlipIconSelect;
4655
4848
  exports.BorderedIcon = BorderedIcon;
4656
4849
  exports.ConfigPanel = ConfigPanel;
4657
4850
  exports.ConfirmModal = ConfirmModal;
4851
+ exports.ControlMultiSelect = ControlMultiSelect;
4852
+ exports.ControlSelect = ControlSelect;
4658
4853
  exports.Counter = Counter;
4659
4854
  exports.FiveMKeyBindInput = FiveMKeyBindInput;
4660
4855
  exports.FloatingParticles = FloatingParticles;