Skip to content

Commit

Permalink
Fixed ViewMecha repair cost, added accessibility config option
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Apr 19, 2016
1 parent 04cf282 commit 59c2a20
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 52 deletions.
121 changes: 71 additions & 50 deletions coninfo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface
implementation

uses crt,ability,damage,gearutil,ghchars,ghmecha,ghmodule,ghweapon,
interact,movement,texutil,congfx,conmap,context;
interact,movement,texutil,congfx,conmap,context,ui4gh;

var
CX,CY: Byte; { Cursor Position }
Expand Down Expand Up @@ -617,60 +617,81 @@ implementation
const
OX = 3;
OY = 2;
DirStr: Array [0..7] of String = (
'E','SE','S','SW','W','NW','N','NE'
);
var
D,Z: Integer;
begin
{ Props are master gears, but they don't get location info. }
if OnTheMap( Part ) and IsMasterGear( Part ) and ( Part^.G <> GG_Prop ) then begin
{ Clear the compass area. }
gotoXY( ZX1 + OX - 1 , ZY1 + OY - 1 );
write( ' ' );
gotoXY( ZX1 + OX - 1 , ZY1 + OY );
write( ' ' );
gotoXY( ZX1 + OX - 1 , ZY1 + OY + 1 );
write( ' ' );

D := NAttValue( Part^.NA , NAG_Location , NAS_D );
Z := MekAltitude( gb , Part );
if Z >= 0 then begin
GotoXY( ZX1 + OX , ZY1 + OY );
TextColor( NeutralGrey );
Write( BStr ( Z ) );

end else begin
GotoXY( ZX1 + OX , ZY1 + OY );
TextColor( PlayerBlue );
Write( BStr ( Abs( Z ) ) );

end;

TextColor( White );
GotoXY( ZX1 + OX + AngDir[D,1] , ZY1 + OY + AngDir[D,2] );
Write( '+' );
TextColor( DarkGray );
GotoXY( ZX1 + OX - AngDir[D,1] , ZY1 + OY - AngDir[D,2] );
Write( '=' );

{ Speedometer. }
if Speedometer( Part ) > 0 then begin
GotoXY( ZX1 + OX - 3 , ZY1 + OY );
if NAttValue( Part^.NA , NAG_Action , NAS_MoveAction ) = NAV_FullSPeed then begin
TextColor( LightCyan );
end else begin
TextColor( Cyan );
end;

Write( 'G' );
GotoXY( ZX1 + OX - 3 , ZY1 + OY + 1 );
TextColor( DarkGray );
Write( 'S' );
end else begin
GotoXY( ZX1 + OX - 3 , ZY1 + OY );
TextColor( DarkGray );
Write( 'G' );
GotoXY( ZX1 + OX - 3 , ZY1 + OY + 1 );
TextColor( Cyan );
Write( 'S' );
if Accessibility_On then begin
{ The accessible nav display uses plain text. }
gotoXY( ZX1 , ZY1 + OY - 1 );
write( ' ' );
gotoXY( ZX1 , ZY1 + OY );
write( ' ' );
gotoXY( ZX1 , ZY1 + OY + 1 );
write( ' ' );

D := NAttValue( Part^.NA , NAG_Location , NAS_D );
Z := MekAltitude( gb , Part );
gotoXY( ZX1 , ZY1 + OY - 1 );
write('Dir:' + DirStr[D]);
gotoXY( ZX1 , ZY1 + OY );
write('Alt:' + BStr(Z));

end else begin
{ Clear the compass area. }
gotoXY( ZX1 + OX - 1 , ZY1 + OY - 1 );
write( ' ' );
gotoXY( ZX1 + OX - 1 , ZY1 + OY );
write( ' ' );
gotoXY( ZX1 + OX - 1 , ZY1 + OY + 1 );
write( ' ' );

D := NAttValue( Part^.NA , NAG_Location , NAS_D );
Z := MekAltitude( gb , Part );
if Z >= 0 then begin
GotoXY( ZX1 + OX , ZY1 + OY );
TextColor( NeutralGrey );
Write( BStr ( Z ) );

end else begin
GotoXY( ZX1 + OX , ZY1 + OY );
TextColor( PlayerBlue );
Write( BStr ( Abs( Z ) ) );

end;

TextColor( White );
GotoXY( ZX1 + OX + AngDir[D,1] , ZY1 + OY + AngDir[D,2] );
Write( '+' );
TextColor( DarkGray );
GotoXY( ZX1 + OX - AngDir[D,1] , ZY1 + OY - AngDir[D,2] );
Write( '=' );

{ Speedometer. }
if Speedometer( Part ) > 0 then begin
GotoXY( ZX1 + OX - 3 , ZY1 + OY );
if NAttValue( Part^.NA , NAG_Action , NAS_MoveAction ) = NAV_FullSPeed then begin
TextColor( LightCyan );
end else begin
TextColor( Cyan );
end;

Write( 'G' );
GotoXY( ZX1 + OX - 3 , ZY1 + OY + 1 );
TextColor( DarkGray );
Write( 'S' );
end else begin
GotoXY( ZX1 + OX - 3 , ZY1 + OY );
TextColor( DarkGray );
Write( 'G' );
GotoXY( ZX1 + OX - 3 , ZY1 + OY + 1 );
TextColor( Cyan );
Write( 'S' );
end;
end;
end;
end;
Expand Down
2 changes: 1 addition & 1 deletion gharena.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{$ENDIF}

const
Version = '1.300';
Version = '1.301';

var
RPM: RPGMenuPtr;
Expand Down
3 changes: 3 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.301 April 19 2016
- Added accessibility option for ASCII mode (ui4gh.pp)
- View Mecha should show correct repair cost (services.pp)
- Shrine prop sturdier (STCdefault.txt)
- Exceeding skill number limit indicated in SDL chargen (randchar.pp)
- Fixed faulty SDL info display when selling items (services.pp)
Expand Down
10 changes: 10 additions & 0 deletions pcaction.pp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,14 @@ implementation
end else begin
AddRPGMenuItem( RPM , 'Enable Name Display' , 9 );
end;
{$ELSE}
if Accessibility_On then begin
AddRPGMenuItem( RPM , 'Disable Accessibility+' , 10 );
end else begin
AddRPGMenuItem( RPM , 'Enable Accessibility+' , 10 );
end;


{$ENDIF}
AddRPGMenuItem( RPM , ' Exit Prefrences' , -1 );
SetItemByValue( RPM , N );
Expand Down Expand Up @@ -394,6 +402,8 @@ implementation
end else if N = 9 then begin
Names_Above_Heads := Not Names_Above_Heads;

end else if N = 10 then begin
Accessibility_On := Not Accessibility_On;
end;

until N = -1;
Expand Down
2 changes: 1 addition & 1 deletion services.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ procedure PurchaseGear( GB: GameBoardPtr; PC,NPC,Part: GearPtr );

{ Add options, depending on the mek. }
if not OnTheMap( Mek ) then AddRPGMenuItem( RPM , MsgString( 'SERVICES_Sell' ) + GearName( Mek ) , 1 );
if TotalRepairableDamage( Mek , 15 ) > 0 then AddRPGMenuItem( RPM , MsgString( 'SERVICES_OSRSP1' ) + ' [$' + BStr( RepairMasterCost( Mek , 15 ) ) + ']' , 2 );
if TotalRepairableDamage( Mek , 15 ) > 0 then AddRPGMenuItem( RPM , MsgString( 'SERVICES_OSRSP1' ) + ' [$' + BStr( ScalePrice(PC,NPC,RepairMasterCost( Mek , 15 )) ) + ']' , 2 );
AddRPGMenuItem( RPM , MsgString( 'SERVICES_SellMekInv' ) , 4 );
AddRPGMenuItem( RPM , MsgString( 'SERVICES_BrowseParts' ) , 3 );
AddRPGMenuItem( RPM , MsgString( 'SERVICES_Exit' ) , -1 );
Expand Down
6 changes: 6 additions & 0 deletions ui4gh.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ interface

UseAdvancedColoring: Boolean = False;

Accessibility_On: Boolean = False;

{ *** SCREEN DIMENSIONS *** }
ScreenRows: Byte = 25;
ScreenColumns: Byte = 80;
Expand Down Expand Up @@ -473,6 +475,9 @@ implementation
end else if cmd = 'AdvancedColors' then begin
UseAdvancedColoring := True;

end else if cmd = 'ACCESSIBILITY_ON' then begin
Accessibility_On := True;

end else if cmd[1] = '#' then begin
S := '';

Expand Down Expand Up @@ -550,6 +555,7 @@ implementation
AddBoolean( 'USETACTICSMODE' , UseTacticsMode );

AddBoolean( 'ADVANCEDCOLORS' , UseAdvancedColoring );
AddBoolean( 'ACCESSIBILITY_ON' , Accessibility_On );

Close(F);
end;
Expand Down

0 comments on commit 59c2a20

Please sign in to comment.