diff --git a/Design/Claymore.txt b/Design/Claymore.txt index 9ef664e..eca0eea 100644 --- a/Design/Claymore.txt +++ b/Design/Claymore.txt @@ -2,6 +2,7 @@ Battroid 6 Name Desig SDL_Sprite +SDL_Portrait Desc Mod Body diff --git a/GameData/messages.txt b/GameData/messages.txt index 77a50b6..003d583 100644 --- a/GameData/messages.txt +++ b/GameData/messages.txt @@ -642,7 +642,11 @@ GENDER_3 MAX_SPEED PHONE_INSTRUCTIONS SELECTGENDER_NONBINARY - - - +ColorSet_0 +ColorSet_1 +ColorSet_2 +ColorSet_3 +ColorSet_4 +ColorSet_5 +ColorSet_6
diff --git a/Image/aaGradientTest.png b/Image/aaGradientTest.png new file mode 100644 index 0000000..a3385ec Binary files /dev/null and b/Image/aaGradientTest.png differ diff --git a/Image/mecha_claymore.png b/Image/mecha_claymore.png new file mode 100644 index 0000000..e61a6d9 Binary files /dev/null and b/Image/mecha_claymore.png differ diff --git a/Series/TS_GSP_Hermit_STORY.txt b/Series/TS_GSP_Hermit_STORY.txt index 5914d4f..861187e 100644 --- a/Series/TS_GSP_Hermit_STORY.txt +++ b/Series/TS_GSP_Hermit_STORY.txt @@ -15,7 +15,8 @@ Story GoDelete sub Persona 3 - greeting + % V99 = History counter + greeting GoNoMaster result1 diff --git a/Series/TS_MIL_Default_PLOT_Default.txt b/Series/TS_MIL_Default_PLOT_Default.txt index d4c6b73..9a32dfc 100644 --- a/Series/TS_MIL_Default_PLOT_Default.txt +++ b/Series/TS_MIL_Default_PLOT_Default.txt @@ -225,7 +225,7 @@ sub Msg16_3 Msg16_4 Msg16_5 - Msg16_6 + Msg16_6 CMsg16_6 Msg16_7 CMsg16_7 diff --git a/colormenu.pp b/colormenu.pp index da2fe90..c9c876a 100644 --- a/colormenu.pp +++ b/colormenu.pp @@ -66,8 +66,8 @@ implementation cm_panel_width = 600; cm_panel_height = 456; - cm_window_x = 100; - cm_window_y = 65; + cm_window_dx = -cm_panel_width div 2; + cm_window_dy = -230; cm_image_x_offset = 20; cm_image_y_offset = 20; @@ -82,19 +82,19 @@ implementation off_swatches_x = 3; off_swatches_y = 19; - ZONE_colormenu_base: TSDL_Rect = ( x: cm_window_x; y: cm_window_y; w: cm_panel_width; h: cm_panel_height ); - ZONE_colormenu_sprite: TSDL_Rect = ( x: cm_window_x + cm_image_x_offset; y: cm_window_y + cm_image_y_offset; w: 211; h: 308 ); + ZONE_colormenu_base: DynamicRect = ( dx: cm_window_dx; dy: cm_window_dy; w: cm_panel_width; h: cm_panel_height; anchor: ANC_MIDDLE ); + ZONE_colormenu_sprite: DynamicRect = ( dx: cm_image_x_offset+cm_window_dx; dy: cm_window_dy + cm_image_y_offset; w: 211; h: 308; anchor: ANC_MIDDLE ); - ZONE_colorselectionboxes: Array [1..3] of TSDL_Rect = ( - ( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start; w: 600; h: 145 ), - ( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start + cm_swatchzone_height; w: 600; h: 145 ), - ( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start + 2 * cm_swatchzone_height; w: 600; h: 145 ) + ZONE_colorselectionboxes: Array [1..3] of DynamicRect = ( + ( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start; w: 600; h: 145; anchor: ANC_MIDDLE ), + ( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start + cm_swatchzone_height; w: 600; h: 145; anchor: ANC_MIDDLE ), + ( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start + 2 * cm_swatchzone_height; w: 600; h: 145; anchor: ANC_MIDDLE ) ); - ZONE_swatch_area: Array [1..3] of TSDL_Rect = ( - ( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows ), - ( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows ), - ( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + 2 * cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows ) + ZONE_swatch_area: Array [1..3] of DynamicRect = ( + ( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE ), + ( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE ), + ( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + 2 * cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE ) ); var @@ -191,13 +191,14 @@ implementation if colormenu_ReDrawer <> Nil then colormenu_ReDrawer; { Display the panel. } - ClearExtendedBorder( ZONE_colormenu_base ); - SDL_FillRect( game_screen , @ZONE_colormenu_base , SDL_MapRGB( Game_Screen^.Format , PlayerBlue.R , PlayerBlue.G , PlayerBlue.B ) ); - DrawSprite( cm_panel , ZONE_colormenu_base , 0 ); + MyDest := ZONE_colormenu_base.GetRect(); + ClearExtendedBorder( MyDest ); + SDL_FillRect( game_screen , @MyDest , SDL_MapRGB( Game_Screen^.Format , PlayerBlue.R , PlayerBlue.G , PlayerBlue.B ) ); + DrawSprite( cm_panel , MyDest , 0 ); { Display the sprite we're editing. } MySprite := ConfirmSprite( colormenu_imagename, colormenu_imagepalette, colormenu_imagewidth, colormenu_imageheight ); - MyDest := ZONE_colormenu_sprite; + MyDest := ZONE_colormenu_sprite.GetRect(); if MySprite <> Nil then begin MyDest.X := MyDest.X + ( MyDest.W div 2 ) - ( colormenu_imagewidth div 2 ); MyDest.Y := MyDest.Y + ( MyDest.H div 2 ) - ( colormenu_imageheight div 2 ); @@ -214,9 +215,9 @@ implementation { Display the three color swatch areas. } for t := 1 to 3 do begin if t = colormenu_channel then begin - DrawColorSelectionBox( ZONE_colorselectionboxes[t], colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], colormenu_Curs_X, colormenu_Curs_Y ); + DrawColorSelectionBox( ZONE_colorselectionboxes[t].GetRect(), colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], colormenu_Curs_X, colormenu_Curs_Y ); end else begin - DrawColorSelectionBox( ZONE_colorselectionboxes[t], colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], -1, -1 ); + DrawColorSelectionBox( ZONE_colorselectionboxes[t].GetRect(), colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], -1, -1 ); end; end; end; @@ -252,15 +253,17 @@ implementation { Alright, so the mouse button has just been pressed. Figure out if it hit anything } { interesting and maybe change one of the color pens. } var + MyHit: TSDL_Rect; T,C,HitX,HitY: Integer; begin { There are three color channels to worry about. See if it hit any of those. } for t := 1 to 3 do begin - if ( Mouse_X >= ZONE_swatch_area[t].X ) and ( Mouse_Y >= ZONE_swatch_area[t].Y ) and ( Mouse_X < ( ZONE_swatch_area[t].X + ZONE_swatch_area[t].W ) ) and ( Mouse_Y < ( ZONE_swatch_area[t].Y + ZONE_swatch_area[t].H ) ) then begin + MyHit := ZONE_swatch_area[t].GetRect(); + if ( Mouse_X >= MyHit.X ) and ( Mouse_Y >= MyHit.Y ) and ( Mouse_X < ( MyHit.X + MyHit.W ) ) and ( Mouse_Y < ( MyHit.Y + MyHit.H ) ) then begin { Alright, we're in the hit box. We've definitely hit a swatch, if there's one at this position. } { Determine HitX and HitY. } - HitX := ( Mouse_X - ZONE_swatch_area[t].X ) div Swatch_Width; - HitY := ( Mouse_Y - ZONE_swatch_area[t].Y ) div Swatch_Height; + HitX := ( Mouse_X - MyHit.X ) div Swatch_Width; + HitY := ( Mouse_Y - MyHit.Y ) div Swatch_Height; { Now the question becomes, is there a color at this area? } colormenu_channel := T; diff --git a/gharena.pas b/gharena.pas index 17f26b6..7c91641 100644 --- a/gharena.pas +++ b/gharena.pas @@ -30,7 +30,7 @@ {$IFNDEF DEBUG} {$APPTYPE GUI} {$ENDIF} -uses gears,sdlgfx,arenahq,sdlmenus,randchar,navigate,sdlmap; +uses gears,sdlgfx,arenahq,sdlmenus,randchar,navigate,sdlmap,ghchars; {$ELSE} uses gears,congfx,arenahq,conmenus,randchar,navigate,context,mapedit; {$ENDIF} @@ -45,6 +45,19 @@ {$IFDEF SDLMODE} MyLogo: SensibleSpritePtr; +Procedure GenNames; +var + t: Integer; + mylist: SAttPtr; +begin + mylist := Nil; + for t := 1 to 10000 do begin + StoreSAtt( mylist, RandomName ); + end; + SaveStringList( 'names.txt', mylist ); + DisposeSAtt( mylist ); +end; + Procedure MainMenuRedraw; { Draw the opening screen, and add the infobox + logo. } begin @@ -76,6 +89,8 @@ AddRPGMenuItem( RPM , 'View Design Files' , 7 ); AddRPGMenuItem( RPM , 'Quit Game' , -1 ); + {GenNames();} + repeat {$IFNDEF SDLMODE} ClrScreen; diff --git a/history.txt b/history.txt index 7ecb9de..bcb2cbd 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,8 @@ +- Fixed problem with SanitizeFilename on Windows (pcaction.pp,navigate.pp) +- Some illegal characters removed from filenames (texutil.pp) +- FillRectWithSprite can now accept x,y offsets (sdlgfx.pp) +- ColorMenu is properly centered when screen is resized (colormenu.pp) + 1.302 June 26 2016 - Fixed lone enemy bug in SCENE_CaptureMecha.txt - Updated PLOT_BanditJob1.txt, PLOT_BanditJob2.txt, PLOT_BanditJob3.txt, diff --git a/pcaction.pp b/pcaction.pp index 9c9bdf6..932330f 100644 --- a/pcaction.pp +++ b/pcaction.pp @@ -1434,7 +1434,9 @@ implementation end; { Find the PC's name, open the file, and save. } - Name := Save_Campaign_Base + PilotName( PC ) + Default_File_Ending; + Name := PilotName( PC ); + SanitizeFilename( Name ); + Name := Save_Campaign_Base + Name + Default_File_Ending; Assign( F , Name ); Rewrite( F ); WriteCampaign( Camp , F ); diff --git a/randchar.pp b/randchar.pp index b63a181..c1fd90a 100644 --- a/randchar.pp +++ b/randchar.pp @@ -115,7 +115,11 @@ implementation while ( Leader <> Nil ) and ( ( Leader^.G <> GG_Character ) or ( NAttValue( Leader^.NA , NAG_CharDescription , NAS_CharType ) <> 0 ) ) do Leader := Leader^.Next; if Leader = Nil then Exit; - FName := Save_Character_Base + GearName(Leader) + Default_File_Ending; + FName := GearName( Leader ); + SanitizeFilename( FName ); + + FName := Save_Character_Base + FName + Default_File_Ending; + Assign( F , FName ); Rewrite( F ); WriteCGears( F , PC ); diff --git a/sdlgfx.pp b/sdlgfx.pp index 816fb5b..6b8fc8b 100644 --- a/sdlgfx.pp +++ b/sdlgfx.pp @@ -143,7 +143,7 @@ interface ZONE_ShopText: DynamicRect = ( dx:-225; dy: -230; w: 287; h: 170; anchor: ANC_middle ); ZONE_ShopPCName: DynamicRect = ( dx:-330; dy: -30; w: 100; h: 32; anchor: ANC_middle ); ZONE_ShopPCPortrait: DynamicRect = ( dx:-330; dy: -10; w: 100; h: 150; anchor: ANC_middle ); - ZONE_ShopMenu: DynamicRect = ( dx:-225; dy: -30; w: 287; h: 190; anchor: ANC_middle ); + ZONE_ShopMenu: DynamicRect = ( dx:-225; dy: -30; w: 287; h: 170; anchor: ANC_middle ); ZONE_ShopInfo: DynamicRect = (dx:85; dY:-225; W: 250; H: 340; anchor: ANC_middle); ZONE_ShopCash: DynamicRect = ( dx:135; dy: 130; w: 150; h: 16; anchor: ANC_middle ); @@ -199,6 +199,10 @@ procedure DrawSprite( Spr: SensibleSpritePtr; MyDest: TSDL_Rect; Frame: Integer procedure DrawAlphaSprite( Spr: SensibleSpritePtr; MyDest: TSDL_Rect; Frame: Integer ); Function ConfirmSprite( Name: String; const Color: String; W,H: Integer ): SensibleSpritePtr; +Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame,OffX,OffY: Integer ); +Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer ); + + function RPGKey: Char; Procedure ClrZone( var Z: TSDL_Rect ); Procedure ClrScreen; @@ -1069,7 +1073,7 @@ function RPGKey: Char; GrowRect := MyRect; end; -Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer ); +Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame,OffX,OffY: Integer ); { Fill this area of the screen perfectly with the provided sprite. } var MyDest: TSDL_Rect; @@ -1079,6 +1083,9 @@ function RPGKey: Char; GridH := MyRect.H div MySprite^.H + 1; SDL_SetClipRect( Game_Screen , @MyRect ); + MyRect.X := MyRect.X + (OffX mod MySprite^.W) - MySprite^.W; + MyRect.Y := MyRect.Y + (OffY mod MySprite^.H) - MySprite^.H; + { Draw the backdrop. } for X := 0 to GridW do begin MyDest.X := MyRect.X + X * MySprite^.W; @@ -1091,6 +1098,12 @@ function RPGKey: Char; SDL_SetClipRect( Game_Screen , Nil ); end; +Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer ); + { Do a FillRect with offset 0,0. } +begin + FillRectWithSprite( MyRect, MySprite, MyFrame, 0, 0 ); +end; + Procedure InfoBox( MyBox: TSDL_Rect ); { Do a box for drawing something else inside of. } const diff --git a/sdlinfo.pp b/sdlinfo.pp index eb8d198..f5f9d0e 100644 --- a/sdlinfo.pp +++ b/sdlinfo.pp @@ -752,7 +752,6 @@ implementation CDest := ZONE_PCInfo; { Error check } - { Note that we want the area cleared, even in case of an error. } if Part = Nil then exit; { Depending upon PART's type, branch to an appropriate procedure. } diff --git a/texutil.pp b/texutil.pp index d42c44e..a061431 100644 --- a/texutil.pp +++ b/texutil.pp @@ -54,6 +54,8 @@ interface Procedure ReplacePat( var msg: String; const pat_in,s: String ); Function ReplaceHash( const msg, s: String ): String; +Procedure SanitizeFilename( var S: String ); + implementation @@ -393,4 +395,19 @@ function IsAlpha( C: Char ): Boolean; ReplaceHash := msg_out; end; +Procedure SanitizeFilename( var S: String ); + { Replace all proscribed characters with an underscore. } +const + ProscribedCharacters = ',?"*~#%&{}:<>+|'; +var + T: Integer; +begin + for T := 1 to Length( S ) do begin + if Pos( S[T] , ProscribedCharacters ) > 0 then begin + S[T] := '_'; + end; + end; +end; + + end.