diff --git a/GiroflexVSL/Mod.cpp b/GiroflexVSL/Mod.cpp index 50f43ab..f6ae77e 100644 --- a/GiroflexVSL/Mod.cpp +++ b/GiroflexVSL/Mod.cpp @@ -26,7 +26,7 @@ extern RpClump* (*RpClumpForAllAtomics)(RpClump* clump, RpAtomicCallBack callbac extern RpGeometry* (*RpGeometryForAllMaterials)(RpGeometry* geometry, RpMaterialCallBack fpCallBack, void* pData); extern char* (*GetFrameNodeName)(RwFrame* frame); -const char* Mod::m_Version = "3.9.0"; +const char* Mod::m_Version = "3.9.1"; bool canTurnSirenOn = true; bool canTurnPanelOn = true; @@ -35,6 +35,8 @@ Vehicle* testedVehicle = NULL; void Mod::Update(int dt) { + Log::Level(LOG_LEVEL::LOG_UPDATE) << "* Mod.Update" << std::endl; + while (Draw::m_DrawItems.size() > 0) { auto dw = Draw::m_DrawItems[0]; @@ -44,7 +46,7 @@ void Mod::Update(int dt) // - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> Vehicles --------------" << std::endl; + Log::Level(LOG_LEVEL::LOG_UPDATE) << "Vehicles" << std::endl; Vehicles::TryFindNewVehicles(); @@ -106,20 +108,16 @@ void Mod::Update(int dt) } } - //Log::Level(LOG_LEVEL::LOG_UPDATE) << "SoundPanelSystem" << std::endl; - //SoundPanelSystem::Update(dt); - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> Menu" << std::endl; + Log::Level(LOG_LEVEL::LOG_UPDATE) << "Menu" << std::endl; Menu::Update(dt); - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> WindowSettings" << std::endl; + Log::Level(LOG_LEVEL::LOG_UPDATE) << "WindowSettings/SoundPanel" << std::endl; WindowSettings::Update(dt); WindowSettings::Draw(); - - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> WindowSoundPanel" << std::endl; WindowSoundPanel::Draw(); WindowSoundPanel::Update(dt); @@ -127,9 +125,9 @@ void Mod::Update(int dt) WindowPanel::Update(); WindowPanel::Draw(); - Menu::Draw(); + Log::Level(LOG_LEVEL::LOG_UPDATE) << "Menu/Input/Widgets" << std::endl; - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> Input" << std::endl; + Menu::Draw(); Input::Update(dt); Widgets::Update(dt); @@ -177,7 +175,7 @@ void Mod::Update(int dt) Menu::ShowCredits(6, 5000); } - Log::Level(LOG_LEVEL::LOG_UPDATE) << "> end" << std::endl; + Log::Level(LOG_LEVEL::LOG_UPDATE) << "* Mod.Update end" << std::endl; } void Mod::ProcessMenuButtons(int dt) diff --git a/GiroflexVSL/ModConfig.cpp b/GiroflexVSL/ModConfig.cpp index 8ad301c..798a820 100644 --- a/GiroflexVSL/ModConfig.cpp +++ b/GiroflexVSL/ModConfig.cpp @@ -215,6 +215,7 @@ void ModConfig::SaveSettings() soundPanelSection->AddIntFromBool("allow_multiple_sound", WindowSoundPanel::m_allowMultipleSounds); soundPanelSection->AddIntFromBool("show_on_enter_vehicle", WindowSoundPanel::m_showOnEnterVehicle); soundPanelSection->AddIntFromBool("show_button_toggle_lights", WindowSoundPanel::m_showButtonToggleLights); + soundPanelSection->AddIntFromBool("turn_off_siren_when_leave_car", WindowSoundPanel::m_turnOffSirenWhenLeaveCar); soundPanelSection->AddCRGBA("button_color", WindowSoundPanel::m_buttonDefaultColor); soundPanelSection->AddCRGBA("button_active_color", WindowSoundPanel::m_buttonActiveColor); soundPanelSection->AddCRGBA("button_outline_color", WindowSoundPanel::m_buttonOutlineColor); @@ -354,6 +355,7 @@ void ModConfig::LoadSettings() soundPanelSection->GetBoolFromInt("allow_multiple_sound", &WindowSoundPanel::m_allowMultipleSounds); soundPanelSection->GetBoolFromInt("show_on_enter_vehicle", &WindowSoundPanel::m_showOnEnterVehicle); soundPanelSection->GetBoolFromInt("show_button_toggle_lights", &WindowSoundPanel::m_showButtonToggleLights); + soundPanelSection->GetBoolFromInt("turn_off_siren_when_leave_car", &WindowSoundPanel::m_turnOffSirenWhenLeaveCar); soundPanelSection->GetCRGBA("button_color", &WindowSoundPanel::m_buttonDefaultColor); soundPanelSection->GetCRGBA("button_active_color", &WindowSoundPanel::m_buttonActiveColor); soundPanelSection->GetCRGBA("button_outline_color", &WindowSoundPanel::m_buttonOutlineColor); diff --git a/GiroflexVSL/Point.h b/GiroflexVSL/Point.h index fe07939..16a2911 100644 --- a/GiroflexVSL/Point.h +++ b/GiroflexVSL/Point.h @@ -55,7 +55,7 @@ class Point { Json::Value rotateObjectValue = value["rotateObject"]; if(!rotateObjectValue.isNull()) { - rotateObject.speed = ValidateValue(rotateObjectValue["speed"], rotateObject.speed).asInt(); + rotateObject.speed = ValidateValue(rotateObjectValue["speed"], rotateObject.speed).asFloat(); rotateObject.object = ValidateValue(rotateObjectValue["object"], rotateObject.object).asString(); rotateObject.axis = (eRotateObjectAxis)ValidateValue(rotateObjectValue["axis"], (int)rotateObject.axis).asInt(); rotateObject.rotateAlways = ValidateValue(rotateObjectValue["rotateAlways"], rotateObject.rotateAlways).asBool(); diff --git a/GiroflexVSL/SirenSystem.cpp b/GiroflexVSL/SirenSystem.cpp index a0fbc12..78fb04f 100644 --- a/GiroflexVSL/SirenSystem.cpp +++ b/GiroflexVSL/SirenSystem.cpp @@ -7,6 +7,8 @@ #include "Vehicles.h" #include "Widgets.h" +#include "windows/WindowSoundPanel.h" + #include "iniconfig/INIFile.h" std::string SirenSystem::m_DefaultGroupId = ""; @@ -456,9 +458,18 @@ void SirenSystem::Update(int dt) } } - if(!SirenSystem::ModelIdHasSirenGroup(modelId)) return; + //boomark1 + if(WindowSoundPanel::m_turnOffSirenWhenLeaveCar) + { + if(vehicle->pDriver == NULL && sirenState) + { + ToggleSiren(false); + } + } /* + //if(!SirenSystem::ModelIdHasSirenGroup(modelId)) return; + auto siren = sirens[0]; if(siren->GetState() == -1) { diff --git a/GiroflexVSL/main.cpp b/GiroflexVSL/main.cpp index 05fe09d..1e76d96 100644 --- a/GiroflexVSL/main.cpp +++ b/GiroflexVSL/main.cpp @@ -16,7 +16,7 @@ // --------------------------------------- //MYMODCFG(net.danilo1301.giroflexVSL, GiroflexVSL, Mod::m_Version, Danilo1301) //whoops -MYMODCFG(net.danilo1301.giroflexVSL, GiroflexVSL, 3.9.0, Danilo1301) +MYMODCFG(net.danilo1301.giroflexVSL, GiroflexVSL, 3.9.1, Danilo1301) // --------------------------------------- @@ -101,6 +101,8 @@ void SaveCfg() DECL_HOOK(void*, UpdateGameLogic, uintptr_t a1) { + Log::Level(LOG_LEVEL::LOG_UPDATE) << "UpdateGameLogic" << std::endl; + if(BASS) { soundsys->Update(); } @@ -112,16 +114,22 @@ DECL_HOOK(void*, UpdateGameLogic, uintptr_t a1) vehicle->OnUpdateGameLogic(); } + Log::Level(LOG_LEVEL::LOG_UPDATE) << "UpdateGameLogic end" << std::endl; + return UpdateGameLogic(a1); } DECL_HOOKv(RenderVehicle, void* self) { + Log::Level(LOG_LEVEL::LOG_UPDATE) << "RenderVehicle" << std::endl; + CVehicle* vehicle = (CVehicle*)self; Vehicles::RenderBefore(vehicle); RenderVehicle(self); Vehicles::RenderAfter(vehicle); + + Log::Level(LOG_LEVEL::LOG_UPDATE) << "RenderVehicle end" << std::endl; } #include "sdk/Image.h" @@ -206,11 +214,11 @@ unsigned short* textGxt = new unsigned short[0xFF]; CSprite2d sprite; -DECL_HOOKv(CHud_Draw, void* self) -{ +//DECL_HOOKv(CHud_Draw, void* self) +//{ //Log::Level(LOG_LEVEL::LOG_BOTH) << "CHud_Draw" << std::endl; - CHud_Draw(self); + //CHud_Draw(self); /* CSprite2d_DrawRect(CRect(300, 300, 400, 400), CRGBA(0, 0, 255)); @@ -235,7 +243,7 @@ DECL_HOOKv(CHud_Draw, void* self) CFont_PrintString(300, 300, textGxt); RenderFontBuffer(); */ -} +//} // @@ -346,6 +354,8 @@ void LoadSymbols() HOOKPLT(UpdateGameLogic, gameAddr + 0x66FE58); HOOK(RenderVehicle, aml->GetSym(hGTASA, "_ZN8CVehicle6RenderEv")); + + //HOOK(CHud_Draw, aml->GetSym(hGTASA, "_ZN4CHud4DrawEv")); // diff --git a/GiroflexVSL/windows/WindowSoundPanel.cpp b/GiroflexVSL/windows/WindowSoundPanel.cpp index 006503e..eebd4d5 100644 --- a/GiroflexVSL/windows/WindowSoundPanel.cpp +++ b/GiroflexVSL/windows/WindowSoundPanel.cpp @@ -20,6 +20,7 @@ std::vector WindowSoundPanel::m_audioStreamData; bool WindowSoundPanel::m_allowMultipleSounds = false; bool WindowSoundPanel::m_showOnEnterVehicle = true; bool WindowSoundPanel::m_showButtonToggleLights = true; +bool WindowSoundPanel::m_turnOffSirenWhenLeaveCar = false; CRGBA WindowSoundPanel::m_buttonDefaultColor = { 109, 167, 100, 255 }; CRGBA WindowSoundPanel::m_buttonActiveColor = { 255, 131, 131, 255 }; CRGBA WindowSoundPanel::m_buttonOutlineColor = { 46, 77, 51, 255 }; diff --git a/GiroflexVSL/windows/WindowSoundPanel.h b/GiroflexVSL/windows/WindowSoundPanel.h index 8d17ee6..aef22a5 100644 --- a/GiroflexVSL/windows/WindowSoundPanel.h +++ b/GiroflexVSL/windows/WindowSoundPanel.h @@ -20,6 +20,7 @@ class WindowSoundPanel { static bool m_allowMultipleSounds; static bool m_showOnEnterVehicle; static bool m_showButtonToggleLights; + static bool m_turnOffSirenWhenLeaveCar; static CRGBA m_buttonDefaultColor; static CRGBA m_buttonActiveColor; static CRGBA m_buttonOutlineColor; diff --git a/GiroflexVSL/windows/WindowSoundPanelSettings.cpp b/GiroflexVSL/windows/WindowSoundPanelSettings.cpp index 93919c0..69954ee 100644 --- a/GiroflexVSL/windows/WindowSoundPanelSettings.cpp +++ b/GiroflexVSL/windows/WindowSoundPanelSettings.cpp @@ -60,6 +60,8 @@ void WindowSoundPanelSettings::Create() window->AddCheckbox(87, &WindowSoundPanel::m_showButtonToggleLights); + window->AddCheckbox(115, &WindowSoundPanel::m_turnOffSirenWhenLeaveCar); + auto button_position = window->AddButton(9); button_position->onClick = [window]() { Menu::AddPosition2DWindow(window, &WindowSoundPanel::m_position, -10000.0f, 10000.0f, 0.5f, []() { diff --git a/cleo/giroflex v3/GiroflexVSL.csa b/cleo/giroflex v3/GiroflexVSL.csa index e1cc556..8781b17 100644 Binary files a/cleo/giroflex v3/GiroflexVSL.csa and b/cleo/giroflex v3/GiroflexVSL.csa differ diff --git a/cleo/giroflex v3/GiroflexVSL.fxt b/cleo/giroflex v3/GiroflexVSL.fxt index 6f65574..ac96de8 100644 --- a/cleo/giroflex v3/GiroflexVSL.fxt +++ b/cleo/giroflex v3/GiroflexVSL.fxt @@ -3,7 +3,7 @@ DGFX2 ~1~, ~1~ DGFX3 ~1~, ~1~, ~1~ DGFX4 < DGFX5 > -DGFX6 Giroflex VSL v3.9.0 (by ~y~Danilo1301~w~) +DGFX6 Giroflex VSL v3.9.1 (by ~y~Danilo1301~w~) DGFX7 Fechar DGFX8 Voltar DGFX9 Editar posicao @@ -111,4 +111,5 @@ DGFX110 Direcao das luzes DGFX111 FRENTE DGFX112 AMBOS DGFX113 TRAS -DGFX114 LADOS \ No newline at end of file +DGFX114 LADOS +DGFX115 Desligar sirene ao sair \ No newline at end of file diff --git a/cleo/giroflex v3/GiroflexVSL.txt b/cleo/giroflex v3/GiroflexVSL.txt index 26bff42..c70738b 100644 --- a/cleo/giroflex v3/GiroflexVSL.txt +++ b/cleo/giroflex v3/GiroflexVSL.txt @@ -107,7 +107,7 @@ const VAR_DeltaTime = 29@ - Clock = 30@ + CurrClock = 30@ PrevClock = 31@ VAR_VelX = 32@ @@ -129,7 +129,7 @@ var MenuOffsetX : Float = 0.0 PrevClock : Int = 0 - Clock : Int = 0 + CurrClock: Int = 0 VAR_DeltaTime : Int = 0 @@ -387,13 +387,13 @@ return VAR_Integer1 = 1 -01BD: Clock = current_time_in_ms +01BD: CurrClock = current_time_in_ms -if PrevClock == Clock +if PrevClock == CurrClock then else VAR_Integer1 = 0 - VAR_Integer1 = Clock + VAR_Integer1 = CurrClock VAR_Integer1 -= PrevClock VAR_DeltaTime = VAR_Integer1 01BD: PrevClock = current_time_in_ms @@ -1114,4 +1114,8 @@ if VAR_GxtId == 114 then VAR_STR_1 = "DGFX114" end +if VAR_GxtId == 115 +then + VAR_STR_1 = "DGFX115" +end return \ No newline at end of file diff --git a/cleo/giroflex v3/GiroflexVSL_en.fxt b/cleo/giroflex v3/GiroflexVSL_en.fxt index a98f291..2baf4f6 100644 --- a/cleo/giroflex v3/GiroflexVSL_en.fxt +++ b/cleo/giroflex v3/GiroflexVSL_en.fxt @@ -3,7 +3,7 @@ DGFX2 ~1~, ~1~ DGFX3 ~1~, ~1~, ~1~ DGFX4 < DGFX5 > -DGFX6 Giroflex VSL v3.9.0 (by ~y~Danilo1301~w~) +DGFX6 Giroflex VSL v3.9.1 (by ~y~Danilo1301~w~) DGFX7 Close DGFX8 Back DGFX9 Edit position @@ -111,4 +111,5 @@ DGFX110 Lights direction DGFX111 FRONT DGFX112 BOTH DGFX113 BACK -DGFX114 SIDES \ No newline at end of file +DGFX114 SIDES +DGFX115 Turn off siren on exit \ No newline at end of file diff --git a/files/versions/3.9.0/GiroflexVSL-3.9.0__en.zip b/files/versions/3.9.0/GiroflexVSL-3.9.0__en.zip index ca74fa4..241c1d0 100644 Binary files a/files/versions/3.9.0/GiroflexVSL-3.9.0__en.zip and b/files/versions/3.9.0/GiroflexVSL-3.9.0__en.zip differ diff --git a/files/versions/3.9.0/GiroflexVSL-3.9.0__pt-br.zip b/files/versions/3.9.0/GiroflexVSL-3.9.0__pt-br.zip index 07dc6e2..50ea5f3 100644 Binary files a/files/versions/3.9.0/GiroflexVSL-3.9.0__pt-br.zip and b/files/versions/3.9.0/GiroflexVSL-3.9.0__pt-br.zip differ diff --git a/files/versions/3.9.1/GiroflexVSL-3.9.1__en.zip b/files/versions/3.9.1/GiroflexVSL-3.9.1__en.zip new file mode 100644 index 0000000..8f9e320 Binary files /dev/null and b/files/versions/3.9.1/GiroflexVSL-3.9.1__en.zip differ diff --git a/files/versions/3.9.1/GiroflexVSL-3.9.1__pt-br.zip b/files/versions/3.9.1/GiroflexVSL-3.9.1__pt-br.zip new file mode 100644 index 0000000..211f093 Binary files /dev/null and b/files/versions/3.9.1/GiroflexVSL-3.9.1__pt-br.zip differ diff --git a/info.txt b/info.txt index 3e6e5d5..be2d6bd 100644 --- a/info.txt +++ b/info.txt @@ -227,6 +227,9 @@ OBS: I also found a bug that detects a lightpanel button press before the panel [3.9.0] [X] ADD: lights rotate with object +[3.9.1] +[X] ADD: option to disable siren when leaving car + [ ] BUG: delay nas luzes q giram, acho q to pegando posição errada do objectWorldPosition -----------------------