dirk-cfx-react 1.1.78 → 1.1.80

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.
@@ -1237,11 +1237,11 @@ var colorNames = {
1237
1237
  Yellow: { r: 255, g: 255, b: 0 },
1238
1238
  YellowGreen: { r: 154, g: 205, b: 50 }
1239
1239
  };
1240
- function colorWithAlpha(color, alpha10) {
1240
+ function colorWithAlpha(color, alpha11) {
1241
1241
  const lowerCasedColor = color.toLowerCase();
1242
1242
  if (colorNames[lowerCasedColor]) {
1243
1243
  const rgb = colorNames[lowerCasedColor];
1244
- return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha10})`;
1244
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha11})`;
1245
1245
  }
1246
1246
  if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
1247
1247
  const hex = color.slice(1);
@@ -1249,12 +1249,12 @@ function colorWithAlpha(color, alpha10) {
1249
1249
  const r = bigint >> 16 & 255;
1250
1250
  const g = bigint >> 8 & 255;
1251
1251
  const b = bigint & 255;
1252
- return `rgba(${r}, ${g}, ${b}, ${alpha10})`;
1252
+ return `rgba(${r}, ${g}, ${b}, ${alpha11})`;
1253
1253
  }
1254
1254
  if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
1255
1255
  const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
1256
1256
  if (result) {
1257
- return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha10})`;
1257
+ return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha11})`;
1258
1258
  }
1259
1259
  }
1260
1260
  return color;
@@ -5132,6 +5132,45 @@ function AdminPageTitle(props) {
5132
5132
  /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ff: "Akrobat Bold", tt: "uppercase", lts: "0.1em", size: "sm", c: "rgba(255,255,255,0.6)", children: locale(props.title) })
5133
5133
  ] });
5134
5134
  }
5135
+ function SwitchPanel({ label, description, checked, onChange, disabled }) {
5136
+ const theme = core.useMantineTheme();
5137
+ const pc = theme.colors[theme.primaryColor];
5138
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5139
+ core.Flex,
5140
+ {
5141
+ justify: "space-between",
5142
+ align: "center",
5143
+ p: "xs",
5144
+ style: {
5145
+ background: core.alpha(theme.colors.dark[5], 0.35),
5146
+ border: "0.1vh solid rgba(255,255,255,0.05)",
5147
+ borderRadius: theme.radius.xs,
5148
+ opacity: disabled ? 0.5 : 1
5149
+ },
5150
+ children: [
5151
+ /* @__PURE__ */ jsxRuntime.jsxs(core.Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
5152
+ typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.85)", children: label }) : label,
5153
+ description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.45)", children: description }) : description)
5154
+ ] }),
5155
+ /* @__PURE__ */ jsxRuntime.jsx(
5156
+ core.Switch,
5157
+ {
5158
+ checked,
5159
+ disabled,
5160
+ onChange: (e) => onChange(e.currentTarget.checked),
5161
+ size: "md",
5162
+ styles: {
5163
+ track: {
5164
+ background: checked ? core.alpha(pc[6], 0.4) : "rgba(255,255,255,0.08)",
5165
+ borderColor: checked ? core.alpha(pc[6], 0.6) : "rgba(255,255,255,0.1)"
5166
+ }
5167
+ }
5168
+ }
5169
+ )
5170
+ ]
5171
+ }
5172
+ );
5173
+ }
5135
5174
  var placementStyle = (placement) => {
5136
5175
  switch (placement) {
5137
5176
  case "top-center":
@@ -5382,32 +5421,13 @@ function ThemeOverrideSection({
5382
5421
  color
5383
5422
  }
5384
5423
  ),
5385
- /* @__PURE__ */ jsxRuntime.jsxs(
5386
- core.Flex,
5424
+ /* @__PURE__ */ jsxRuntime.jsx(
5425
+ SwitchPanel,
5387
5426
  {
5388
- align: "center",
5389
- justify: "space-between",
5390
- p: "xs",
5391
- style: {
5392
- background: `rgba(255,255,255,${editable ? 0.04 : 0.02})`,
5393
- border: `0.1vh solid ${editable ? color : "rgba(255,255,255,0.08)"}`,
5394
- borderRadius: mantineTheme.radius.xs,
5395
- transition: "background 0.15s, border-color 0.15s"
5396
- },
5397
- children: [
5398
- /* @__PURE__ */ jsxRuntime.jsxs(core.Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
5399
- /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.9)", children: locale("OverrideGlobalTheme") || "Override global theme" }),
5400
- /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.4)", children: locale("OverrideGlobalThemeDesc") || "When on, this resource uses its own primary colour and palette instead of dirk_lib's. Turn off to fall back to the global theme \u2014 your custom palette is kept." })
5401
- ] }),
5402
- /* @__PURE__ */ jsxRuntime.jsx(
5403
- core.Switch,
5404
- {
5405
- size: "md",
5406
- checked: value.useOverride,
5407
- onChange: (e) => set("useOverride", e.currentTarget.checked)
5408
- }
5409
- )
5410
- ]
5427
+ label: locale("OverrideGlobalTheme") || "Override global theme",
5428
+ description: locale("OverrideGlobalThemeDesc") || "When on, this resource uses its own primary colour and palette instead of dirk_lib's. Turn off to fall back to the global theme \u2014 your custom palette is kept.",
5429
+ checked: value.useOverride,
5430
+ onChange: (v) => set("useOverride", v)
5411
5431
  }
5412
5432
  ),
5413
5433
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5574,7 +5594,248 @@ function SwatchTile({
5574
5594
  ] });
5575
5595
  }
5576
5596
 
5597
+ // src/utils/gtaAnimPostFx.ts
5598
+ var GTA_ANIM_POST_FX_GROUP_ORDER = [
5599
+ "Wake Up / Sleep",
5600
+ "Character Switch",
5601
+ "Cinematic Push-In",
5602
+ "Death / Fail",
5603
+ "Heist",
5604
+ "Minigame",
5605
+ "Drug / Trip",
5606
+ "Color Filter / Tint",
5607
+ "Multiplayer",
5608
+ "Misc"
5609
+ ];
5610
+ var GTA_ANIM_POST_FX = [
5611
+ // ── Wake Up / Sleep (community-known; not in altV docs) ────────────────────
5612
+ { name: "ULP_PlayerWakeUp", label: "Player Wake Up", group: "Wake Up / Sleep" },
5613
+ { name: "MinigameEndNeutral", label: "Minigame End \u2014 Neutral", group: "Wake Up / Sleep" },
5614
+ { name: "MinigameEndFranklin", label: "Minigame End \u2014 Franklin", group: "Wake Up / Sleep" },
5615
+ { name: "MinigameEndMichael", label: "Minigame End \u2014 Michael", group: "Wake Up / Sleep" },
5616
+ { name: "MinigameEndTrevor", label: "Minigame End \u2014 Trevor", group: "Wake Up / Sleep" },
5617
+ // ── Character Switch (Franklin / Michael / Trevor / Neutral variants) ─────
5618
+ { name: "SwitchHUDIn", group: "Character Switch" },
5619
+ { name: "SwitchHUDOut", group: "Character Switch" },
5620
+ { name: "SwitchHUDFranklinIn", group: "Character Switch" },
5621
+ { name: "SwitchHUDFranklinOut", group: "Character Switch" },
5622
+ { name: "SwitchHUDMichaelIn", group: "Character Switch" },
5623
+ { name: "SwitchHUDMichaelOut", group: "Character Switch" },
5624
+ { name: "SwitchHUDTrevorIn", group: "Character Switch" },
5625
+ { name: "SwitchHUDTrevorOut", group: "Character Switch" },
5626
+ { name: "SwitchOpenFranklin", group: "Character Switch" },
5627
+ { name: "SwitchOpenFranklinIn", group: "Character Switch" },
5628
+ { name: "SwitchOpenFranklinOut", group: "Character Switch" },
5629
+ { name: "SwitchOpenMichaelIn", group: "Character Switch" },
5630
+ { name: "SwitchOpenMichaelMid", group: "Character Switch" },
5631
+ { name: "SwitchOpenMichaelOut", group: "Character Switch" },
5632
+ { name: "SwitchOpenTrevorIn", group: "Character Switch" },
5633
+ { name: "SwitchOpenTrevorOut", group: "Character Switch" },
5634
+ { name: "SwitchOpenNeutralFIB5", group: "Character Switch" },
5635
+ { name: "SwitchOpenNeutralOutHeist", group: "Character Switch" },
5636
+ { name: "SwitchSceneFranklin", group: "Character Switch" },
5637
+ { name: "SwitchSceneMichael", group: "Character Switch" },
5638
+ { name: "SwitchSceneNeutral", group: "Character Switch" },
5639
+ { name: "SwitchSceneTrevor", group: "Character Switch" },
5640
+ { name: "SwitchShortFranklinIn", group: "Character Switch" },
5641
+ { name: "SwitchShortFranklinMid", group: "Character Switch" },
5642
+ { name: "SwitchShortMichaelIn", group: "Character Switch" },
5643
+ { name: "SwitchShortMichaelMid", group: "Character Switch" },
5644
+ { name: "SwitchShortNeutralIn", group: "Character Switch" },
5645
+ { name: "SwitchShortNeutralMid", group: "Character Switch" },
5646
+ { name: "SwitchShortTrevorIn", group: "Character Switch" },
5647
+ { name: "SwitchShortTrevorMid", group: "Character Switch" },
5648
+ { name: "switch_cam_1", group: "Character Switch" },
5649
+ { name: "switch_cam_2", group: "Character Switch" },
5650
+ // ── Cinematic Push-In (slow zoom intro to a character) ────────────────────
5651
+ { name: "CamPushInFranklin", group: "Cinematic Push-In" },
5652
+ { name: "CamPushInMichael", group: "Cinematic Push-In" },
5653
+ { name: "CamPushInTrevor", group: "Cinematic Push-In" },
5654
+ { name: "CamPushInNeutral", group: "Cinematic Push-In" },
5655
+ { name: "BeastIntroScene", label: "Beast Intro", group: "Cinematic Push-In" },
5656
+ { name: "BeastLaunch", group: "Cinematic Push-In" },
5657
+ { name: "BeastTransition", group: "Cinematic Push-In" },
5658
+ // ── Death / Fail (red tint, slow-mo blur) ─────────────────────────────────
5659
+ { name: "DeathFailNeutralIn", group: "Death / Fail" },
5660
+ { name: "DeathFailFranklinIn", group: "Death / Fail" },
5661
+ { name: "DeathFailMichaelIn", group: "Death / Fail" },
5662
+ { name: "DeathFailTrevorIn", group: "Death / Fail" },
5663
+ { name: "DeathFailMPIn", label: "Death Fail \u2014 MP", group: "Death / Fail" },
5664
+ { name: "DeathFailMPDark", label: "Death Fail \u2014 MP Dark", group: "Death / Fail" },
5665
+ { name: "DeathFailOut", group: "Death / Fail" },
5666
+ { name: "Rampage", group: "Death / Fail" },
5667
+ { name: "RampageOut", group: "Death / Fail" },
5668
+ // ── Heist (celebration / locate / pass) ───────────────────────────────────
5669
+ { name: "HeistCelebEnd", group: "Heist" },
5670
+ { name: "HeistCelebPass", group: "Heist" },
5671
+ { name: "HeistCelebPassBW", label: "Heist Celeb Pass (B/W)", group: "Heist" },
5672
+ { name: "HeistCelebToast", group: "Heist" },
5673
+ { name: "HeistLocate", group: "Heist" },
5674
+ { name: "HeistTripSkipFade", group: "Heist" },
5675
+ // ── Minigame / Menu ───────────────────────────────────────────────────────
5676
+ { name: "MenuMGIn", group: "Minigame" },
5677
+ { name: "MenuMGHeistIn", group: "Minigame" },
5678
+ { name: "MenuMGHeistIntro", group: "Minigame" },
5679
+ { name: "MenuMGHeistOut", group: "Minigame" },
5680
+ { name: "MenuMGHeistTint", group: "Minigame" },
5681
+ { name: "MenuMGSelectionIn", group: "Minigame" },
5682
+ { name: "MenuMGSelectionTint", group: "Minigame" },
5683
+ { name: "MenuMGTournamentIn", group: "Minigame" },
5684
+ { name: "MenuMGTournamentTint", group: "Minigame" },
5685
+ { name: "MinigameTransitionIn", group: "Minigame" },
5686
+ { name: "MinigameTransitionOut", group: "Minigame" },
5687
+ // ── Drug / Trip (psychedelic, blur, distortion) ───────────────────────────
5688
+ { name: "DMT_flight", group: "Drug / Trip" },
5689
+ { name: "DMT_flight_intro", group: "Drug / Trip" },
5690
+ { name: "PeyoteIn", group: "Drug / Trip" },
5691
+ { name: "PeyoteOut", group: "Drug / Trip" },
5692
+ { name: "PeyoteEndIn", group: "Drug / Trip" },
5693
+ { name: "PeyoteEndOut", group: "Drug / Trip" },
5694
+ { name: "DrugsDrivingIn", group: "Drug / Trip" },
5695
+ { name: "DrugsDrivingOut", group: "Drug / Trip" },
5696
+ { name: "DrugsMichaelAliensFight", group: "Drug / Trip" },
5697
+ { name: "DrugsMichaelAliensFightIn", group: "Drug / Trip" },
5698
+ { name: "DrugsMichaelAliensFightOut", group: "Drug / Trip" },
5699
+ { name: "DrugsTrevorClownsFight", group: "Drug / Trip" },
5700
+ { name: "DrugsTrevorClownsFightIn", group: "Drug / Trip" },
5701
+ { name: "DrugsTrevorClownsFightOut", group: "Drug / Trip" },
5702
+ { name: "ChopVision", label: "Chop Vision (dog)", group: "Drug / Trip" },
5703
+ // ── Color Filter / Tint (one-off and biker formation filters) ─────────────
5704
+ { name: "PPFilter", group: "Color Filter / Tint" },
5705
+ { name: "PPFilterOut", group: "Color Filter / Tint" },
5706
+ { name: "PPGreen", group: "Color Filter / Tint" },
5707
+ { name: "PPGreenOut", group: "Color Filter / Tint" },
5708
+ { name: "PPOrange", group: "Color Filter / Tint" },
5709
+ { name: "PPOrangeOut", group: "Color Filter / Tint" },
5710
+ { name: "PPPink", group: "Color Filter / Tint" },
5711
+ { name: "PPPinkOut", group: "Color Filter / Tint" },
5712
+ { name: "PPPurple", group: "Color Filter / Tint" },
5713
+ { name: "PPPurpleOut", group: "Color Filter / Tint" },
5714
+ { name: "BikerFilter", group: "Color Filter / Tint" },
5715
+ { name: "BikerFilterOut", group: "Color Filter / Tint" },
5716
+ { name: "BikerFormation", group: "Color Filter / Tint" },
5717
+ { name: "BikerFormationOut", group: "Color Filter / Tint" },
5718
+ { name: "InchOrange", group: "Color Filter / Tint" },
5719
+ { name: "InchOrangeOut", group: "Color Filter / Tint" },
5720
+ { name: "InchPurple", group: "Color Filter / Tint" },
5721
+ { name: "InchPurpleOut", group: "Color Filter / Tint" },
5722
+ { name: "InchPickup", group: "Color Filter / Tint" },
5723
+ { name: "InchPickupOut", group: "Color Filter / Tint" },
5724
+ { name: "TinyRacerGreen", group: "Color Filter / Tint" },
5725
+ { name: "TinyRacerGreenOut", group: "Color Filter / Tint" },
5726
+ { name: "TinyRacerPink", group: "Color Filter / Tint" },
5727
+ { name: "TinyRacerPinkOut", group: "Color Filter / Tint" },
5728
+ { name: "TinyRacerIntroCam", group: "Color Filter / Tint" },
5729
+ { name: "DeadlineNeon", group: "Color Filter / Tint" },
5730
+ // ── Multiplayer (celeb, killstreak, race, etc.) ───────────────────────────
5731
+ { name: "MP_Celeb_Win", group: "Multiplayer" },
5732
+ { name: "MP_Celeb_Win_Out", group: "Multiplayer" },
5733
+ { name: "MP_Celeb_Lose", group: "Multiplayer" },
5734
+ { name: "MP_Celeb_Lose_Out", group: "Multiplayer" },
5735
+ { name: "MP_Celeb_Preload", group: "Multiplayer" },
5736
+ { name: "MP_Celeb_Preload_Fade", group: "Multiplayer" },
5737
+ { name: "MP_Bull_tost", group: "Multiplayer" },
5738
+ { name: "MP_Bull_tost_Out", group: "Multiplayer" },
5739
+ { name: "MP_Killstreak", group: "Multiplayer" },
5740
+ { name: "MP_Killstreak_Out", group: "Multiplayer" },
5741
+ { name: "MP_Loser_Streak_Out", group: "Multiplayer" },
5742
+ { name: "MP_OrbitalCannon", group: "Multiplayer" },
5743
+ { name: "MP_Powerplay", group: "Multiplayer" },
5744
+ { name: "MP_Powerplay_Out", group: "Multiplayer" },
5745
+ { name: "MP_SmugglerCheckpoint", group: "Multiplayer" },
5746
+ { name: "MP_TransformRaceFlash", group: "Multiplayer" },
5747
+ { name: "MP_WarpCheckpoint", group: "Multiplayer" },
5748
+ { name: "MP_corona_switch", group: "Multiplayer" },
5749
+ { name: "MP_intro_logo", group: "Multiplayer" },
5750
+ { name: "MP_job_load", group: "Multiplayer" },
5751
+ { name: "MP_race_crash", group: "Multiplayer" },
5752
+ // ── Misc (success notifs, special weapons, sniper / pause / explosions) ───
5753
+ { name: "SuccessFranklin", group: "Misc" },
5754
+ { name: "SuccessMichael", group: "Misc" },
5755
+ { name: "SuccessNeutral", group: "Misc" },
5756
+ { name: "SuccessTrevor", group: "Misc" },
5757
+ { name: "FocusIn", group: "Misc" },
5758
+ { name: "FocusOut", group: "Misc" },
5759
+ { name: "CrossLine", group: "Misc" },
5760
+ { name: "CrossLineOut", group: "Misc" },
5761
+ { name: "SniperOverlay", group: "Misc" },
5762
+ { name: "ExplosionJosh3", group: "Misc" },
5763
+ { name: "WeaponUpgrade", group: "Misc" },
5764
+ { name: "Dont_tazeme_bro", label: "Don't Taze Me Bro", group: "Misc" },
5765
+ { name: "LostTimeDay", group: "Misc" },
5766
+ { name: "LostTimeNight", group: "Misc" },
5767
+ { name: "PauseMenuOut", group: "Misc" },
5768
+ { name: "pennedIn", group: "Misc" },
5769
+ { name: "PennedInOut", group: "Misc" },
5770
+ { name: "RaceTurbo", group: "Misc" },
5771
+ { name: "DefaultFlash", group: "Misc" }
5772
+ ];
5773
+ function formatGtaAnimPostFx(name) {
5774
+ const entry = GTA_ANIM_POST_FX.find((fx) => fx.name === name);
5775
+ return entry?.label ?? name;
5776
+ }
5777
+ function buildGroupedData2(extraNames = []) {
5778
+ const groups = /* @__PURE__ */ new Map();
5779
+ const seen = /* @__PURE__ */ new Set();
5780
+ for (const fx of GTA_ANIM_POST_FX) {
5781
+ if (seen.has(fx.name)) continue;
5782
+ seen.add(fx.name);
5783
+ if (!groups.has(fx.group)) groups.set(fx.group, []);
5784
+ groups.get(fx.group).push(fx);
5785
+ }
5786
+ const data = GTA_ANIM_POST_FX_GROUP_ORDER.flatMap((g) => {
5787
+ const items = groups.get(g);
5788
+ if (!items || items.length === 0) return [];
5789
+ return [
5790
+ {
5791
+ group: g,
5792
+ items: items.map((fx) => ({
5793
+ value: fx.name,
5794
+ label: formatGtaAnimPostFx(fx.name)
5795
+ }))
5796
+ }
5797
+ ];
5798
+ });
5799
+ const knownNames = new Set(GTA_ANIM_POST_FX.map((fx) => fx.name));
5800
+ const customs = extraNames.filter((n) => n && !knownNames.has(n));
5801
+ if (customs.length > 0) {
5802
+ data.push({
5803
+ group: "Custom",
5804
+ items: customs.map((n) => ({ value: n, label: n }))
5805
+ });
5806
+ }
5807
+ return data;
5808
+ }
5809
+ function AnimPostFxSelect({
5810
+ value,
5811
+ onChange,
5812
+ label = "Screen FX",
5813
+ size = "xs",
5814
+ searchable = true,
5815
+ clearable = true,
5816
+ ...rest
5817
+ }) {
5818
+ const data = buildGroupedData2([value]);
5819
+ return /* @__PURE__ */ jsxRuntime.jsx(
5820
+ core.Select,
5821
+ {
5822
+ label,
5823
+ size,
5824
+ searchable,
5825
+ clearable,
5826
+ maxDropdownHeight: 320,
5827
+ nothingFoundMessage: "No matching effects",
5828
+ placeholder: "Pick an effect...",
5829
+ ...rest,
5830
+ data,
5831
+ value: value || null,
5832
+ onChange: (v) => onChange(v ?? "")
5833
+ }
5834
+ );
5835
+ }
5836
+
5577
5837
  exports.AdminPageTitle = AdminPageTitle;
5838
+ exports.AnimPostFxSelect = AnimPostFxSelect;
5578
5839
  exports.AsyncSaveButton = AsyncSaveButton;
5579
5840
  exports.BlipColorSelect = BlipColorSelect;
5580
5841
  exports.BlipDisplaySelect = BlipDisplaySelect;
@@ -5610,6 +5871,7 @@ exports.PromptModal = PromptModal;
5610
5871
  exports.SegmentedControl = SegmentedControl;
5611
5872
  exports.SegmentedProgress = SegmentedProgress;
5612
5873
  exports.SelectItem = SelectItem;
5874
+ exports.SwitchPanel = SwitchPanel;
5613
5875
  exports.TestBed = TestBed;
5614
5876
  exports.ThemeOverrideSection = ThemeOverrideSection;
5615
5877
  exports.Title = Title;