Update txd names

This commit is contained in:
Grinch_ 2022-06-18 14:01:31 +06:00
parent 1ef8794c79
commit 5b0dcd72fa
9 changed files with 39 additions and 66 deletions

View File

@ -216,6 +216,8 @@ TeleportCMDText = """
Teleports player to specified coordinates. Teleports player to specified coordinates.
Example: tp x y z""" Example: tp x y z"""
TextColor = "Text color" TextColor = "Text color"
TextOnlyMode = "Text only"
TextOnlyModeHint = "Disables all images and shows only text"
Usage = "Usage" Usage = "Usage"
UpdaterInfo1 = "It's highly recommanded to update to the latest version. Newer version contains new features and bug fixes." UpdaterInfo1 = "It's highly recommanded to update to the latest version. Newer version contains new features and bug fixes."
UpdaterInfo2 = "To know what changes are made or to download, click on the 'Download page' button. Follow the instructions there. If you're still having issues, let me know on discord." UpdaterInfo2 = "To know what changes are made or to download, click on the 'Download page' button. Follow the instructions there. If you're still having issues, let me know on discord."

View File

@ -28,31 +28,27 @@ void Animation::PlayCutscene(std::string& rootKey, std::string& cutsceneId, std:
} }
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
if (!pPlayer) if (pPlayer)
{ {
return; m_Cutscene::m_SceneName = cutsceneId;
Command<Commands::LOAD_CUTSCENE>(cutsceneId.c_str());
m_Cutscene::m_nInterior = pPlayer->m_nAreaCode;
pPlayer->m_nAreaCode = std::stoi(interior);
Command<Commands::SET_AREA_VISIBLE>(pPlayer->m_nAreaCode);
} }
m_Cutscene::m_SceneName = cutsceneId;
Command<Commands::LOAD_CUTSCENE>(cutsceneId.c_str());
m_Cutscene::m_nInterior = pPlayer->m_nAreaCode;
pPlayer->m_nAreaCode = std::stoi(interior);
Command<Commands::SET_AREA_VISIBLE>(pPlayer->m_nAreaCode);
} }
void Animation::PlayParticle(std::string& rootKey, std::string& particle, std::string& dummy) void Animation::PlayParticle(std::string& rootKey, std::string& particle, std::string& dummy)
{ {
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
if (!pPlayer) if (pPlayer)
{ {
return; CVector pos = pPlayer->GetPosition();
int handle;
Command<Commands::CREATE_FX_SYSTEM>(particle.c_str(), pos.x, pos.y, pos.z, 1, &handle);
Command<Commands::PLAY_FX_SYSTEM>(handle);
m_Particle::m_nParticleList.push_back(handle);
} }
CVector pos = pPlayer->GetPosition();
int handle;
Command<Commands::CREATE_FX_SYSTEM>(particle.c_str(), pos.x, pos.y, pos.z, 1, &handle);
Command<Commands::PLAY_FX_SYSTEM>(handle);
m_Particle::m_nParticleList.push_back(handle);
} }

View File

@ -9,7 +9,7 @@
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.3" #define MENU_VERSION_NUMBER "3.3"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta" #define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20220616" #define BUILD_NUMBER "20220618"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION
#ifdef GTASA #ifdef GTASA

View File

@ -107,52 +107,11 @@ void FileHandler::FetchHandlingID(std::map<int, std::string>& storeMap)
char model[32], txd[32], type[32], handling[32]; char model[32], txd[32], type[32], handling[32];
if (sscanf(buf, "%d %s %s %s %s", &id, model, txd, type, handling) == 5) if (sscanf(buf, "%d %s %s %s %s", &id, model, txd, type, handling) == 5)
{ {
// storeMap[id] = std::string(handling); storeMap[id] = std::string(handling);
} }
} }
fclose(pFile); fclose(pFile);
} }
// std::ifstream file(m_FilePath);
// std::string line;
// while (getline(file, line))
// {
// /*
// Format: model, modelname, txdname, type, handlingId, ...
// Skip if first thing isn't model id
// */
// if (line[0] <= '0' || line[0] >= '9')
// {
// continue;
// }
// // running inside try block to handle user errors, mostly commas
// try
// {
// std::string temp;
// std::stringstream ss(line);
// // get model
// getline(ss, temp, ',');
// int model = std::stoi(temp);
// // get modelname, txd, type, handlingId
// getline(ss, temp, ',');
// getline(ss, temp, ',');
// getline(ss, temp, ',');
// getline(ss, temp, ',');
// temp.erase(std::remove_if(temp.begin(), temp.end(), isspace), temp.end());
// storeMap[model] = temp;
// }
// catch (...)
// {
// Log::Print<eLogLevel::Warn>("Failed parsing vehicles.ide, {}", line);
// }
// }
// file.close();
} }
#endif #endif

View File

@ -32,6 +32,7 @@ void Menu::Init()
m_Overlay::textColor[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f); m_Overlay::textColor[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f);
m_Overlay::textColor[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f); m_Overlay::textColor[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f);
m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false); m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false);
m_bTextOnlyMode = gConfig.Get("Menu.TextOnlyMode", false);
Util::GetCPUUsageInit(); Util::GetCPUUsageInit();
MEMORYSTATUSEX memInfo; MEMORYSTATUSEX memInfo;
@ -363,6 +364,12 @@ void Menu::ShowPage()
gConfig.Set("Menu.DiscordRPC", m_bDiscordRPC); gConfig.Set("Menu.DiscordRPC", m_bDiscordRPC);
} }
ImGui::NextColumn(); ImGui::NextColumn();
if (gRenderer == Render_DirectX9
&& Ui::CheckboxWithHint(TEXT("Menu.TextOnlyMode"), &m_bTextOnlyMode, TEXT("Menu.TextOnlyModeHint")))
{
gConfig.Set("Menu.TextOnlyMode", m_bTextOnlyMode);
}
ImGui::Columns(1); ImGui::Columns(1);
ImGui::EndTabItem(); ImGui::EndTabItem();

View File

@ -45,7 +45,8 @@ public:
static inline char m_nInputBuffer[INPUT_BUFFER_SIZE] = ""; static inline char m_nInputBuffer[INPUT_BUFFER_SIZE] = "";
}; };
static inline bool m_bDiscordRPC; static inline bool m_bDiscordRPC;
static inline bool m_bTextOnlyMode;
Menu() = delete; Menu() = delete;
Menu(const Menu&) = delete; Menu(const Menu&) = delete;

View File

@ -2,6 +2,7 @@
#include "util.h" #include "util.h"
#include "ui.h" #include "ui.h"
#include "../depend/imgui/imgui_internal.h" #include "../depend/imgui/imgui_internal.h"
#include "menu.h"
// Really messy code, cleanup someday // Really messy code, cleanup someday
bool Ui::DrawTitleBar() bool Ui::DrawTitleBar()
@ -544,6 +545,12 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
m_ImageSize.x = ImGui::GetWindowContentRegionWidth() - style.ItemSpacing.x * (imagesInRow-1); m_ImageSize.x = ImGui::GetWindowContentRegionWidth() - style.ItemSpacing.x * (imagesInRow-1);
m_ImageSize.x /= imagesInRow; m_ImageSize.x /= imagesInRow;
bool showImages = !Menu::m_bTextOnlyMode;
if (gRenderer == Render_DirectX11)
{
showImages = false;
}
ImGui::Spacing(); ImGui::Spacing();
// Hide the popup if right clicked again // Hide the popup if right clicked again
@ -568,7 +575,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
ImGui::Spacing(); ImGui::Spacing();
ImGui::BeginChild("DrawImages"); ImGui::BeginChild("DrawImages");
if (gRenderer == Render_DirectX9) if (showImages)
{ {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(3, 3)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(3, 3));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(3, 3)); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(3, 3));
@ -590,16 +597,17 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
Couldn't figure out how to laod images for Dx11 Couldn't figure out how to laod images for Dx11
Using texts for now Using texts for now
*/ */
if (gRenderer == Render_DirectX11) if (showImages)
{ {
if (ImGui::MenuItem(modelName.c_str())) if (Ui::RoundedImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, modelName.c_str()))
{ {
onLeftClick(text); onLeftClick(text);
} }
} }
else else
{ {
if (Ui::RoundedImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, modelName.c_str())) if (ImGui::MenuItem(modelName.c_str()))
{ {
onLeftClick(text); onLeftClick(text);
} }
@ -612,7 +620,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
imgPopup.value = modelName; imgPopup.value = modelName;
} }
if (gRenderer != Render_DirectX11) if (showImages)
{ {
if (imageCount % imagesInRow != 0) if (imageCount % imagesInRow != 0)
{ {
@ -623,7 +631,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
} }
} }
if (gRenderer == Render_DirectX9) if (showImages)
{ {
ImGui::PopStyleVar(4); ImGui::PopStyleVar(4);
} }