Skip to content

Commit

Permalink
Merge pull request #12 from softbie/11-graphic-fixes
Browse files Browse the repository at this point in the history
Графические доработки
  • Loading branch information
13Hz authored Jun 20, 2024
2 parents b2c58e2 + a2acb87 commit 588e346
Show file tree
Hide file tree
Showing 18 changed files with 3,176 additions and 3,131 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/Characters/
/Data/
/Graphics/
/Photo Album/
/Sound/
Expand Down
2 changes: 2 additions & 0 deletions Data.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Function SaveOptions()
file=WriteFile("Data/Options.dat")
;preferences
WriteInt file,optRes
WriteInt file,optWindowed
WriteInt file,optPopulation
WriteInt file,optFog
WriteInt file,optShadows
Expand Down Expand Up @@ -38,6 +39,7 @@ Function LoadOptions()
file=ReadFile("Data/Options.dat")
;preferences
optRes=ReadInt(file)
optWindowed=ReadInt(file)
optPopulation=ReadInt(file)
optFog=ReadInt(file)
optShadows=ReadInt(file)
Expand Down
Binary file added Data/Options.dat
Binary file not shown.
95 changes: 67 additions & 28 deletions Menus.bb
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,52 @@ While go=0
;highlight options
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=9
If foc>9 Then foc=1
If foc<1 Then foc=10
If foc>10 Then foc=1
;browse left
If KeyDown(203) Or JoyXDir()=-1
If foc=1 Then optRes=optRes-1 : PlaySound sMenuBrowse : keytim=6
If foc=2 Then optPopulation=optPopulation-5 : PlaySound sMenuBrowse : keytim=6
If foc=3 Then optFog=optFog-1 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optShadows=optShadows-1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optFX=optFX-1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optGore=optGore-1 : PlaySound sMenuBrowse : keytim=6
If foc=1
optRes=optRes-1
If optRes<1 Then optRes=1 Else ChangeResolution(optRes, 1)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=2
optWindowed=optWindowed-1
If optWindowed<0 Then optWindowed=1
ChangeWindowed(optWindowed)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=3 Then optPopulation=optPopulation-5 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optFog=optFog-1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optShadows=optShadows-1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optFX=optFX-1 : PlaySound sMenuBrowse : keytim=6
If foc=7 Then optGore=optGore-1 : PlaySound sMenuBrowse : keytim=6
EndIf
;browse right
If KeyDown(205) Or JoyXDir()=1
If foc=1 Then optRes=optRes+1 : PlaySound sMenuBrowse : keytim=6
If foc=2 Then optPopulation=optPopulation+5 : PlaySound sMenuBrowse : keytim=6
If foc=3 Then optFog=optFog+1 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optShadows=optShadows+1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optFX=optFX+1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optGore=optGore+1 : PlaySound sMenuBrowse : keytim=6
If foc=1
optRes=optRes+1
If optRes > 6 Then optRes=6 Else ChangeResolution(optRes, 1)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=2
optWindowed=optWindowed+1
If optWindowed>1 Then optWindowed=0
ChangeWindowed(optWindowed)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=3 Then optPopulation=optPopulation+5 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optFog=optFog+1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optShadows=optShadows+1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optFX=optFX+1 : PlaySound sMenuBrowse : keytim=6
If foc=7 Then optGore=optGore+1 : PlaySound sMenuBrowse : keytim=6
EndIf
EndIf
;check limits
If optRes<1 Then optRes=1
If optRes>5 Then optRes=5
If optPopulation<40 Then optPopulation=40
If optPopulation>100 Then optPopulation=100
If optFog<0 Then optFog=1
Expand All @@ -151,16 +173,17 @@ While go=0
DrawImage gLogo(3),rX#(400),rY#(50)
;options
SetFont font(1)
x=400 : y=120 : spacer=53
x=400 : y=110 : spacer=40
DrawOption(1,rX#(400),rY#(y),translate("Resolution"),textResX$(optRes)+" x "+textResY$(optRes)) : y=y+spacer
DrawOption(2,rX#(400),rY#(y),translate("Population"),translate("#FIRST# characters", str optPopulation)) : y=y+(spacer+5)
DrawOption(3,rX#(400),rY#(y),translate("Fog Effect"),textOnOff$(optFog)) : y=y+spacer
DrawOption(4,rX#(400),rY#(y),translate("Shadows"),textShadows$(optShadows)) : y=y+spacer
DrawOption(5,rX#(400),rY#(y),translate("Particle FX"),textFX$(optFX)) : y=y+spacer
DrawOption(6,rX#(400),rY#(y),translate("Gore"),textGore$(optGore)) : y=y+(spacer+5)
DrawOption(7,rX#(400),rY#(y),translate("REDEFINE KEYS"),"") : y=y+spacer
DrawOption(8,rX#(400),rY#(y),translate("REDEFINE GAMEPAD"),"") : y=y+(spacer+5)
DrawOption(9,rX#(400),rY#(y),translate("<<< BACK <<<"),"")
DrawOption(2,rX#(400),rY#(y),translate("Windowed"), textOnOff$(optWindowed)) : y=y+spacer
DrawOption(3,rX#(400),rY#(y),translate("Population"),translate("#FIRST# characters", str optPopulation)) : y=y+(spacer+5)
DrawOption(4,rX#(400),rY#(y),translate("Fog Effect"),textOnOff$(optFog)) : y=y+spacer
DrawOption(5,rX#(400),rY#(y),translate("Shadows"),textShadows$(optShadows)) : y=y+spacer
DrawOption(6,rX#(400),rY#(y),translate("Particle FX"),textFX$(optFX)) : y=y+spacer
DrawOption(7,rX#(400),rY#(y),translate("Gore"),textGore$(optGore)) : y=y+(spacer+5)
DrawOption(8,rX#(400),rY#(y),translate("REDEFINE KEYS"),"") : y=y+spacer
DrawOption(9,rX#(400),rY#(y),translate("REDEFINE GAMEPAD"),"") : y=y+(spacer+5)
DrawOption(10,rX#(400),rY#(y),translate("<<< BACK <<<"),"")

Flip
;screenshot (F12)
Expand Down Expand Up @@ -572,7 +595,7 @@ Function DrawMainLogo(x#,y#)
;version ID
SetFont font(1)
Outline(translate("Version #FIRST#", "1." + version),x#+310,y#+60,200,200,200,200,200,200)
Outline(translate("Translate #FIRST#", "1.0.3"),x#+310,y#+80,200,200,200,200,200,200)
Outline(translate("Mod #FIRST#", "1.0.4"),x#+310,y#+80,200,200,200,200,200,200)
End Function

;DRAW MENU ITEM
Expand Down Expand Up @@ -704,11 +727,12 @@ Function ChangeResolution(resolution,task) ;0=pre-game, 1=during game
;assess preferences
width=Int(textResX$(resolution))
height=Int(textResY$(resolution))
If GfxMode3DExists(width,height,16)=0 Then width=800 : height=600 : optRes=2
mode = 2
If optWindowed=0 Then mode = 1
;make transition?
If width<>GraphicsWidth() Or height<>GraphicsHeight()
If task>0 Then Loader(translate("Please Wait"),translate("Adjusting Resolution"))
Graphics3D width,height,16,2
Graphics3D width,height,0,mode
If task>0 ;restore media
LoadImages()
Loader(translate("Please Wait"),translate("Restoring Media"))
Expand All @@ -717,6 +741,21 @@ Function ChangeResolution(resolution,task) ;0=pre-game, 1=during game
LoadWeaponData()
EndIf
EndIf
SaveOptions()
End Function

Function ChangeWindowed(windowed)
width=Int(textResX$(optRes))
height=Int(textResY$(optRes))
mode=2
If windowed=0 Then mode=1
Graphics3D width,height,0,mode
LoadImages()
Loader(translate("Please Wait"),translate("Restoring Media"))
LoadPhotos()
LoadTextures()
LoadWeaponData()
SaveOptions()
End Function

;GET SCREENSHOT
Expand Down
3 changes: 2 additions & 1 deletion Texts.bb
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ Dim textOnOff$(1)
textOnOff$(0)=translate("Off")
textOnOff$(1)=translate("On")
;resolution
Dim textResX$(5),textResY$(5)
Dim textResX$(6),textResY$(6)
textResX$(0)="320" : textResY$(0)="240"
textResX$(1)="640" : textResY$(1)="480"
textResX$(2)="800" : textResY$(2)="600"
textResX$(3)="1024" : textResY$(3)="768"
textResX$(4)="1280" : textResY$(4)="1024"
textResX$(5)="1280" : textResY$(5)="800"
textResX$(6)="1920" : textResY$(6)="1080"
;gore
Dim textGore$(5)
textGore$(0)=translate("None")
Expand Down
1 change: 1 addition & 0 deletions Values.bb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Global optPlayLim=50,optCharLim=200
Global optWeapLim=100
Global optPopulation=60
;preferences
Global optWindowed=0
Global optRes=2,optFog=1
Global optFX=1,optShadows=2
Global optGore=3 ;0=none, 1=scars, 2=pools, 3=limbs
Expand Down
2 changes: 1 addition & 1 deletion translate_plugin/Main.bb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Global messagesCount = 1581
Global messagesCount = 1582
Dim messages$(messagesCount, 2)

Include "translate_plugin/lang/Others.bb"
Expand Down
Loading

0 comments on commit 588e346

Please sign in to comment.