@@ -1482,11 +1482,9 @@ bp_can_start(const char **reason) {
1482
1482
return (B_FALSE );
1483
1483
}
1484
1484
1485
- if (!ignore_doors_check && (!acf_doors_closed ())) {
1486
- if (reason != NULL ) {
1487
- * reason = _ ("Pushback not yet possible: Doors and hatches "
1485
+ if (reason != NULL && !ignore_doors_check && (!acf_doors_closed ())) {
1486
+ * reason = _ ("Pushback not yet possible: Doors and hatches "
1488
1487
"not all closed." );
1489
- }
1490
1488
return (B_FALSE );
1491
1489
}
1492
1490
@@ -2456,26 +2454,28 @@ disco_win_draw(XPLMWindowID inWindowID, void *inRefcon) {
2456
2454
int w , h , mx , my ;
2457
2455
2458
2456
UNUSED (inRefcon );
2459
- BPGetScreenSizeUIScaled (& w , & h , B_FALSE );
2457
+ // BPGetScreenSizeUIScaled(&w, &h, B_FALSE);
2458
+ h = monitor_def .h ;
2459
+ w = monitor_def .w ;
2460
2460
XPLMGetMouseLocationGlobal (& mx , & my );
2461
2461
2462
2462
XPLMSetGraphicsState (0 , 1 , 0 , 0 , 1 , 0 , 0 );
2463
2463
if (inWindowID == bp_ls .disco_win ) {
2464
- bool_t is_lit = (mx >= w / 2 - 1.5 * disco_buttons [0 ].w &&
2465
- mx <= w / 2 - 0.5 * disco_buttons [0 ].w &&
2466
- my >= h - 1.5 * disco_buttons [0 ].h &&
2467
- my <= h - 0.5 * disco_buttons [0 ].h );
2468
- draw_icon (& disco_buttons [0 ], w / 2 - 1.5 * disco_buttons [0 ].w ,
2469
- h - 1.5 * disco_buttons [0 ].h , 1.0 ,
2464
+ bool_t is_lit = (mx >= monitor_def . x_origin + w / 2 - 1.5 * disco_buttons [0 ].w &&
2465
+ mx <= monitor_def . x_origin + w / 2 - 0.5 * disco_buttons [0 ].w &&
2466
+ my >= monitor_def . y_origin + h - 1.5 * disco_buttons [0 ].h &&
2467
+ my <= monitor_def . y_origin + h - 0.5 * disco_buttons [0 ].h );
2468
+ draw_icon (& disco_buttons [0 ], monitor_def . x_origin + w / 2 - 1.5 * disco_buttons [0 ].w ,
2469
+ monitor_def . y_origin + h - 1.5 * disco_buttons [0 ].h , 1.0 ,
2470
2470
B_FALSE , is_lit );
2471
2471
} else {
2472
- bool_t is_lit = (mx >= w / 2 + 0.5 * disco_buttons [1 ].w &&
2473
- mx <= w / 2 + 1.5 * disco_buttons [1 ].w &&
2474
- my >= h - 1.5 * disco_buttons [1 ].h &&
2475
- my <= h - 0.5 * disco_buttons [1 ].h );
2472
+ bool_t is_lit = (mx >= monitor_def . x_origin + w / 2 + 0.5 * disco_buttons [1 ].w &&
2473
+ mx <= monitor_def . x_origin + w / 2 + 1.5 * disco_buttons [1 ].w &&
2474
+ my >= monitor_def . y_origin + h - 1.5 * disco_buttons [1 ].h &&
2475
+ my <= monitor_def . y_origin + h - 0.5 * disco_buttons [1 ].h );
2476
2476
ASSERT (inWindowID == bp_ls .recon_win );
2477
- draw_icon (& disco_buttons [1 ], w / 2 + 0.5 * disco_buttons [1 ].w ,
2478
- h - 1.5 * disco_buttons [1 ].h , 1.0 ,
2477
+ draw_icon (& disco_buttons [1 ], monitor_def . x_origin + w / 2 + 0.5 * disco_buttons [1 ].w ,
2478
+ monitor_def . y_origin + h - 1.5 * disco_buttons [1 ].h , 1.0 ,
2479
2479
B_FALSE , is_lit );
2480
2480
}
2481
2481
}
@@ -2568,20 +2568,23 @@ disco_intf_show(void) {
2568
2568
};
2569
2569
int w , h ;
2570
2570
2571
- BPGetScreenSizeUIScaled (& w , & h , B_TRUE );
2571
+ initMonitorOrigin ();
2572
+ // BPGetScreenSizeUIScaled(&w, &h, B_TRUE);
2573
+ h = monitor_def .h ;
2574
+ w = monitor_def .w ;
2572
2575
2573
- disco_ops .left = w / 2 - 1.5 * disco_buttons [0 ].w ;
2574
- disco_ops .right = w / 2 - 0.5 * disco_buttons [0 ].w ;
2575
- disco_ops .top = h - 0.5 * disco_buttons [0 ].h ;
2576
- disco_ops .bottom = h - 1.5 * disco_buttons [0 ].h ;
2576
+ disco_ops .left = monitor_def . x_origin + w / 2 - 1.5 * disco_buttons [0 ].w ;
2577
+ disco_ops .right = monitor_def . x_origin + w / 2 - 0.5 * disco_buttons [0 ].w ;
2578
+ disco_ops .top = monitor_def . y_origin + h - 0.5 * disco_buttons [0 ].h ;
2579
+ disco_ops .bottom = monitor_def . y_origin + h - 1.5 * disco_buttons [0 ].h ;
2577
2580
bp_ls .disco_win = XPLMCreateWindowEx (& disco_ops );
2578
2581
ASSERT (bp_ls .disco_win != NULL );
2579
2582
XPLMBringWindowToFront (bp_ls .disco_win );
2580
2583
2581
- disco_ops .left = w / 2 + 0.5 * disco_buttons [1 ].w ;
2582
- disco_ops .right = w / 2 + 1.5 * disco_buttons [1 ].w ;
2583
- disco_ops .top = h - 0.5 * disco_buttons [1 ].h ;
2584
- disco_ops .bottom = h - 1.5 * disco_buttons [1 ].h ;
2584
+ disco_ops .left = monitor_def . x_origin + w / 2 + 0.5 * disco_buttons [1 ].w ;
2585
+ disco_ops .right = monitor_def . x_origin + w / 2 + 1.5 * disco_buttons [1 ].w ;
2586
+ disco_ops .top = monitor_def . y_origin + h - 0.5 * disco_buttons [1 ].h ;
2587
+ disco_ops .bottom = monitor_def . y_origin + h - 1.5 * disco_buttons [1 ].h ;
2585
2588
bp_ls .recon_win = XPLMCreateWindowEx (& disco_ops );
2586
2589
ASSERT (bp_ls .recon_win != NULL );
2587
2590
XPLMBringWindowToFront (bp_ls .recon_win );
@@ -2618,29 +2621,32 @@ main_win_click(XPLMWindowID inWindowID, int x, int y, XPLMMouseStatus inMouse,
2618
2621
2619
2622
static void
2620
2623
main_win_draw (XPLMWindowID inWindowID , void * inRefcon ) {
2621
- int w , h , mx , my ;
2624
+ int h , mx , my ;
2622
2625
2623
2626
UNUSED (inRefcon );
2624
- BPGetScreenSizeUIScaled (& w , & h , B_FALSE );
2627
+ // BPGetScreenSizeUIScaled(&w, &h, B_FALSE);
2628
+ h = monitor_def .h ;
2629
+ //w = monitor_def.w;
2630
+
2625
2631
XPLMGetMouseLocationGlobal (& mx , & my );
2626
2632
2627
2633
XPLMSetGraphicsState (0 , 1 , 0 , 0 , 1 , 0 , 0 );
2628
2634
if (inWindowID == bp_ls .planner_win ) {
2629
- bool_t is_lit = (mx >= 0 &&
2630
- mx <= disco_buttons [2 ].w &&
2631
- my >= h /2 - disco_buttons [2 ].h &&
2632
- my <= h /2 );
2633
- draw_icon (& disco_buttons [2 ], 0 ,
2634
- h /2 - disco_buttons [2 ].h , 1.0 ,
2635
+ bool_t is_lit = (mx >= monitor_def . x_origin &&
2636
+ mx <= monitor_def . x_origin + disco_buttons [2 ].w &&
2637
+ my >= monitor_def . y_origin + h /2 - disco_buttons [2 ].h &&
2638
+ my <= monitor_def . y_origin + h /2 );
2639
+ draw_icon (& disco_buttons [2 ], monitor_def . x_origin ,
2640
+ monitor_def . y_origin + h /2 - disco_buttons [2 ].h , 1.0 ,
2635
2641
B_FALSE , is_lit );
2636
2642
} else {
2637
- bool_t is_lit = (mx >= 0 &&
2638
- mx <= disco_buttons [3 ].w &&
2639
- my >= h /2 - 1.5 * disco_buttons [2 ].h - disco_buttons [3 ].h &&
2640
- my <= h /2 - 1.5 * disco_buttons [2 ].h );
2643
+ bool_t is_lit = (mx >= monitor_def . x_origin &&
2644
+ mx <= monitor_def . x_origin + disco_buttons [3 ].w &&
2645
+ my >= monitor_def . y_origin + h /2 - 1.5 * disco_buttons [2 ].h - disco_buttons [3 ].h &&
2646
+ my <= monitor_def . y_origin + h /2 - 1.5 * disco_buttons [2 ].h );
2641
2647
ASSERT (inWindowID == bp_ls .start_pb_win );
2642
- draw_icon (& disco_buttons [3 ], 0 ,
2643
- h /2 - 1.5 * disco_buttons [2 ].h - disco_buttons [3 ].h , 1.0 ,
2648
+ draw_icon (& disco_buttons [3 ], monitor_def . x_origin ,
2649
+ monitor_def . y_origin + h /2 - 1.5 * disco_buttons [2 ].h - disco_buttons [3 ].h , 1.0 ,
2644
2650
B_FALSE , is_lit );
2645
2651
}
2646
2652
}
@@ -2658,15 +2664,20 @@ main_intf_show(void) {
2658
2664
.handleMouseWheelFunc = nil_win_wheel ,
2659
2665
.refcon = NULL
2660
2666
};
2661
- int w , h ;
2662
- initMonitorOrigin (0 );
2663
- BPGetScreenSizeUIScaled (& w , & h , B_TRUE );
2667
+ int h ;
2668
+ initMonitorOrigin ();
2669
+ //BPGetScreenSizeUIScaled(&w, &h, B_TRUE);
2670
+ h = monitor_def .h ;
2671
+ //w = monitor_def.w;
2672
+
2673
+
2674
+ logMsg ("Orign x %d y %d" ,monitor_def .x_origin ,monitor_def .y_origin );
2664
2675
2665
2676
if (bp_ls .planner_win == NULL ) {
2666
2677
load_icon (& disco_buttons [2 ]);
2667
2678
disco_ops .left = monitor_def .x_origin ; // w / 2 - 1.5 * disco_buttons[0].w;
2668
- disco_ops .right = disco_buttons [2 ].w ;
2669
- disco_ops .top = h /2 ; // - 0.5 * disco_buttons[0].h;
2679
+ disco_ops .right = monitor_def . x_origin + disco_buttons [2 ].w ;
2680
+ disco_ops .top = monitor_def . y_origin + h /2 ; // - 0.5 * disco_buttons[0].h;
2670
2681
disco_ops .bottom = monitor_def .y_origin + h /2 - disco_buttons [2 ].h ;
2671
2682
bp_ls .planner_win = XPLMCreateWindowEx (& disco_ops );
2672
2683
ASSERT (bp_ls .planner_win != NULL );
@@ -2676,8 +2687,8 @@ main_intf_show(void) {
2676
2687
if (bp_ls .start_pb_win == NULL ) {
2677
2688
load_icon (& disco_buttons [3 ]);
2678
2689
disco_ops .left = monitor_def .x_origin ; //w / 2 + 0.5 * disco_buttons[1].w;
2679
- disco_ops .right = disco_buttons [3 ].w ;
2680
- disco_ops .top = h /2 - 1.5 * disco_buttons [2 ].h ;
2690
+ disco_ops .right = monitor_def . x_origin + disco_buttons [3 ].w ;
2691
+ disco_ops .top = monitor_def . y_origin + h /2 - 1.5 * disco_buttons [2 ].h ;
2681
2692
disco_ops .bottom = monitor_def .y_origin + disco_ops .top - disco_buttons [3 ].h ;
2682
2693
bp_ls .start_pb_win = XPLMCreateWindowEx (& disco_ops );
2683
2694
ASSERT (bp_ls .start_pb_win != NULL );
0 commit comments