Hack fix for radar crash! Fix other UI elements.

This commit is contained in:
Justin Marshall
2020-06-04 10:00:15 -07:00
parent f90152155d
commit ed73a48ee9
6 changed files with 23 additions and 20 deletions
+9 -9
View File
@@ -571,14 +571,14 @@ void DisplayClass::Set_View_Dimensions(int x, int y, int width, int height)
// ST - 3/1/2019 12:05PM
// Made the below code more consistent with the width calculation. This is needed if we aren't going to draw the tabs at the top of the screen
//
//if (height == -1) {
// TacLeptonHeight = Pixel_To_Lepton(SeenBuff.Get_Height() - y);
// //height = (SeenBuff.Get_Height()-y) / CELL_PIXEL_H;
//}
//else {
// TacLeptonHeight = height * CELL_LEPTON_H;
//}
TacLeptonHeight = height * CELL_LEPTON_H;
if (height == -1) {
TacLeptonHeight = Pixel_To_Lepton(SeenBuff.Get_Height() - y);
//height = (SeenBuff.Get_Height()-y) / CELL_PIXEL_H;
}
else {
TacLeptonHeight = height * CELL_LEPTON_H;
}
//TacLeptonHeight = height * CELL_LEPTON_H;
/*
** Adjust the tactical cell if it is now in an invalid position
@@ -3300,7 +3300,7 @@ int DisplayClass::TacticalClass::Action(unsigned flags, KeyNumType & key)
}
}
return true; //(GadgetClass::Action(0, key));
return (GadgetClass::Action(0, key));
}
+1 -1
View File
@@ -413,7 +413,7 @@ int Do_Menu(char const ** strings, bool )
** specified menu.
*/
WindowList[WINDOW_MENU][WINDOWWIDTH] = (MenuList[0][ITEMWIDTH] + 2) * 8;
WindowList[WINDOW_MENU][WINDOWX] = (19 - (length >> 4)) * 8;
WindowList[WINDOW_MENU][WINDOWX] = ScreenWidth - ((19 - (length >> 4)) * 8);
WindowList[WINDOW_MENU][WINDOWY] = 174 - (unsigned)(MenuList[0][ITEMSHIGH] * (FontHeight+FontYSpacing));
WindowList[WINDOW_MENU][WINDOWHEIGHT] = MenuList[0][ITEMSHIGH] * FontHeight + 5 /*11*/;
+1 -1
View File
@@ -1042,7 +1042,7 @@ bool SidebarClass::Activate(int control)
** activate it on the left side of the screen.
*/
if (IsSidebarActive /*&& X*/) {
Set_View_Dimensions(0, 8 * RESFACTOR, ((320-SIDE_WIDTH)/ICON_PIXEL_W) * RESFACTOR);
Set_View_Dimensions(0, 8 * RESFACTOR, (((ScreenWidth/2)-SIDE_WIDTH)/ICON_PIXEL_W) * RESFACTOR);
IsToRedraw = true;
Help_Text(TXT_NONE);
Repair.Zap();
+8 -5
View File
@@ -1482,7 +1482,7 @@ bool UnitClass::Goto_Clear_Spot(void)
* HISTORY: *
* 06/18/1994 JLB : Created. *
*=============================================================================================*/
bool UnitClass::Try_To_Deploy(void)
bool UnitClass::Try_To_Deploy(bool isScriptUnpack) // jmarshall - added isScriptUnpack
{
assert(Units.ID(this) == ID);
assert(IsActive);
@@ -1498,7 +1498,10 @@ bool UnitClass::Try_To_Deploy(void)
CELL cell = Coord_Cell(Adjacent_Cell(Center_Coord(), FACING_NW));
if (!BuildingTypeClass::As_Reference(STRUCT_CONST).Legal_Placement(cell)) {
if (PlayerPtr == House) {
Speak(VOX_DEPLOY);
// jmarshall: Don't play failure to deploy if the map script is trying to deploy the unit.
if (!isScriptUnpack) {
Speak(VOX_DEPLOY);
}
}
if (!House->IsHuman) {
BuildingTypeClass::As_Reference(STRUCT_CONST).Flush_For_Placement(cell, House);
@@ -1629,7 +1632,7 @@ void UnitClass::Per_Cell_Process(PCPType why)
** preparing to deploy. In this case, it should begin its deploy process.
*/
if (IsDeploying) {
Try_To_Deploy();
Try_To_Deploy(false);
if (!IsActive) return; // Unit no longer exists -- bail.
}
}
@@ -2574,7 +2577,7 @@ int UnitClass::Mission_Unload(void)
case 1:
if (!IsDriving) {
Try_To_Deploy();
Try_To_Deploy(true);
if (IsActive) {
if (IsDeploying) {
Status = 2;
@@ -2984,7 +2987,7 @@ int UnitClass::Mission_Hunt(void)
*/
case FIND_SPOT:
if (Goto_Clear_Spot()) {
if (Try_To_Deploy()) {
if (Try_To_Deploy(false)) {
Status = WAITING;
}
}
+1 -1
View File
@@ -134,7 +134,7 @@ class UnitClass : public DriveClass
static void Init(void);
bool Goto_Clear_Spot(void);
bool Try_To_Deploy(void);
bool Try_To_Deploy(bool isScriptUnpack);
virtual void Scatter(COORDINATE threat, bool forced=false, bool nokidding=false);
bool Tiberium_Check(CELL &center, int x, int y);
+3 -3
View File
@@ -2252,7 +2252,7 @@ rept_loop:
shr ebx , 5
imul ecx , - 13
mov [ counter_x ] , ebx
lea ecx , [ remapref_point + ecx ]
lea ecx , [ remapref_point ]
mov [ entry ] , ecx
remapoutter_loop:
@@ -2495,7 +2495,7 @@ rept_loop:
imul ecx , -13
shr ebx , 5
mov [ counter_x ] , ebx
lea ecx , [ trans_ref_point + ecx ]
lea ecx , [ trans_ref_point ]
mov [ entry ] , ecx
trans_outter_loop:
@@ -2558,7 +2558,7 @@ rept_loop2:
shr ebx , 5
imul ecx , - 17
mov [ counter_x ] , ebx
lea ecx , [ trans_remapref_point + ecx ]
lea ecx , [ trans_remapref_point ]
mov [ entry ] , ecx
trans_remapoutter_loop: