Skip to content

Commit c706c84

Browse files
committed
fix(efb): navigation not clickable on service page, adjusting service buttons
fixed #150 fix
1 parent 382bacb commit c706c84

3 files changed

Lines changed: 60 additions & 80 deletions

File tree

hdw-common/src/systems/instruments/src/EFB/Assets/A330GroundServiceOutline.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,8 @@ export const A330GroundServiceOutline = ({
2121
aftLeftStatus: boolean;
2222
aftRightStatus: boolean;
2323
}) => (
24-
<svg
25-
id="SVG"
26-
className={className}
27-
xmlns="http://www.w3.org/2000/svg"
28-
width="777"
29-
height="814"
30-
viewBox="0 0 549 576"
31-
style={{
32-
transform: 'rotate(90deg)',
33-
transformOrigin: 'center center',
34-
}}
35-
>
36-
<g id="g1940">
24+
<svg id="SVG" className={className} xmlns="http://www.w3.org/2000/svg" width="777" height="814" viewBox="0 0 549 576">
25+
<g id="g1940" transform="rotate(90 274.5 288)">
3726
<path d="M149.338,265.103l0,45.485" style={{ fill: 'none', stroke: '#4c4c4c', strokeWidth: 1 }} />
3827
<path d="M170.709,265.103l0,45.528" style={{ fill: 'none', stroke: '#4c4c4c', strokeWidth: 1 }} />
3928
<path d="M295.066,265.103l0,45.894" style={{ fill: 'none', stroke: '#4c4c4c', strokeWidth: 1 }} />

hdw-common/src/systems/instruments/src/EFB/Ground/Pages/Services/A330_941/A330Services.tsx

Lines changed: 57 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-strict-ignore
12
// Copyright (c) 2023-2024 FlyByWire Simulations
23
// SPDX-License-Identifier: GPL-3.0
34

@@ -350,7 +351,8 @@ export const A330Services: React.FC = () => {
350351
setBoarding1DoorButtonState,
351352
midLeftDoorOpen,
352353
);
353-
toggleStairs(); break;
354+
toggleStairs();
355+
break;
354356
case ServiceButton.BaggageTruck:
355357
handleComplexService(
356358
ServiceButton.BaggageTruck,
@@ -367,8 +369,8 @@ export const A330Services: React.FC = () => {
367369
ServiceButton.CateringTruck,
368370
cateringButtonStateRef,
369371
setCateringButtonState,
370-
service1DoorButtonState,
371-
setService1DoorButtonState,
372+
service2DoorButtonState,
373+
setService2DoorButtonState,
372374
fwdRightDoorOpen,
373375
);
374376
toggleCateringTruck();
@@ -505,16 +507,16 @@ export const A330Services: React.FC = () => {
505507
);
506508
}, [cargoDoorOpen]);
507509

508-
// Fwd Cabin Door listener for Catering Button
510+
// Mid Cabin Door listener for Catering Button
509511
useEffect(() => {
510512
complexServiceListenerHandling(
511513
cateringButtonStateRef,
512514
setCateringButtonState,
513-
service1DoorButtonState,
514-
setService1DoorButtonState,
515-
fwdRightDoorOpen,
515+
service2DoorButtonState,
516+
setService2DoorButtonState,
517+
midRightDoorOpen,
516518
);
517-
}, [fwdRightDoorOpen]);
519+
}, [midRightDoorOpen]);
518520

519521
// Asu
520522
useEffect(() => {
@@ -645,16 +647,42 @@ export const A330Services: React.FC = () => {
645647
>
646648
<Fan size={36} />
647649
</GroundServiceButton>
650+
</ServiceButtonWrapper>
648651

649-
{/* FUEL TRUCK for 2024 */}
650-
{isMsfs2024() && (
651-
<GroundServiceButton
652-
name={t('Ground.Services.FuelTruck')}
653-
state={fuelTruckButtonState}
654-
onClick={() => handleButtonClick(ServiceButton.FuelTruck)}
652+
<ServiceButtonWrapper xr={930} y={600} className="">
653+
{/* AFT DOOR */}
654+
<GroundServiceButton
655+
name={t('Ground.Services.DoorAft')}
656+
state={boarding2DoorButtonState}
657+
onClick={() => handleButtonClick(ServiceButton.AftLeftDoor)}
658+
>
659+
<DoorClosedFill size={36} />
660+
</GroundServiceButton>
661+
662+
{/* Wheel Chocks and Security Cones are only visual information. To reuse styling */}
663+
{/* the ServiceButtonWrapper has been re-used. */}
664+
{!!wheelChocksEnabled && (
665+
<div
666+
className={`flex cursor-pointer flex-row items-center space-x-6 p-6 ${wheelChocksVisible ? 'text-green-500' : 'text-gray-500'}`}
655667
>
656-
<Truck size={36} />
657-
</GroundServiceButton>
668+
<div
669+
className={`-ml-2 mr-[-2px] flex items-end justify-center ${wheelChocksVisible ? 'text-green-500' : 'text-gray-500'}`}
670+
>
671+
<Chock size="12" stroke="4" />
672+
<Wheel size="36" stroke="5" className="-mx-0.5" />
673+
<Chock size="12" stroke="4" />
674+
</div>
675+
<h1 className="shrink-0 text-2xl font-medium text-current">{t('Ground.Services.WheelChocks')}</h1>
676+
</div>
677+
)}
678+
679+
{!!conesEnabled && (
680+
<div
681+
className={`flex cursor-pointer flex-row items-center space-x-6 p-6 ${conesVisible ? 'text-green-500' : 'text-gray-500'}`}
682+
>
683+
<ConeStriped size="38" stroke="1.5" className="mr-2" />
684+
<h1 className="shrink-0 text-2xl font-medium text-current">{t('Ground.Services.Cones')}</h1>
685+
</div>
658686
)}
659687
</ServiceButtonWrapper>
660688

@@ -714,47 +742,18 @@ export const A330Services: React.FC = () => {
714742
>
715743
<HandbagFill size={36} />
716744
</GroundServiceButton>
717-
</ServiceButtonWrapper>
718745

719-
<ServiceButtonWrapper xr={800} y={600} className="">
720-
{/* AFT DOOR */}
721-
<GroundServiceButton
722-
name={t('Ground.Services.DoorAft')}
723-
state={boarding2DoorButtonState}
724-
onClick={() => handleButtonClick(ServiceButton.AftLeftDoor)}
725-
>
726-
<DoorClosedFill size={36} />
727-
</GroundServiceButton>
728-
</ServiceButtonWrapper>
729-
730-
{/* TODO FIXME: Redesign chocks and security cones UI */}
731-
{/* Wheel Chocks and Security Cones are only visual information. To reuse styling */}
732-
{/* the ServiceButtonWrapper has been re-used. */}
733-
{/*
734-
<ServiceButtonWrapper xr={800} y={600} className="border-0 divide-y-0">
735-
{!!wheelChocksEnabled && (
736-
<div className={`flex flex-row items-center space-x-6 py-6 px-6 cursor-pointer ${(wheelChocksVisible) ? 'text-green-500' : 'text-gray-500'}`}>
737-
<div className={`flex justify-center items-end -ml-2 -mr-[2px] ${(wheelChocksVisible) ? 'text-green-500' : 'text-gray-500'}`}>
738-
<Chock size="12" stroke="4" />
739-
<Wheel size="36" stroke="5" className="-mx-0.5" />
740-
<Chock size="12" stroke="4" />
741-
</div>
742-
<h1 className="flex-shrink-0 text-2xl font-medium text-current">
743-
{t('Ground.Services.WheelChocks')}
744-
</h1>
745-
</div>
746-
)}
747-
748-
{!!conesEnabled && (
749-
<div className={`flex flex-row items-center space-x-6 py-6 px-6 cursor-pointer ${(conesVisible) ? 'text-green-500' : 'text-gray-500'}`}>
750-
<ConeStriped size="38" stroke="1.5" className="mr-2" />
751-
<h1 className="flex-shrink-0 text-2xl font-medium text-current">
752-
{t('Ground.Services.Cones')}
753-
</h1>
754-
</div>
755-
)}
746+
{/* FUEL TRUCK for 2024 */}
747+
{isMsfs2024() && (
748+
<GroundServiceButton
749+
name={t('Ground.Services.FuelTruck')}
750+
state={fuelTruckButtonState}
751+
onClick={() => handleButtonClick(ServiceButton.FuelTruck)}
752+
>
753+
<Truck size={36} />
754+
</GroundServiceButton>
755+
)}
756756
</ServiceButtonWrapper>
757-
*/}
758757

759758
{/* Visual indications for tug and doors */}
760759
{!!pushBackAttached && (
@@ -784,22 +783,13 @@ export const A330Services: React.FC = () => {
784783
)}
785784
{cargoDoorOpen >= 1.0 && (
786785
<div>
787-
<div
788-
className="text-xl font-bold text-utility-amber"
789-
style={{ position: 'absolute', left: 700, right: 0, top: 160 }}
790-
>
786+
<div className={serviceIndicationCss} style={{ position: 'absolute', left: 700, right: 0, top: 160 }}>
791787
FWD CARGO
792788
</div>
793-
<div
794-
className="text-xl font-bold text-utility-amber"
795-
style={{ position: 'absolute', left: 700, right: 0, top: 530 }}
796-
>
789+
<div className={serviceIndicationCss} style={{ position: 'absolute', left: 700, right: 0, top: 530 }}>
797790
AFT CARGO
798791
</div>
799-
<div
800-
className="text-xl font-bold text-utility-amber"
801-
style={{ position: 'absolute', left: 700, right: 0, top: 585 }}
802-
>
792+
<div className={serviceIndicationCss} style={{ position: 'absolute', left: 700, right: 0, top: 585 }}>
803793
BULK
804794
</div>
805795
</div>

hdw-common/src/systems/instruments/src/EFB/Ground/Pages/Services/ServicesPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-strict-ignore
12
// Copyright (c) 2023-2024 FlyByWire Simulations
23
// SPDX-License-Identifier: GPL-3.0
34

0 commit comments

Comments
 (0)