dirk-cfx-react 1.0.35 → 1.0.37
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.
- package/dist/components/index.cjs +16 -16
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +4 -7
- package/dist/components/index.d.ts +4 -7
- package/dist/components/index.js +18 -17
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.cjs +4 -3
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +4 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +496 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +491 -34
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +27 -4
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +27 -4
- package/dist/providers/index.js.map +1 -1
- package/dist/utils/index.cjs +480 -17
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +48 -17
- package/dist/utils/index.d.ts +48 -17
- package/dist/utils/index.js +474 -16
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -170,11 +170,11 @@ var colorNames = {
|
|
|
170
170
|
Yellow: { r: 255, g: 255, b: 0 },
|
|
171
171
|
YellowGreen: { r: 154, g: 205, b: 50 }
|
|
172
172
|
};
|
|
173
|
-
function colorWithAlpha(color,
|
|
173
|
+
function colorWithAlpha(color, alpha2) {
|
|
174
174
|
const lowerCasedColor = color.toLowerCase();
|
|
175
175
|
if (colorNames[lowerCasedColor]) {
|
|
176
176
|
const rgb = colorNames[lowerCasedColor];
|
|
177
|
-
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${
|
|
177
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha2})`;
|
|
178
178
|
}
|
|
179
179
|
if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
|
|
180
180
|
const hex = color.slice(1);
|
|
@@ -182,12 +182,12 @@ function colorWithAlpha(color, alpha) {
|
|
|
182
182
|
const r = bigint >> 16 & 255;
|
|
183
183
|
const g = bigint >> 8 & 255;
|
|
184
184
|
const b = bigint & 255;
|
|
185
|
-
return `rgba(${r}, ${g}, ${b}, ${
|
|
185
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
|
|
186
186
|
}
|
|
187
187
|
if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
|
|
188
188
|
const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
|
|
189
189
|
if (result) {
|
|
190
|
-
return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${
|
|
190
|
+
return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha2})`;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
return color;
|
|
@@ -241,8 +241,6 @@ var useNuiEvent = (action, handler) => {
|
|
|
241
241
|
return () => window.removeEventListener("message", eventListener);
|
|
242
242
|
}, [action]);
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
// src/utils/fetchNui.ts
|
|
246
244
|
async function fetchNui(eventName, data, mockData) {
|
|
247
245
|
const options = {
|
|
248
246
|
method: "post",
|
|
@@ -251,8 +249,9 @@ async function fetchNui(eventName, data, mockData) {
|
|
|
251
249
|
},
|
|
252
250
|
body: JSON.stringify(data)
|
|
253
251
|
};
|
|
254
|
-
|
|
255
|
-
if (isEnvBrowser())
|
|
252
|
+
console.log(mockData);
|
|
253
|
+
if (isEnvBrowser() && mockData) return mockData;
|
|
254
|
+
if (isEnvBrowser() && mockData === void 0) {
|
|
256
255
|
console.warn(
|
|
257
256
|
`[fetchNui] Called fetchNui for event "${eventName}" in browser environment without mockData. Returning empty object.`
|
|
258
257
|
);
|
|
@@ -260,20 +259,31 @@ async function fetchNui(eventName, data, mockData) {
|
|
|
260
259
|
}
|
|
261
260
|
const resourceName = window.GetParentResourceName ? window.GetParentResourceName() : "nui-frame-app";
|
|
262
261
|
const resp = await fetch(`https://${resourceName}/${eventName}`, options);
|
|
263
|
-
|
|
264
|
-
return respFormatted;
|
|
262
|
+
return await resp.json();
|
|
265
263
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
264
|
+
var initialFetches = {};
|
|
265
|
+
async function registerInitialFetch(eventName, data, mockData) {
|
|
266
|
+
const fetcher = () => fetchNui(eventName, data, mockData);
|
|
267
|
+
initialFetches[eventName] = fetcher;
|
|
268
|
+
return fetcher();
|
|
271
269
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
270
|
+
async function runFetches() {
|
|
271
|
+
return Promise.all(
|
|
272
|
+
Object.entries(initialFetches).map(async ([eventName, fetcher]) => {
|
|
273
|
+
const data = await fetcher();
|
|
274
|
+
return { eventName, data };
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
var useAutoFetcher = () => {
|
|
279
|
+
react.useEffect(() => {
|
|
280
|
+
if (isEnvBrowser()) return;
|
|
281
|
+
const run = async () => {
|
|
282
|
+
const results = await runFetches();
|
|
283
|
+
console.log("[useAutoFetcher] Fetched initial data:", results);
|
|
284
|
+
};
|
|
285
|
+
run();
|
|
286
|
+
}, []);
|
|
277
287
|
};
|
|
278
288
|
|
|
279
289
|
// src/utils/internalEvent.ts
|
|
@@ -309,9 +319,454 @@ var localeStore = zustand.create((set, get) => {
|
|
|
309
319
|
};
|
|
310
320
|
});
|
|
311
321
|
var locale = localeStore.getState().locale;
|
|
312
|
-
|
|
322
|
+
registerInitialFetch("GET_LOCALES", void 0).then((data) => {
|
|
313
323
|
localeStore.setState({ locales: data });
|
|
314
324
|
});
|
|
325
|
+
var useProfanityStore = zustand.create(() => [
|
|
326
|
+
"ars3",
|
|
327
|
+
"a55",
|
|
328
|
+
"a55hole",
|
|
329
|
+
"ahole",
|
|
330
|
+
"anus",
|
|
331
|
+
"ash0le",
|
|
332
|
+
"ash0les",
|
|
333
|
+
"asholes",
|
|
334
|
+
"4r5e",
|
|
335
|
+
"5h1t",
|
|
336
|
+
"5hit",
|
|
337
|
+
"a55",
|
|
338
|
+
"anal",
|
|
339
|
+
"anus",
|
|
340
|
+
"ar5e",
|
|
341
|
+
"arrse",
|
|
342
|
+
"arse",
|
|
343
|
+
"ass",
|
|
344
|
+
"ass-fucker",
|
|
345
|
+
"asses",
|
|
346
|
+
"assfucker",
|
|
347
|
+
"assfukka",
|
|
348
|
+
"asshole",
|
|
349
|
+
"assholes",
|
|
350
|
+
"asswhole",
|
|
351
|
+
"a_s_s",
|
|
352
|
+
"b!tch",
|
|
353
|
+
"b00bs",
|
|
354
|
+
"b17ch",
|
|
355
|
+
"b1tch",
|
|
356
|
+
"ballsack",
|
|
357
|
+
"beastial",
|
|
358
|
+
"beastiality",
|
|
359
|
+
"bestial",
|
|
360
|
+
"bestiality",
|
|
361
|
+
"bi+ch",
|
|
362
|
+
"biatch",
|
|
363
|
+
"bitch",
|
|
364
|
+
"bitcher",
|
|
365
|
+
"bitchers",
|
|
366
|
+
"bitches",
|
|
367
|
+
"bitchin",
|
|
368
|
+
"bitching",
|
|
369
|
+
"blow job",
|
|
370
|
+
"blowjob",
|
|
371
|
+
"blowjobs",
|
|
372
|
+
"boiolas",
|
|
373
|
+
"bollock",
|
|
374
|
+
"bollok",
|
|
375
|
+
"boner",
|
|
376
|
+
"boob",
|
|
377
|
+
"boobs",
|
|
378
|
+
"booobs",
|
|
379
|
+
"boooobs",
|
|
380
|
+
"booooobs",
|
|
381
|
+
"booooooobs",
|
|
382
|
+
"breasts",
|
|
383
|
+
"buceta",
|
|
384
|
+
"bunny fucker",
|
|
385
|
+
"butthole",
|
|
386
|
+
"buttmuch",
|
|
387
|
+
"buttplug",
|
|
388
|
+
"c0ck",
|
|
389
|
+
"c0cksucker",
|
|
390
|
+
"carpet muncher",
|
|
391
|
+
"chink",
|
|
392
|
+
"cipa",
|
|
393
|
+
"cl1t",
|
|
394
|
+
"clit",
|
|
395
|
+
"clitoris",
|
|
396
|
+
"clits",
|
|
397
|
+
"cnut",
|
|
398
|
+
"cock",
|
|
399
|
+
"cock-sucker",
|
|
400
|
+
"cockface",
|
|
401
|
+
"cockhead",
|
|
402
|
+
"cockmunch",
|
|
403
|
+
"cockmuncher",
|
|
404
|
+
"cocks",
|
|
405
|
+
"cocksuck",
|
|
406
|
+
"cocksucked",
|
|
407
|
+
"cocksucker",
|
|
408
|
+
"cocksucking",
|
|
409
|
+
"cocksucks",
|
|
410
|
+
"cocksuka",
|
|
411
|
+
"cocksukka",
|
|
412
|
+
"cokmuncher",
|
|
413
|
+
"coksucka",
|
|
414
|
+
"coon",
|
|
415
|
+
"cum",
|
|
416
|
+
"cummer",
|
|
417
|
+
"cumming",
|
|
418
|
+
"cums",
|
|
419
|
+
"cumshot",
|
|
420
|
+
"cunilingus",
|
|
421
|
+
"cunillingus",
|
|
422
|
+
"cunnilingus",
|
|
423
|
+
"cunt",
|
|
424
|
+
"cuntlick",
|
|
425
|
+
"cuntlicker",
|
|
426
|
+
"cuntlicking",
|
|
427
|
+
"cunts",
|
|
428
|
+
"cyalis",
|
|
429
|
+
"cyberfuc",
|
|
430
|
+
"cyberfuck",
|
|
431
|
+
"cyberfucked",
|
|
432
|
+
"cyberfucker",
|
|
433
|
+
"cyberfuckers",
|
|
434
|
+
"cyberfucking",
|
|
435
|
+
"d1ck",
|
|
436
|
+
"dlck",
|
|
437
|
+
"dog-fucker",
|
|
438
|
+
"doggin",
|
|
439
|
+
"dogging",
|
|
440
|
+
"donkeyribber",
|
|
441
|
+
"dyke",
|
|
442
|
+
"ejaculate",
|
|
443
|
+
"ejaculated",
|
|
444
|
+
"ejaculates",
|
|
445
|
+
"ejaculating",
|
|
446
|
+
"ejaculatings",
|
|
447
|
+
"ejaculation",
|
|
448
|
+
"ejakulate",
|
|
449
|
+
"f u c k",
|
|
450
|
+
"f u c k e r",
|
|
451
|
+
"f4nny",
|
|
452
|
+
"fag",
|
|
453
|
+
"fagging",
|
|
454
|
+
"faggitt",
|
|
455
|
+
"faggot",
|
|
456
|
+
"faggs",
|
|
457
|
+
"fagot",
|
|
458
|
+
"fagots",
|
|
459
|
+
"fags",
|
|
460
|
+
"fannyflaps",
|
|
461
|
+
"fannyfucker",
|
|
462
|
+
"fatass",
|
|
463
|
+
"fcuk",
|
|
464
|
+
"fcuker",
|
|
465
|
+
"fcuking",
|
|
466
|
+
"feck",
|
|
467
|
+
"fecker",
|
|
468
|
+
"felching",
|
|
469
|
+
"fellate",
|
|
470
|
+
"fellatio",
|
|
471
|
+
"fingerfuck",
|
|
472
|
+
"fingerfucked",
|
|
473
|
+
"fingerfucker",
|
|
474
|
+
"fingerfuckers",
|
|
475
|
+
"fingerfucking",
|
|
476
|
+
"fingerfucks",
|
|
477
|
+
"fistfuck",
|
|
478
|
+
"fistfucked",
|
|
479
|
+
"fistfucker",
|
|
480
|
+
"fistfuckers",
|
|
481
|
+
"fistfucking",
|
|
482
|
+
"fistfuckings",
|
|
483
|
+
"fistfucks",
|
|
484
|
+
"fuck",
|
|
485
|
+
"fucka",
|
|
486
|
+
"fucked",
|
|
487
|
+
"fucker",
|
|
488
|
+
"fuckers",
|
|
489
|
+
"fuckhead",
|
|
490
|
+
"fuckheads",
|
|
491
|
+
"fuckin",
|
|
492
|
+
"fucking",
|
|
493
|
+
"fuckings",
|
|
494
|
+
"fuckingshitmotherfucker",
|
|
495
|
+
"fuckme",
|
|
496
|
+
"fucks",
|
|
497
|
+
"fuckwhit",
|
|
498
|
+
"fuckwit",
|
|
499
|
+
"fudge packer",
|
|
500
|
+
"fudgepacker",
|
|
501
|
+
"fuk",
|
|
502
|
+
"fuker",
|
|
503
|
+
"fukker",
|
|
504
|
+
"fukkin",
|
|
505
|
+
"fuks",
|
|
506
|
+
"fukwhit",
|
|
507
|
+
"fukwit",
|
|
508
|
+
"fux",
|
|
509
|
+
"fux0r",
|
|
510
|
+
"f_u_c_k",
|
|
511
|
+
"gangbang",
|
|
512
|
+
"gangbanged",
|
|
513
|
+
"gangbangs",
|
|
514
|
+
"gaysex",
|
|
515
|
+
"God",
|
|
516
|
+
"god-dam",
|
|
517
|
+
"god-damned",
|
|
518
|
+
"goddamn",
|
|
519
|
+
"goddamned",
|
|
520
|
+
"homo",
|
|
521
|
+
"jack-off",
|
|
522
|
+
"jerk-off",
|
|
523
|
+
"l3i+ch",
|
|
524
|
+
"l3itch",
|
|
525
|
+
"labia",
|
|
526
|
+
"lusting",
|
|
527
|
+
"m0f0",
|
|
528
|
+
"m0fo",
|
|
529
|
+
"m45terbate",
|
|
530
|
+
"ma5terb8",
|
|
531
|
+
"ma5terbate",
|
|
532
|
+
"masochist",
|
|
533
|
+
"master-bate",
|
|
534
|
+
"masterb8",
|
|
535
|
+
"masterbat*",
|
|
536
|
+
"masterbat3",
|
|
537
|
+
"masterbate",
|
|
538
|
+
"masterbation",
|
|
539
|
+
"masterbations",
|
|
540
|
+
"masturbate",
|
|
541
|
+
"mo-fo",
|
|
542
|
+
"mof0",
|
|
543
|
+
"mothafuck",
|
|
544
|
+
"mothafucka",
|
|
545
|
+
"mothafuckas",
|
|
546
|
+
"mothafuckaz",
|
|
547
|
+
"mothafucked",
|
|
548
|
+
"mothafucker",
|
|
549
|
+
"mothafuckers",
|
|
550
|
+
"mothafuckin",
|
|
551
|
+
"mothafucking",
|
|
552
|
+
"mothafuckings",
|
|
553
|
+
"mothafucks",
|
|
554
|
+
"mother fucker",
|
|
555
|
+
"motherfuck",
|
|
556
|
+
"motherfucked",
|
|
557
|
+
"motherfucker",
|
|
558
|
+
"motherfuckers",
|
|
559
|
+
"motherfuckin",
|
|
560
|
+
"motherfucking",
|
|
561
|
+
"motherfuckings",
|
|
562
|
+
"motherfuckka",
|
|
563
|
+
"motherfucks",
|
|
564
|
+
"muthafecker",
|
|
565
|
+
"muthafuckker",
|
|
566
|
+
"mutherfucker",
|
|
567
|
+
"n1gga",
|
|
568
|
+
"n1gger",
|
|
569
|
+
"nazi",
|
|
570
|
+
"nigg3r",
|
|
571
|
+
"nigg4h",
|
|
572
|
+
"nigga",
|
|
573
|
+
"niggah",
|
|
574
|
+
"niggas",
|
|
575
|
+
"niggaz",
|
|
576
|
+
"nigger",
|
|
577
|
+
"niggers",
|
|
578
|
+
"nob jokey",
|
|
579
|
+
"nobjocky",
|
|
580
|
+
"nobjokey",
|
|
581
|
+
"orgasim",
|
|
582
|
+
"orgasims",
|
|
583
|
+
"orgasm",
|
|
584
|
+
"orgasms",
|
|
585
|
+
"p0rn",
|
|
586
|
+
"penis",
|
|
587
|
+
"penisfucker",
|
|
588
|
+
"phonesex",
|
|
589
|
+
"phuck",
|
|
590
|
+
"phuked",
|
|
591
|
+
"phuking",
|
|
592
|
+
"phukked",
|
|
593
|
+
"phukking",
|
|
594
|
+
"phuks",
|
|
595
|
+
"phuq",
|
|
596
|
+
"pigfucker",
|
|
597
|
+
"pimpis",
|
|
598
|
+
"piss",
|
|
599
|
+
"pissed",
|
|
600
|
+
"pisser",
|
|
601
|
+
"pissers",
|
|
602
|
+
"pisses",
|
|
603
|
+
"pissflaps",
|
|
604
|
+
"pissin",
|
|
605
|
+
"pissing",
|
|
606
|
+
"pissoff",
|
|
607
|
+
"poop",
|
|
608
|
+
"porn",
|
|
609
|
+
"porno",
|
|
610
|
+
"pornography",
|
|
611
|
+
"pornos",
|
|
612
|
+
"prick",
|
|
613
|
+
"pricks",
|
|
614
|
+
"pron",
|
|
615
|
+
"pube",
|
|
616
|
+
"pusse",
|
|
617
|
+
"pussi",
|
|
618
|
+
"pussies",
|
|
619
|
+
"pussy",
|
|
620
|
+
"pussys",
|
|
621
|
+
"rectum",
|
|
622
|
+
"retard",
|
|
623
|
+
"rimjaw",
|
|
624
|
+
"rimming",
|
|
625
|
+
"s hit",
|
|
626
|
+
"s.o.b.",
|
|
627
|
+
"scroat",
|
|
628
|
+
"scrote",
|
|
629
|
+
"scrotum",
|
|
630
|
+
"semen",
|
|
631
|
+
"sex",
|
|
632
|
+
"sh!+",
|
|
633
|
+
"sh!t",
|
|
634
|
+
"sh1t",
|
|
635
|
+
"shemale",
|
|
636
|
+
"shit",
|
|
637
|
+
"shitdick",
|
|
638
|
+
"shite",
|
|
639
|
+
"shited",
|
|
640
|
+
"shitey",
|
|
641
|
+
"shitfuck",
|
|
642
|
+
"shitfull",
|
|
643
|
+
"shithead",
|
|
644
|
+
"shiting",
|
|
645
|
+
"shitings",
|
|
646
|
+
"shits",
|
|
647
|
+
"shitted",
|
|
648
|
+
"shitter",
|
|
649
|
+
"shitters",
|
|
650
|
+
"shitting",
|
|
651
|
+
"shittings",
|
|
652
|
+
"shitty",
|
|
653
|
+
"skank",
|
|
654
|
+
"slut",
|
|
655
|
+
"sluts",
|
|
656
|
+
"smegma",
|
|
657
|
+
"smut",
|
|
658
|
+
"son-of-a-bitch",
|
|
659
|
+
"spac",
|
|
660
|
+
"s_h_i_t",
|
|
661
|
+
"t1tt1e5",
|
|
662
|
+
"t1tties",
|
|
663
|
+
"teets",
|
|
664
|
+
"teez",
|
|
665
|
+
"testical",
|
|
666
|
+
"testicle",
|
|
667
|
+
"titfuck",
|
|
668
|
+
"tits",
|
|
669
|
+
"titt",
|
|
670
|
+
"tittie5",
|
|
671
|
+
"tittiefucker",
|
|
672
|
+
"titties",
|
|
673
|
+
"tittyfuck",
|
|
674
|
+
"tittywank",
|
|
675
|
+
"titwank",
|
|
676
|
+
"tosser",
|
|
677
|
+
"tw4t",
|
|
678
|
+
"twat",
|
|
679
|
+
"twathead",
|
|
680
|
+
"twatty",
|
|
681
|
+
"twunt",
|
|
682
|
+
"twunter",
|
|
683
|
+
"v14gra",
|
|
684
|
+
"v1gra",
|
|
685
|
+
"vagina",
|
|
686
|
+
"viagra",
|
|
687
|
+
"vulva",
|
|
688
|
+
"w00se",
|
|
689
|
+
"whoar",
|
|
690
|
+
"whore",
|
|
691
|
+
"xrated"
|
|
692
|
+
]);
|
|
693
|
+
var isProfanity = (word) => {
|
|
694
|
+
const all = useProfanityStore.getState();
|
|
695
|
+
const profanityArray = Array.isArray(all) ? all : typeof all === "object" && all !== null ? Object.values(all) : [];
|
|
696
|
+
return profanityArray.includes(word);
|
|
697
|
+
};
|
|
698
|
+
function calculateXPForLevel(level, settings) {
|
|
699
|
+
if (level < settings.baseLevel) return 0;
|
|
700
|
+
if (level === 1) return 0;
|
|
701
|
+
if (level === 2) return settings.baseXP;
|
|
702
|
+
let totalXP = settings.baseXP;
|
|
703
|
+
for (let i = 2; i <= level - 1; i++) {
|
|
704
|
+
const baseRuneScapeXP = Math.floor((i + 300 * 2 ** (i / 7)) / 4);
|
|
705
|
+
totalXP += baseRuneScapeXP * settings.modifier;
|
|
706
|
+
}
|
|
707
|
+
return Math.floor(totalXP);
|
|
708
|
+
}
|
|
709
|
+
function generateLevelMap(settings) {
|
|
710
|
+
const levelMap = {};
|
|
711
|
+
for (let level = settings.baseLevel; level <= settings.maxLevel; level++) {
|
|
712
|
+
levelMap[level.toString()] = calculateXPForLevel(level, settings);
|
|
713
|
+
}
|
|
714
|
+
return levelMap;
|
|
715
|
+
}
|
|
716
|
+
function getLevelFromXP(xp, levelMap, settings) {
|
|
717
|
+
for (let level = settings.baseLevel; level <= settings.maxLevel; level++) {
|
|
718
|
+
const xpForLevel = levelMap[level.toString()];
|
|
719
|
+
if (xpForLevel > xp) return level - 1;
|
|
720
|
+
}
|
|
721
|
+
return settings.maxLevel;
|
|
722
|
+
}
|
|
723
|
+
function createSkill(defaultSettings) {
|
|
724
|
+
const useStore2 = zustand.create((set) => ({
|
|
725
|
+
settings: defaultSettings,
|
|
726
|
+
levelMap: generateLevelMap(defaultSettings),
|
|
727
|
+
setSettings: (updater) => set((state) => {
|
|
728
|
+
const newSettings = typeof updater === "function" ? updater(state.settings) : updater;
|
|
729
|
+
return {
|
|
730
|
+
settings: newSettings,
|
|
731
|
+
levelMap: generateLevelMap(newSettings)
|
|
732
|
+
};
|
|
733
|
+
})
|
|
734
|
+
}));
|
|
735
|
+
const useSkill = (xp) => {
|
|
736
|
+
const { settings, levelMap } = useStore2();
|
|
737
|
+
return react.useMemo(() => {
|
|
738
|
+
const currentLevel = getLevelFromXP(xp, levelMap, settings);
|
|
739
|
+
const nextLevel = Math.min(currentLevel + 1, settings.maxLevel);
|
|
740
|
+
const currentLevelXP = levelMap[currentLevel.toString()] || 0;
|
|
741
|
+
const nextLevelXP = levelMap[nextLevel.toString()] || 0;
|
|
742
|
+
const xpInCurrentLevel = xp - currentLevelXP;
|
|
743
|
+
const xpRequiredForLevel = nextLevelXP - currentLevelXP;
|
|
744
|
+
const progressToLevel = xpRequiredForLevel > 0 ? xpInCurrentLevel / xpRequiredForLevel * 100 : 100;
|
|
745
|
+
const xpToNextLevel = Math.max(0, nextLevelXP - xp);
|
|
746
|
+
return {
|
|
747
|
+
currentLevel,
|
|
748
|
+
nextLevel,
|
|
749
|
+
currentLevelXP,
|
|
750
|
+
nextLevelXP,
|
|
751
|
+
progressToLevel: Math.min(100, Math.max(0, progressToLevel)),
|
|
752
|
+
xpToNextLevel
|
|
753
|
+
};
|
|
754
|
+
}, [xp, levelMap, settings]);
|
|
755
|
+
};
|
|
756
|
+
const skill = {
|
|
757
|
+
get settings() {
|
|
758
|
+
return useStore2.getState().settings;
|
|
759
|
+
},
|
|
760
|
+
setSettings: (updater) => {
|
|
761
|
+
useStore2.getState().setSettings(updater);
|
|
762
|
+
},
|
|
763
|
+
useSettings: () => useStore2((state) => state.settings)
|
|
764
|
+
};
|
|
765
|
+
return {
|
|
766
|
+
skill,
|
|
767
|
+
useSkill
|
|
768
|
+
};
|
|
769
|
+
}
|
|
315
770
|
var theme = core.createTheme({
|
|
316
771
|
primaryColor: "dirk",
|
|
317
772
|
primaryShade: 9,
|
|
@@ -431,9 +886,10 @@ var theme = core.createTheme({
|
|
|
431
886
|
var theme_default = theme;
|
|
432
887
|
fontawesomeSvgCore.library.add(freeSolidSvgIcons.fas, freeRegularSvgIcons.far, freeBrandsSvgIcons.fab);
|
|
433
888
|
var useSettings = zustand.create((set) => ({
|
|
434
|
-
game: "
|
|
435
|
-
primaryColor: "
|
|
436
|
-
primaryShade:
|
|
889
|
+
game: "fivem",
|
|
890
|
+
primaryColor: "dirk",
|
|
891
|
+
primaryShade: 9,
|
|
892
|
+
itemImgPath: "https://assets.dirkcfx.com/items/",
|
|
437
893
|
customTheme: {}
|
|
438
894
|
}));
|
|
439
895
|
function DirkProvider(props) {
|
|
@@ -457,6 +913,7 @@ function DirkProvider(props) {
|
|
|
457
913
|
console.log(`Game set to ${game}, applied corresponding font family.: ${document.body.style.fontFamily}`);
|
|
458
914
|
});
|
|
459
915
|
}, [game]);
|
|
916
|
+
useAutoFetcher();
|
|
460
917
|
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineProvider, { theme: mergedTheme, defaultColorScheme: "dark", children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: props.children }) });
|
|
461
918
|
}
|
|
462
919
|
function Wrapper({ children }) {
|
|
@@ -964,7 +1421,7 @@ function SegmentedControl(props) {
|
|
|
964
1421
|
bg: "rgba(33, 33, 33, 0.6)",
|
|
965
1422
|
w: props.w || "fit-content",
|
|
966
1423
|
style: {
|
|
967
|
-
borderRadius: theme2.radius.xs,
|
|
1424
|
+
borderRadius: props.enableRadius !== false ? theme2.radius.xs : 0,
|
|
968
1425
|
overflow: "hidden"
|
|
969
1426
|
},
|
|
970
1427
|
...props,
|
|
@@ -988,6 +1445,7 @@ function SegmentedControl(props) {
|
|
|
988
1445
|
icon: item.icon,
|
|
989
1446
|
rightSection: item.rightSection,
|
|
990
1447
|
fz: props.fz,
|
|
1448
|
+
color: props.color,
|
|
991
1449
|
selected: !props.multi ? props.value === item.value : Array.isArray(props.value) && props.value.includes(item.value),
|
|
992
1450
|
onClick: () => {
|
|
993
1451
|
if (props.multi) {
|
|
@@ -1016,7 +1474,7 @@ function Segment(props) {
|
|
|
1016
1474
|
direction: "column",
|
|
1017
1475
|
align: "center",
|
|
1018
1476
|
h: "100%",
|
|
1019
|
-
bg: props.selected ? colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
|
|
1477
|
+
bg: props.selected ? props.color ? core.alpha(props.color, 0.2) : colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
|
|
1020
1478
|
pos: "relative",
|
|
1021
1479
|
style: {
|
|
1022
1480
|
// position: "relative",
|
|
@@ -1038,10 +1496,10 @@ function Segment(props) {
|
|
|
1038
1496
|
{
|
|
1039
1497
|
icon: props.icon,
|
|
1040
1498
|
initial: {
|
|
1041
|
-
color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1499
|
+
color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1042
1500
|
},
|
|
1043
1501
|
animate: {
|
|
1044
|
-
color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1502
|
+
color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1045
1503
|
},
|
|
1046
1504
|
exit: {
|
|
1047
1505
|
color: "inherit"
|
|
@@ -1057,10 +1515,10 @@ function Segment(props) {
|
|
|
1057
1515
|
{
|
|
1058
1516
|
size: props.fz || "xs",
|
|
1059
1517
|
initial: {
|
|
1060
|
-
color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1518
|
+
color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1061
1519
|
},
|
|
1062
1520
|
animate: {
|
|
1063
|
-
color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1521
|
+
color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
|
|
1064
1522
|
},
|
|
1065
1523
|
exit: {
|
|
1066
1524
|
color: "inherit"
|
|
@@ -1096,7 +1554,7 @@ function Segment(props) {
|
|
|
1096
1554
|
left: 0,
|
|
1097
1555
|
right: 0,
|
|
1098
1556
|
height: "0.2vh",
|
|
1099
|
-
backgroundColor: theme2.colors[theme2.primaryColor][5],
|
|
1557
|
+
backgroundColor: props.color || theme2.colors[theme2.primaryColor][5],
|
|
1100
1558
|
transformOrigin: "center"
|
|
1101
1559
|
}
|
|
1102
1560
|
}
|
|
@@ -1226,7 +1684,6 @@ function Title(props) {
|
|
|
1226
1684
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
1685
|
core.Flex,
|
|
1228
1686
|
{
|
|
1229
|
-
mt: props.mt,
|
|
1230
1687
|
direction: "column",
|
|
1231
1688
|
bg: props.bg || "transparent",
|
|
1232
1689
|
gap: "xs",
|
|
@@ -1313,27 +1770,31 @@ exports.MotionText = MotionText;
|
|
|
1313
1770
|
exports.NavBar = NavBar;
|
|
1314
1771
|
exports.NavigationContext = NavigationContext;
|
|
1315
1772
|
exports.NavigationProvider = NavigationProvider;
|
|
1316
|
-
exports.Segment = Segment;
|
|
1317
1773
|
exports.SegmentedControl = SegmentedControl;
|
|
1318
1774
|
exports.SegmentedProgress = SegmentedProgress;
|
|
1319
1775
|
exports.Title = Title;
|
|
1320
1776
|
exports.TornEdgeSVGFilter = TornEdgeSVGFilter;
|
|
1321
1777
|
exports.colorWithAlpha = colorWithAlpha;
|
|
1322
1778
|
exports.copyToClipboard = copyToClipboard;
|
|
1323
|
-
exports.
|
|
1779
|
+
exports.createSkill = createSkill;
|
|
1324
1780
|
exports.fetchNui = fetchNui;
|
|
1325
|
-
exports.
|
|
1781
|
+
exports.initialFetches = initialFetches;
|
|
1326
1782
|
exports.internalEvent = internalEvent;
|
|
1327
1783
|
exports.isEnvBrowser = isEnvBrowser;
|
|
1784
|
+
exports.isProfanity = isProfanity;
|
|
1328
1785
|
exports.locale = locale;
|
|
1329
1786
|
exports.localeStore = localeStore;
|
|
1330
1787
|
exports.noop = noop;
|
|
1331
1788
|
exports.numberToRoman = numberToRoman;
|
|
1332
1789
|
exports.openLink = openLink;
|
|
1790
|
+
exports.registerInitialFetch = registerInitialFetch;
|
|
1791
|
+
exports.runFetches = runFetches;
|
|
1333
1792
|
exports.splitFAString = splitFAString;
|
|
1793
|
+
exports.useAutoFetcher = useAutoFetcher;
|
|
1334
1794
|
exports.useNavigation = useNavigation;
|
|
1335
1795
|
exports.useNavigationStore = useNavigationStore;
|
|
1336
1796
|
exports.useNuiEvent = useNuiEvent;
|
|
1797
|
+
exports.useProfanityStore = useProfanityStore;
|
|
1337
1798
|
exports.useSettings = useSettings;
|
|
1338
1799
|
exports.useTornEdges = useTornEdges;
|
|
1339
1800
|
//# sourceMappingURL=index.cjs.map
|