From ef9ccf6b82b75acdd2f274b0a3a97820ddd09ce1 Mon Sep 17 00:00:00 2001 From: Preben Eriksen Date: Fri, 17 Jan 2025 14:03:45 +0100 Subject: [PATCH] PE: Added - Quest Type "Activate" (4 Necrym59). PE: Added - DLUA - -- DESCRIPTION: [@SELECTED_INTERACTION$=-1(0=InterActionWeaponList)] (4 Necrym59). PE: Added - DLUA - -- DESCRIPTION: [@ListQuests=1(0=QuestList)] (4 Necrym59). --- .../GameGuru/Imgui/imgui_gg_dx11.cpp | 31 +++++++++++++++++-- GameGuru Core/GameGuru/Source/M-GridEdit.cpp | 11 ++++++- GameGuru Core/GameGuru/Source/M-GridEditB.cpp | 25 +++++++++++---- 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/GameGuru Core/GameGuru/Imgui/imgui_gg_dx11.cpp b/GameGuru Core/GameGuru/Imgui/imgui_gg_dx11.cpp index d7eaa257..0dece0ef 100644 --- a/GameGuru Core/GameGuru/Imgui/imgui_gg_dx11.cpp +++ b/GameGuru Core/GameGuru/Imgui/imgui_gg_dx11.cpp @@ -7113,13 +7113,35 @@ void ParseLuaScriptWithElementID(entityeleproftype *tmpeleprof, char * script, i } if (labels.size() == 2) { + //InterActionWeaponList + if (stricmp(labels[1].c_str(), "interactionweaponlist") == NULL) + { + labels.clear(); + labels.push_back(cVariable); + int iWeaponListIndex = 1; + //PE: Add filter. + int FillWeaponList(std::vector& labels, char* filter); + iWeaponListIndex += FillWeaponList(labels, "Interaction"); + + if (iWeaponListIndex > 0) + { + tmpeleprof->PropertiesVariable.VariableValueFrom[tmpeleprof->PropertiesVariable.iVariables] = 1; + tmpeleprof->PropertiesVariable.VariableValueTo[tmpeleprof->PropertiesVariable.iVariables] = iWeaponListIndex; + } + else + { + tmpeleprof->PropertiesVariable.VariableValueFrom[tmpeleprof->PropertiesVariable.iVariables] = 0; + tmpeleprof->PropertiesVariable.VariableValueTo[tmpeleprof->PropertiesVariable.iVariables] = 0; + } + + } if (stricmp(labels[1].c_str(), "anyweaponlist") == NULL) { labels.clear(); labels.push_back(cVariable); int iWeaponListIndex = 1; - int FillWeaponList(std::vector &labels); - iWeaponListIndex += FillWeaponList( labels); + int FillWeaponList(std::vector &labels, char* filter); + iWeaponListIndex += FillWeaponList( labels , nullptr); if (iWeaponListIndex > 0) { @@ -7842,6 +7864,11 @@ int DisplayLuaDescription(entityeleproftype *tmpeleprof) collectionQuestType item; fill_rpg_quest_defaults(&item, tmpeleprof->name_s.Get()); + //PE: Just to stop crash if not using storyboard. + if (g_collectionQuestLabels.size() == 0) + { + bFoundMatch = false; + } // only add unique quest titles if (bFoundMatch == false) { diff --git a/GameGuru Core/GameGuru/Source/M-GridEdit.cpp b/GameGuru Core/GameGuru/Source/M-GridEdit.cpp index 165e8682..c18b1b77 100644 --- a/GameGuru Core/GameGuru/Source/M-GridEdit.cpp +++ b/GameGuru Core/GameGuru/Source/M-GridEdit.cpp @@ -9511,11 +9511,12 @@ void mapeditorexecutable_loop(void) // drop down to make life easier char cTmpInput[MAX_PATH]; strcpy(cTmpInput, g_collectionQuestList[iCollectionItemIndex].collectionFields[l].Get()); - const char* items[] = { "Collect", "Destroy", "Deliver" }; + const char* items[] = { "Collect", "Destroy", "Deliver", "Activate" }; int item_current = 0; if (stricmp(cTmpInput, "collect") == NULL) item_current = 0; if (stricmp(cTmpInput, "destroy") == NULL) item_current = 1; if (stricmp(cTmpInput, "deliver") == NULL) item_current = 2; + if (stricmp(cTmpInput, "activate") == NULL) item_current = 3; ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX(), ImGui::GetCursorPosY() + 3)); ImGui::Text("Quest Type"); ImGui::SameLine(); @@ -9527,6 +9528,7 @@ void mapeditorexecutable_loop(void) if (item_current == 0) g_collectionQuestList[iCollectionItemIndex].collectionFields[l] = "collect"; if (item_current == 1) g_collectionQuestList[iCollectionItemIndex].collectionFields[l] = "destroy"; if (item_current == 2) g_collectionQuestList[iCollectionItemIndex].collectionFields[l] = "deliver"; + if (item_current == 3) g_collectionQuestList[iCollectionItemIndex].collectionFields[l] = "activate"; } ImGui::PopItemWidth(); @@ -17544,6 +17546,13 @@ void editor_previewmapormultiplayer_afterloopcode ( int iUseVRTest ) void CleanUpSpawedObject(void); CleanUpSpawedObject(); + + #ifdef WICKEDPARTICLESYSTEM + //PE: Clear all wicked particle effects created by lua. + void CleanUpEmitterEffects(void); + CleanUpEmitterEffects(); + #endif + #ifdef WICKEDENGINE WickedCall_SetEditorCameraLight(true); #endif diff --git a/GameGuru Core/GameGuru/Source/M-GridEditB.cpp b/GameGuru Core/GameGuru/Source/M-GridEditB.cpp index edf6644c..b108fcb4 100644 --- a/GameGuru Core/GameGuru/Source/M-GridEditB.cpp +++ b/GameGuru Core/GameGuru/Source/M-GridEditB.cpp @@ -2619,19 +2619,32 @@ void setpropertyfile ( int group, char* data_s, char* field_s, char* desc_s, cha } #endif -int FillWeaponList(std::vector& labels) +int FillWeaponList(std::vector& labels, char *filter) { int listmax = fillgloballistwithweaponsQuick(true, true, true, false); int iWeaponListIndex = 0; - - labels.push_back("No Weapon"); + if (filter) + { + std::string label = "No " + std::string(filter); + labels.push_back(label.c_str()); + } + else + { + labels.push_back("No Weapon"); + } iWeaponListIndex++; for (int gunid = 1; gunid <= g.gunmax; gunid++) { cstr thisLabel = t.gun[gunid].name_s; - if (strlen(thisLabel.Get()) == 0) thisLabel = "No Weapon"; - labels.push_back(thisLabel.Get()); - iWeaponListIndex++; + bool bAdd = true; + if (filter && !pestrcasestr(thisLabel.Get(), filter)) + bAdd = false; + if (bAdd) + { + if (strlen(thisLabel.Get()) == 0) thisLabel = "No Weapon"; + labels.push_back(thisLabel.Get()); + iWeaponListIndex++; + } } return(iWeaponListIndex);