Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure IniController #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Data/materials.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ bump = GFX\map\textures\bump\ventbump.jpg
stepsound = 1

[dirtymetal.jpg]
bump = GFX\map\textures\bump\dirtymetalbump.jpg
bump = GFX\map\textures\bump\dirtymetalbump.jpg
stepsound = 1

[misc.jpg]
bump = GFX\map\textures\bump\miscbump.jpg
bump = GFX\map\textures\bump\miscbump.jpg

[rockmoss.jpg]
bump = GFX\map\textures\bump\rockmossbump.jpg
Expand Down
45 changes: 23 additions & 22 deletions Game.bb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Include "SourceCode\Main.bb"
Function CheckForDlls()
Local InitErrorStr$ = ""

If FileSize("IniController.dll")=0 Then InitErrorStr=InitErrorStr+ "IniController.dll"+Chr(13)+Chr(10)
If FileSize("Blitzcord.dll")=0 Then InitErrorStr=InitErrorStr+ "Blitzcord.dll"+Chr(13)+Chr(10)
If FileSize("BlitzHash.dll")=0 Then InitErrorStr=InitErrorStr+ "BlitzHash.dll"+Chr(13)+Chr(10)
If FileSize("BlitzMovie.dll")=0 Then InitErrorStr=InitErrorStr+ "BlitzMovie.dll"+Chr(13)+Chr(10)
Expand Down Expand Up @@ -137,33 +138,33 @@ End Function

Function InitOptions()

opt\EnableSFXRelease% = GetINIInt(gv\OptionFile, "audio", "sfx release", 1)
opt\EnableSFXRelease% = IniGetInt(gv\OptionFile, "audio", "sfx release", 1)
opt\EnableSFXRelease_Prev% = opt\EnableSFXRelease%
opt\ConsoleEnabled% = GetINIInt(gv\OptionFile, "console", "enabled", 0)
opt\ConsoleOpening% = GetINIInt(gv\OptionFile, "console", "auto opening", 0)
opt\GraphicWidth% = GetINIInt(gv\OptionFile, "options", "width", DesktopWidth())
opt\GraphicHeight% = GetINIInt(gv\OptionFile, "options", "height", DesktopHeight())
opt\ShowFPS = GetINIInt(gv\OptionFile, "options", "show FPS", 0)
opt\DisplayMode% = GetINIInt(gv\OptionFile, "options", "display mode", 1)
opt\GraphicDriver% = GetINIInt(gv\OptionFile, "options", "graphic driver", 0)
opt\RenderCubeMapMode% = GetINIInt(gv\OptionFile, "options", "cubemaps", 2)
opt\EnableRoomLights% = GetINIInt(gv\OptionFile, "options", "room lights enabled", 1)
opt\TextureDetails% = GetINIInt(gv\OptionFile, "options", "texture details", 2)
opt\TextureFiltering% = GetINIInt(gv\OptionFile, "options", "texture filtering", 2)
opt\LauncherEnabled% = GetINIInt(gv\OptionFile, "options", "launcher enabled", 1)
opt\ConsoleEnabled% = IniGetInt(gv\OptionFile, "console", "enabled", 0)
opt\ConsoleOpening% = IniGetInt(gv\OptionFile, "console", "auto opening", 0)
opt\GraphicWidth% = IniGetInt(gv\OptionFile, "options", "width", DesktopWidth())
opt\GraphicHeight% = IniGetInt(gv\OptionFile, "options", "height", DesktopHeight())
opt\ShowFPS = IniGetInt(gv\OptionFile, "options", "show FPS", 0)
opt\DisplayMode% = IniGetInt(gv\OptionFile, "options", "display mode", 1)
opt\GraphicDriver% = IniGetInt(gv\OptionFile, "options", "graphic driver", 0)
opt\RenderCubeMapMode% = IniGetInt(gv\OptionFile, "options", "cubemaps", 2)
opt\EnableRoomLights% = IniGetInt(gv\OptionFile, "options", "room lights enabled", 1)
opt\TextureDetails% = IniGetInt(gv\OptionFile, "options", "texture details", 2)
opt\TextureFiltering% = IniGetInt(gv\OptionFile, "options", "texture filtering", 2)
opt\LauncherEnabled% = IniGetInt(gv\OptionFile, "options", "launcher enabled", 1)
opt\TotalGFXModes% = CountGfxModes3D()
opt\SFXVolume# = GetINIFloat(gv\OptionFile, "audio", "sound volume", 1.0)
opt\VoiceVol# = GetINIFloat(gv\OptionFile, "audio", "voice volume", 1.0)
opt\MasterVol# = GetINIFloat(gv\OptionFile, "audio", "master volume", 1.0)
opt\MusicVol# = GetINIFloat(gv\OptionFile, "audio", "music volume", 1.0)
opt\MouseSmooth# = GetINIFloat(gv\OptionFile, "options", "mouse smoothing", 1.0)
opt\HoldToAim% = GetINIInt(gv\OptionFile, "options", "hold to aim", 1)
opt\HoldToCrouch% = GetINIInt(gv\OptionFile, "options", "hold to crouch", 1)
opt\ShowDisclaimers% = GetINIInt(gv\OptionFile, "options", "show disclaimers", 1)
opt\SFXVolume# = IniGetFloat(gv\OptionFile, "audio", "sound volume", 1.0)
opt\VoiceVol# = IniGetFloat(gv\OptionFile, "audio", "voice volume", 1.0)
opt\MasterVol# = IniGetFloat(gv\OptionFile, "audio", "master volume", 1.0)
opt\MusicVol# = IniGetFloat(gv\OptionFile, "audio", "music volume", 1.0)
opt\MouseSmooth# = IniGetFloat(gv\OptionFile, "options", "mouse smoothing", 1.0)
opt\HoldToAim% = IniGetInt(gv\OptionFile, "options", "hold to aim", 1)
opt\HoldToCrouch% = IniGetInt(gv\OptionFile, "options", "hold to crouch", 1)
opt\ShowDisclaimers% = IniGetInt(gv\OptionFile, "options", "show disclaimers", 1)

LoadResolutions()

gopt\SingleplayerGameMode = GetINIInt(gv\OptionFile, "game options", "game mode", GAMEMODE_DEFAULT)
gopt\SingleplayerGameMode = IniGetInt(gv\OptionFile, "game options", "game mode", GAMEMODE_DEFAULT)
gopt\GameMode = gopt\SingleplayerGameMode

End Function
Expand Down
Binary file added Game.exe
Binary file not shown.
Binary file removed IniControler.dll
Binary file not shown.
Binary file added IniController.dll
Binary file not shown.
Binary file modified SCP Nine-Tailed Fox.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions SourceCode/Achievements.bb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
;Global UsedConsole
;
;Global AchievementsMenu%
;Global AchvMSGenabled% = GetINIInt(gv\OptionFile, "options", "achievement popup enabled", 1)
;Global AchvMSGenabled% = IniGetInt(gv\OptionFile, "options", "achievement popup enabled", 1)
;For i = 0 To MAXACHIEVEMENTS-1
; Local loc2% = GetINISectionLocation(AchvIni, "s"+Str(i))
; Local NEW_ACH.Achievement = New Achievement
; NEW_ACH\Name = GetINIString2(AchvIni, loc2, "string1")
; NEW_ACH\Desc = GetINIString2(AchvIni, loc2, "AchvDesc")
; NEW_ACH\Name = IniGetString2(AchvIni, loc2, "string1")
; NEW_ACH\Desc = IniGetString2(AchvIni, loc2, "AchvDesc")
;
; Local image$ = GetINIString2(AchvIni, loc2, "image")
; Local image$ = IniGetString2(AchvIni, loc2, "image")
;
; NEW_ACH\IMG = LoadImage_Strict("GFX\menu\achievements\"+image+".jpg")
; NEW_ACH\IMG = ResizeImage2(NEW_ACH\IMG,ImageWidth(NEW_ACH\IMG)*opt\GraphicHeight/768.0,ImageHeight(NEW_ACH\IMG)*opt\GraphicHeight/768.0)
Expand All @@ -49,7 +49,7 @@ Function GiveAchievement(ID%, showMessage%=True)
; Achievements[achvname]\Unlocked=True
; If AchvMSGenabled And showMessage Then
; Local loc2% = GetINISectionLocation(AchvIni, "s"+achvname)
; Local AchievementName$ = GetINIString2(AchvIni, loc2, "string1")
; Local AchievementName$ = IniGetString2(AchvIni, loc2, "string1")
; CreateAchievementMsg(achvname,AchievementName)
; EndIf
; EndIf
Expand Down
8 changes: 4 additions & 4 deletions SourceCode/Console.bb
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ Function UpdateConsole(commandSet%)
Default
Cheat\Mini173 = Not Cheat\Mini173
End Select
Local scale# = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "scale") / MeshDepth(Curr173\obj))
Local scale# = (IniGetFloat("Data\NPCs.ini", "SCP-173", "scale") / MeshDepth(Curr173\obj))
If Cheat\Mini173 Then
CreateConsoleMsg("MINI SCP-173 ON")
scale# = scale# / 3.0
Expand Down Expand Up @@ -1150,7 +1150,7 @@ Function UpdateConsole(commandSet%)
If n\obj = 0 Then
n\obj = LoadAnimMesh_Strict(n\Model)

Local temp2# = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "scale") / 2.5)
Local temp2# = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "scale") / 2.5)
ScaleEntity n\obj, temp2#, temp2#, temp2#

MeshCullBox (n\obj, -MeshWidth(n\obj), -MeshHeight(n\obj), -MeshDepth(n\obj), MeshWidth(n\obj)*2, MeshHeight(n\obj)*2, MeshDepth(n\obj)*2)
Expand Down Expand Up @@ -1263,7 +1263,7 @@ Function UpdateConsole(commandSet%)
StrTemp$ = ""
EndIf
If StrTemp <> ""
PutINIValue(gv\OptionFile,"options","progress",StrTemp)
IniWriteString(gv\OptionFile,"options","progress",StrTemp)
Null3DMenu()
Load3DMenu(StrTemp)
CreateConsoleMsg("Loaded 3D menu background: "+StrTemp)
Expand Down Expand Up @@ -1322,7 +1322,7 @@ Function UpdateConsole(commandSet%)
psp\Checkpoint106Passed = True
EndIf

PutINIValue(gv\OptionFile, "options", "intro enabled", IntroEnabled%)
IniWriteString(gv\OptionFile, "options", "intro enabled", IntroEnabled%)
Else
CreateConsoleMsg("Cannot recognize zone number "+Int(StrTemp2),255,150,0)
EndIf
Expand Down
24 changes: 12 additions & 12 deletions SourceCode/Controls.bb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Function InitController()
Return
EndIf

co\Enabled = GetINIInt(gv\OptionFile, "binds", "controller enabled")
co\Sensitivity = GetINIFloat(gv\OptionFile, "binds", "controller sensitivity")
co\InvertAxis[Controller_XAxis] = GetINIInt(gv\OptionFile, "binds", "controller invert x")
co\InvertAxis[Controller_YAxis] = GetINIInt(gv\OptionFile, "binds", "controller invert y")
co\Enabled = IniGetInt(gv\OptionFile, "binds", "controller enabled")
co\Sensitivity = IniGetFloat(gv\OptionFile, "binds", "controller sensitivity")
co\InvertAxis[Controller_XAxis] = IniGetInt(gv\OptionFile, "binds", "controller invert x")
co\InvertAxis[Controller_YAxis] = IniGetInt(gv\OptionFile, "binds", "controller invert y")
co\FullControl = False ;Currently only partial controller support is available, so the main menu, pause menu and console cannot be navigated by a controller
co\Scheme = GetINIInt(gv\OptionFile, "binds", "controller scheme")
co\SwapDPad_And_LeftStick = GetINIInt(gv\OptionFile, "binds", "controller swap dpad leftstick")
co\Scheme = IniGetInt(gv\OptionFile, "binds", "controller scheme")
co\SwapDPad_And_LeftStick = IniGetInt(gv\OptionFile, "binds", "controller swap dpad leftstick")

co\SelectSFX = LoadSound_Strict("SFX\Interact\SelectButton.ogg")

Expand All @@ -46,12 +46,12 @@ End Function
Function SaveController()
If JoyType()=0 Then Return ;Just skip this if no controller has been plugged in or detected

PutINIValue(gv\OptionFile, "binds", "controller enabled", co\Enabled)
PutINIValue(gv\OptionFile, "binds", "controller sensitivity", co\Sensitivity)
PutINIValue(gv\OptionFile, "binds", "controller invert x", co\InvertAxis[Controller_XAxis])
PutINIValue(gv\OptionFile, "binds", "controller invert y", co\InvertAxis[Controller_YAxis])
PutINIValue(gv\OptionFile, "binds", "controller scheme", co\Scheme)
PutINIValue(gv\OptionFile, "binds", "controller swap dpad leftstick", co\SwapDPad_And_LeftStick)
IniWriteString(gv\OptionFile, "binds", "controller enabled", co\Enabled)
IniWriteString(gv\OptionFile, "binds", "controller sensitivity", co\Sensitivity)
IniWriteString(gv\OptionFile, "binds", "controller invert x", co\InvertAxis[Controller_XAxis])
IniWriteString(gv\OptionFile, "binds", "controller invert y", co\InvertAxis[Controller_YAxis])
IniWriteString(gv\OptionFile, "binds", "controller scheme", co\Scheme)
IniWriteString(gv\OptionFile, "binds", "controller swap dpad leftstick", co\SwapDPad_And_LeftStick)

End Function

Expand Down
44 changes: 22 additions & 22 deletions SourceCode/GUI.bb
Original file line number Diff line number Diff line change
Expand Up @@ -1220,39 +1220,39 @@ Function UpdateGUI()
x2 = (SelectedItem\state+1.0)

Local iniStr$ = Data294
Local loc% = GetINISectionLocation(iniStr, SelectedItem\name)

Local drink$ = FindSCP294Drink(SelectedItem\name)

;Stop

strtemp = GetINIString2(iniStr, loc, "message")
strtemp = IniGetString(iniStr, drink, "message")
If strtemp <> "" Then Msg = strtemp : MsgTimer = 70*6

If GetINIInt2(iniStr, loc, "lethal") Lor GetINIInt2(iniStr, loc, "deathtimer") Then
DeathMSG = GetINIString2(iniStr, loc, "deathmessage")
If GetINIInt2(iniStr, loc, "lethal") Then Kill()
If IniGetInt(iniStr, drink, "lethal") Lor IniGetInt(iniStr, drink, "deathtimer") Then
DeathMSG = IniGetString(iniStr, drink, "deathmessage")
If IniGetInt(iniStr, drink, "lethal") Then Kill()
EndIf
BlurTimer = GetINIInt2(iniStr, loc, "blur")*70;*temp
If VomitTimer = 0 Then VomitTimer = GetINIInt2(iniStr, loc, "vomit")
CameraShakeTimer = GetINIString2(iniStr, loc, "camerashake")
;Injuries = Max(Injuries + GetINIInt2(iniStr, loc, "damage"),0);*temp
;Bloodloss = Max(Bloodloss + GetINIInt2(iniStr, loc, "blood loss"),0);*temp
DamageSPPlayer(GetINIInt2(iniStr, loc, "damage") * 25.0, True)
strtemp = GetINIString2(iniStr, loc, "sound")
BlurTimer = IniGetInt(iniStr, drink, "blur")*70;*temp
If VomitTimer = 0 Then VomitTimer = IniGetInt(iniStr, drink, "vomit")
CameraShakeTimer = IniGetString(iniStr, drink, "camerashake")
;Injuries = Max(Injuries + IniGetInt2(iniStr, loc, "damage"),0);*temp
;Bloodloss = Max(Bloodloss + IniGetInt2(iniStr, loc, "blood loss"),0);*temp
DamageSPPlayer(IniGetInt(iniStr, drink, "damage") * 25.0, True)
strtemp = IniGetString(iniStr, drink, "sound")
If strtemp<>"" Then
PlaySound_Strict LoadTempSound(strtemp)
EndIf
If GetINIInt2(iniStr, loc, "stomachache") Then SCP1025state[3]=1
If IniGetInt(iniStr, drink, "stomachache") Then SCP1025state[3]=1

DeathTimer=GetINIInt2(iniStr, loc, "deathtimer")*70
DeathTimer=IniGetInt(iniStr, drink, "deathtimer")*70

BlinkEffect = Float(GetINIString2(iniStr, loc, "blink effect", 1.0))*x2
BlinkEffectTimer = Float(GetINIString2(iniStr, loc, "blink effect timer", 1.0))*x2
BlinkEffect = Float(IniGetString(iniStr, drink, "blink effect", 1.0))*x2
BlinkEffectTimer = Float(IniGetString(iniStr, drink, "blink effect timer", 1.0))*x2

StaminaEffect = Float(GetINIString2(iniStr, loc, "stamina effect", 1.0))*x2
StaminaEffectTimer = Float(GetINIString2(iniStr, loc, "stamina effect timer", 1.0))*x2
StaminaEffect = Float(IniGetString(iniStr, drink, "stamina effect", 1.0))*x2
StaminaEffectTimer = Float(IniGetString(iniStr, drink, "stamina effect timer", 1.0))*x2

strtemp = GetINIString2(iniStr, loc, "refusemessage")
strtemp = IniGetString(iniStr, drink, "refusemessage")
If strtemp <> "" Then
Msg = strtemp
MsgTimer = 70*6
Expand Down Expand Up @@ -4145,13 +4145,13 @@ Function UpdateMenu()
;
; If AchievementsMenu>0 Then
; If AchievementsMenu <= Floor(Float(MAXACHIEVEMENTS-1)/12.0) Then
; If DrawButton(x+341*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�?�", 2) Then
; If DrawButton(x+341*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�?�", 2) Then
; AchievementsMenu = AchievementsMenu+1
; ShouldDeleteGadgets=True
; EndIf
; EndIf
; If AchievementsMenu > 1 Then
; If DrawButton(x+41*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�??", 2) Then
; If DrawButton(x+41*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�??", 2) Then
; AchievementsMenu = AchievementsMenu-1
; ShouldDeleteGadgets=True
; EndIf
Expand Down
Loading