From 0685cade69af2a41afa2d492405fa6d99b7d6908 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Thu, 15 Apr 2021 01:12:37 -0300 Subject: [PATCH] Change the text of custom activity zones When an activity zone is spawned through the use of `createactivityzone`, and `i` is 35, then it'll change the activity zone text to "Press ENTER to interact". --- desktop_version/src/Entity.cpp | 9 +++++++-- desktop_version/src/Entity.h | 2 +- desktop_version/src/Script.cpp | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 026b02ba..57cb9319 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -759,7 +759,7 @@ void entityclass::generateswnwave( int t ) } } -void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/ ) +void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/, bool custom /*= false*/) { k = blocks.size(); @@ -1051,7 +1051,12 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= trig=0; break; case 35: - block.prompt = "Press %s to activate terminal"; + if (custom) + { + block.prompt = "Press %s to interact"; + } else { + block.prompt = "Press %s to activate terminal"; + } block.script = "custom_"+customscript; block.setblockcolour("orange"); trig=0; diff --git a/desktop_version/src/Entity.h b/desktop_version/src/Entity.h index 26caf7b7..04538589 100644 --- a/desktop_version/src/Entity.h +++ b/desktop_version/src/Entity.h @@ -52,7 +52,7 @@ public: void generateswnwave(int t); - void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = ""); + void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = "", bool custom = false); bool disableentity(int t); diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index a9577aa1..d182e9e4 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1896,11 +1896,11 @@ void scriptclass::run(void) int crewman = obj.getcrewman(i); if (INBOUNDS_VEC(crewman, obj.entities) && i == 4) { - obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i); + obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35)); } else if (INBOUNDS_VEC(crewman, obj.entities)) { - obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i); + obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i, "", (i == 35)); } } else if (words[0] == "createrescuedcrew")