Skip to content

Commit

Permalink
Fixed some issues with new SDL UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Apr 2, 2016
1 parent 80b0802 commit fd3c9eb
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 113 deletions.
1 change: 1 addition & 0 deletions GameData/ghpmacro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,4 @@ SkillModRobotics <Stat 1 38>
SkillModLeadership <Stat 1 39>
SkillModDominateAnimal <Stat 1 40>
SkillModPickPockets <Stat 1 41>
IsCharacter <NAtt 3 4 0>
10 changes: 10 additions & 0 deletions Series/ADV_FederatedTerritories.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7870,16 +7870,19 @@ Scene 49 0
job <Cyclops Guard>
SetPersona 4901
SetTeam 2
IsCharacter

Monster Cyclops Guard
name <Nolbu>
home <Guard Post>
job <Cyclops Guard>
SetPersona 4902
SetTeam 2
IsCharacter

Monster Cyclops Progenitor
SetTeam 2
IsCharacter
end

scene 50 0
Expand Down Expand Up @@ -7948,26 +7951,32 @@ scene 50 0
roguechar <P>
SetTeam 2
SetPersona 5001
IsCharacter

Monster Cyclops Guard
SetTeam 2
SetPersona 5002
IsCharacter

Monster Cyclops Guard
SetTeam 2
SetPersona 5003
IsCharacter

Monster Cyclops
SetTeam 2
SetPersona 5004
IsCharacter

Monster Cyclops
SetTeam 2
SetPersona 5005
IsCharacter

Monster Cyclops
SetTeam 2
SetPersona 5006
IsCharacter

STC COMPUTER-2
home <Computer Cell>
Expand Down Expand Up @@ -8813,6 +8822,7 @@ Scene 58 0
SetPersona 5801
chardesc sociable heroic
DAge 12
IsCharacter
end

Scene 59 0
Expand Down
3 changes: 2 additions & 1 deletion Series/TS_LANCE_Z1004_STORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ inv
name <Omega-1004>
job <ROBOT>
sdl_colors <130 143 114 116 100 13 0 230 0>
DAge -17
IsCharacter
DAge 35
chardesc Pragmatic Pragmatic Pragmatic Pragmatic Pragmatic
stat 7 25
stat 8 14
Expand Down
6 changes: 4 additions & 2 deletions coninfo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ implementation
var
msg,job: String;
begin
msg := BStr( NAttValue( NPC^.NA , NAG_CharDescription , NAS_DAge ) + 20 );
msg := msg + ' year old ' + LowerCase( GenderName[ NAttValue( NPC^.NA , NAG_CharDescription , NAS_Gender ) ] );
msg := BStr( NAttValue( NPC^.NA , NAG_CharDescription , NAS_DAge ) + 20 ) + ' year old';
if NAttValue( NPC^.NA , NAG_CharDescription , NAS_Gender ) <> NAV_Undefined then begin
msg := msg + ' ' + LowerCase( GenderName[ NAttValue( NPC^.NA , NAG_CharDescription , NAS_Gender ) ] );
end;
job := SAttValue( NPC^.SA , 'JOB' );
if job <> '' then msg := msg + ' ' + LowerCase( job );
msg := msg + '.';
Expand Down
17 changes: 17 additions & 0 deletions damage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,13 @@ implementation
UsableDescription := msg;
end;

Function RepairFuelDescription( Part: GearPtr ): String;
{ Return a description of the size/type of this movement }
{ system. }
begin
RepairFuelDescription := SkillMan[ Part^.S ].Name + ' ' + BStr( Part^.V ) + ' DP';
end;

Function ExtendedDescription( Part: GearPtr ): String;
{ Provide an extended description telling all about the }
{ attributes of this particular item. }
Expand All @@ -1151,6 +1158,8 @@ implementation
it := ModifierDescription( Part );
end else if Part^.G = GG_Usable then begin
it := UsableDescription( Part );
end else if Part^.G = GG_RepairFuel then begin
it := RepairFuelDescription( Part );
end else if Part^.G = GG_Shield then begin
it := ShieldDescription( Part );

Expand Down Expand Up @@ -1219,6 +1228,14 @@ implementation
end;
end;

Function ListInfo( Part: GearPtr ): SAttPtr;
{ Create a list of strings telling all about this item. }
var
MyInfo: SATtPtr;
begin
MyInfo := Nil;

end;

initialization
Damage_Strings := LoadStringList( Damage_Strings_File );
Expand Down
56 changes: 32 additions & 24 deletions gearutil.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function InGoodModule( Part: GearPtr ): Boolean;
Function UnscaledMaxDamage( Part: GearPtr ): Integer;
Function GearMaxDamage(Part: GearPtr): Integer;
Function GearMaxArmor(Part: GearPtr): Integer;
Function GenericName( Part: GearPtr ): String;
Function GearName(Part: GearPtr): String;
Function FullGearName(Part: GearPtr): String;

Expand Down Expand Up @@ -376,6 +377,35 @@ function InGoodModule( Part: GearPtr ): Boolean;
GearMaxArmor := it;
end;

Function GenericName( Part: GearPtr ): String;
{ Return a generic name for this part. }
begin
case Part^.G of
GG_Module: GenericName := ModuleName(Part);
GG_Mecha: GenericName := MechaName(Part);
GG_Character: GenericName := 'Character';
GG_Cockpit: GenericName := 'Cockpit';
GG_Weapon: GenericName := WeaponName(Part);
GG_Ammo: GenericName := AmmoName(Part);
GG_MoveSys: GenericName := MoveSysName(Part);
GG_Holder: GenericName := HolderName( Part );
GG_Sensor: GenericName := SensorName( Part );
GG_Support: GenericName := SupportName( Part );
GG_Shield: GenericName := ShieldName( Part );
GG_ExArmor: GenericName := ArmorName( Part );
GG_Scene: GenericName := 'Scene ' + BStr( Part^.S );
GG_Swag: GenericName := SwagName( Part );
GG_Prop: GenericName := 'Prop';
GG_MetaTerrain: GenericName := 'Scenery';
GG_Electronics: GenericName := ElecName( Part );
GG_Usable: GenericName := UsableName( Part );
GG_RepairFuel: GenericName := RepairFuelName( Part );
GG_Consumable: GenericName := 'Food';
GG_WeaponAddOn: GenericName := 'Weapon Accessory';
else GenericName := 'Platonic Form';
end;
end;

Function GearName(Part: GearPtr): String;
{Determine the name of Part. If Part has a NAME attribute,}
{this is easy. If not, locate a default name based upon}
Expand All @@ -389,30 +419,7 @@ function InGoodModule( Part: GearPtr ): Boolean;

it := SAttValue(Part^.SA,'NAME');

if it = '' then case Part^.G of
GG_Module: it := ModuleName(Part);
GG_Mecha: it := MechaName(Part);
GG_Character: it := 'Character';
GG_Cockpit: it := 'Cockpit';
GG_Weapon: it := WeaponName(Part);
GG_Ammo: it := AmmoName(Part);
GG_MoveSys: it := MoveSysName(Part);
GG_Holder: it := HolderName( Part );
GG_Sensor: it := SensorName( Part );
GG_Support: it := SupportName( Part );
GG_Shield: it := ShieldName( Part );
GG_ExArmor: it := ArmorName( Part );
GG_Scene: it := 'Scene ' + BStr( Part^.S );
GG_Swag: it := SwagName( Part );
GG_Prop: it := 'Prop';
GG_MetaTerrain: it := 'Scenery';
GG_Electronics: it := ElecName( Part );
GG_Usable: it := UsableName( Part );
GG_RepairFuel: it := RepairFuelName( Part );
GG_Consumable: it := 'Food';
GG_WeaponAddOn: it := 'Weapon Accessory';
else it := 'Platonic Form';
end;
if it = '' then it := GenericName( Part );

if Part^.g = GG_AbsolutelyNothing then it := '~!' + it;

Expand Down Expand Up @@ -1828,4 +1835,5 @@ function CStat( PC: GearPtr; Stat: Integer ): Integer;
ReadCGears := REALReadGears( Nil );
end;


end.
4 changes: 4 additions & 0 deletions ghchars.pp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ interface
NAV_RT_Female = 2;
NAV_RT_Anyone = 3;

NAS_Sentience = 4;
NAV_IsCharacter = 0;
NAV_IsMonster = 1;

{ CharDescription / Personality Traits }
Num_Personality_Traits = 7;
NAS_Heroic = -1; { CharDescription/ Heroic <-> Villanous }
Expand Down
2 changes: 2 additions & 0 deletions ghparser.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,8 @@ implementation
{ If it loaded successfully, set its job to "ANIMAL". }
if Mon <> Nil then begin
SetSATt( Mon^.SA , 'JOB <ANIMAL>' );
SetNAtt( Mon^.NA, NAG_CharDescription, NAS_Gender, NAV_Undefined );
SetNAtt( Mon^.NA, NAG_CharDescription, NAS_Sentience, NAV_IsMonster );
end;

{ Return whatever value was returned. }
Expand Down
2 changes: 2 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Fixed DirKey screen refresh (sdlgfx.pp)
- Set correct age for Omega-1004 (TS_LANCE_Z1004_STORY.txt)
- Added title screen logo (gharena.pas)
- Jump countdown timer fixed (pcaction.pp)
- Updated gender and romance options (ghchars.pp)
Expand Down
9 changes: 8 additions & 1 deletion pcaction.pp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ implementation
end;
end;

Procedure ThisLancemateWasSelectedRedraw;
{ Redraw for the character browser. }
begin
CharViewRedraw();
DisplayTargetInfo( PCACTIONRD_PC, PCACTIONRD_GB, ZONE_CharViewDesc );
end;

Procedure FieldHQRedraw;
{ Do a redraw for the Field HQ. }
var
Expand Down Expand Up @@ -470,7 +477,7 @@ implementation
PCACTIONRD_PC := NPC;
PCACTIONRD_GB := GB;
PCACTIONRD_CAPTION := '';
n := SelectMenu( RPM , @CharViewRedraw );
n := SelectMenu( RPM , @ThisLancemateWasSelectedRedraw );
{$ELSE}
DisplayGearInfo( NPC , GB );
n := SelectMenu( RPM );
Expand Down
25 changes: 14 additions & 11 deletions sdlgfx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -930,32 +930,35 @@ function RPGKey: Char;
{ Return -1 if no good direction was chosen. }
var
K: Char;
DK: Integer;
begin
DK := -2;
repeat
K := RPGKey;
if K = KeyMap[ KMC_East ].KCode then begin
DirKey := 0;
DK := 0;
end else if K = KeyMap[ KMC_SouthEast ].KCode then begin
DirKey := 1;
DK := 1;
end else if K = KeyMap[ KMC_South ].KCode then begin
DirKey := 2;
DK := 2;
end else if K = KeyMap[ KMC_SouthWest ].KCode then begin
DirKey := 3;
DK := 3;
end else if K = KeyMap[ KMC_West ].KCode then begin
DirKey := 4;
DK := 4;
end else if K = KeyMap[ KMC_NorthWest ].KCode then begin
DirKey := 5;
DK := 5;
end else if K = KeyMap[ KMC_North ].KCode then begin
DirKey := 6;
DK := 6;
end else if K = KeyMap[ KMC_NorthEast ].KCode then begin
DirKey := 7;
DK := 7;
end else if K = RPK_TimeEvent then begin
ReDrawer;
DirKey := -2;
GHFlip();
end else begin
DirKey := -1;
DK := -1;
end;
until DirKey <> -2;
until DK <> -2;
DirKey := DK;
end;

Procedure EndOfGameMoreKey;
Expand Down
Loading

0 comments on commit fd3c9eb

Please sign in to comment.