From 59c2a20fb0e5e5e206626037c94d9b21629632ad Mon Sep 17 00:00:00 2001 From: Joseph Hewitt Date: Tue, 19 Apr 2016 05:41:37 -0700 Subject: [PATCH] Fixed ViewMecha repair cost, added accessibility config option --- coninfo.pp | 121 ++++++++++++++++++++++++++++++---------------------- gharena.pas | 2 +- history.txt | 3 ++ pcaction.pp | 10 +++++ services.pp | 2 +- ui4gh.pp | 6 +++ 6 files changed, 92 insertions(+), 52 deletions(-) diff --git a/coninfo.pp b/coninfo.pp index 116e89e..008986e 100644 --- a/coninfo.pp +++ b/coninfo.pp @@ -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 } @@ -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; diff --git a/gharena.pas b/gharena.pas index 5c4bb95..6c34d78 100644 --- a/gharena.pas +++ b/gharena.pas @@ -36,7 +36,7 @@ {$ENDIF} const - Version = '1.300'; + Version = '1.301'; var RPM: RPGMenuPtr; diff --git a/history.txt b/history.txt index 11483d5..92204df 100644 --- a/history.txt +++ b/history.txt @@ -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) diff --git a/pcaction.pp b/pcaction.pp index 668f782..9ecd26d 100644 --- a/pcaction.pp +++ b/pcaction.pp @@ -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 ); @@ -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; diff --git a/services.pp b/services.pp index 43a0470..856449f 100644 --- a/services.pp +++ b/services.pp @@ -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 ); diff --git a/ui4gh.pp b/ui4gh.pp index 7743e54..cd13830 100644 --- a/ui4gh.pp +++ b/ui4gh.pp @@ -95,6 +95,8 @@ interface UseAdvancedColoring: Boolean = False; + Accessibility_On: Boolean = False; + { *** SCREEN DIMENSIONS *** } ScreenRows: Byte = 25; ScreenColumns: Byte = 80; @@ -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 := ''; @@ -550,6 +555,7 @@ implementation AddBoolean( 'USETACTICSMODE' , UseTacticsMode ); AddBoolean( 'ADVANCEDCOLORS' , UseAdvancedColoring ); + AddBoolean( 'ACCESSIBILITY_ON' , Accessibility_On ); Close(F); end;