dirk-cfx-react 1.1.66 → 1.1.68

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: 73, 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(
@@ -4032,6 +4145,7 @@ function SelectItem(props) {
4032
4145
  data: formattedItems,
4033
4146
  allowDeselect: false,
4034
4147
  searchable: true,
4148
+ comboboxProps: { withinPortal: true, zIndex: 2e3 },
4035
4149
  leftSectionWidth: "4vh",
4036
4150
  leftSection: props.value ? /* @__PURE__ */ jsxRuntime.jsx(
4037
4151
  core.Image,
@@ -4437,6 +4551,83 @@ var FiveMKeyBindInput = Object.assign(Root, {
4437
4551
  Category,
4438
4552
  Key
4439
4553
  });
4554
+ function buildGroupedData(extraIds = []) {
4555
+ const groups = /* @__PURE__ */ new Map();
4556
+ for (const c of GTA_CONTROLS) {
4557
+ if (!groups.has(c.group)) groups.set(c.group, []);
4558
+ groups.get(c.group).push(c);
4559
+ }
4560
+ const data = GTA_CONTROL_GROUP_ORDER.flatMap((g) => {
4561
+ const items = groups.get(g);
4562
+ if (!items || items.length === 0) return [];
4563
+ return [
4564
+ {
4565
+ group: g,
4566
+ items: items.map((c) => ({
4567
+ value: String(c.id),
4568
+ label: formatGtaControl(c.id)
4569
+ }))
4570
+ }
4571
+ ];
4572
+ });
4573
+ const knownIds = new Set(GTA_CONTROLS.map((c) => c.id));
4574
+ const customs = extraIds.filter((id) => !knownIds.has(id));
4575
+ if (customs.length > 0) {
4576
+ data.push({
4577
+ group: "Custom",
4578
+ items: customs.map((id) => ({ value: String(id), label: `Control ${id}` }))
4579
+ });
4580
+ }
4581
+ return data;
4582
+ }
4583
+ function ControlSelect({
4584
+ value,
4585
+ onChange,
4586
+ label = "Control",
4587
+ size = "xs",
4588
+ searchable = true,
4589
+ ...rest
4590
+ }) {
4591
+ const data = buildGroupedData(value != null ? [value] : []);
4592
+ return /* @__PURE__ */ jsxRuntime.jsx(
4593
+ core.Select,
4594
+ {
4595
+ label,
4596
+ size,
4597
+ searchable,
4598
+ maxDropdownHeight: 320,
4599
+ nothingFoundMessage: "No matching controls",
4600
+ ...rest,
4601
+ data,
4602
+ value: value != null ? String(value) : null,
4603
+ onChange: (v) => onChange(v == null ? null : Number(v))
4604
+ }
4605
+ );
4606
+ }
4607
+ function ControlMultiSelect({
4608
+ value,
4609
+ onChange,
4610
+ label = "Controls",
4611
+ size = "xs",
4612
+ searchable = true,
4613
+ ...rest
4614
+ }) {
4615
+ const data = buildGroupedData(value);
4616
+ return /* @__PURE__ */ jsxRuntime.jsx(
4617
+ core.MultiSelect,
4618
+ {
4619
+ label,
4620
+ size,
4621
+ searchable,
4622
+ maxDropdownHeight: 320,
4623
+ nothingFoundMessage: "No matching controls",
4624
+ ...rest,
4625
+ data,
4626
+ value: value.map(String),
4627
+ onChange: (vals) => onChange(vals.map((v) => Number(v)).filter((n) => Number.isFinite(n)))
4628
+ }
4629
+ );
4630
+ }
4440
4631
  function AsyncSaveButton({
4441
4632
  onSave,
4442
4633
  color,
@@ -4654,6 +4845,8 @@ exports.BlipIconSelect = BlipIconSelect;
4654
4845
  exports.BorderedIcon = BorderedIcon;
4655
4846
  exports.ConfigPanel = ConfigPanel;
4656
4847
  exports.ConfirmModal = ConfirmModal;
4848
+ exports.ControlMultiSelect = ControlMultiSelect;
4849
+ exports.ControlSelect = ControlSelect;
4657
4850
  exports.Counter = Counter;
4658
4851
  exports.FiveMKeyBindInput = FiveMKeyBindInput;
4659
4852
  exports.FloatingParticles = FloatingParticles;