From e412619ce70af70b291778394b251e078fc21bc5 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Thu, 22 Oct 2009 02:09:14 +0000 Subject: [PATCH] Info map for terrain type. Fixes bug 5. --- client/CAdvmapInterface.cpp | 12 +++++++++++- hch/CGeneralTextHandler.cpp | 13 +++++++++++-- hch/CGeneralTextHandler.h | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/client/CAdvmapInterface.cpp b/client/CAdvmapInterface.cpp index 0f0f3f927..6a4b40da8 100644 --- a/client/CAdvmapInterface.cpp +++ b/client/CAdvmapInterface.cpp @@ -568,8 +568,18 @@ void CTerrainRect::clickRight(tribool down, bool previousState) } std::vector < const CGObjectInstance * > objs = LOCPLINT->cb->getBlockingObjs(mp); - if(!objs.size()) + if(!objs.size()) { + // Bare or undiscovered terrain + if (down) { + const TerrainTile * tile = LOCPLINT->cb->getTileInfo(mp); + if (tile) { + CSimpleWindow * temp = CMessage::genWindow(VLC->generaltexth->terrainNames[tile->tertype],LOCPLINT->playerID,true); + CRClickPopupInt *rcpi = new CRClickPopupInt(temp,true); + GH.pushInt(rcpi); + } + } return; + } const CGObjectInstance * obj = objs.back(); switch(obj->ID) diff --git a/hch/CGeneralTextHandler.cpp b/hch/CGeneralTextHandler.cpp index 2b9894f36..480b35362 100644 --- a/hch/CGeneralTextHandler.cpp +++ b/hch/CGeneralTextHandler.cpp @@ -285,7 +285,16 @@ void CGeneralTextHandler::load() { loadToIt(temp,buf,it,3); restypes.push_back(temp); - } + } + + tlog5 << "\t\tReading TERRNAME \n"; + buf = bitmaph->getTextFile("TERRNAME.TXT"); + it=0; + while (itgetTextFile("RANDSIGN.TXT"); @@ -439,4 +448,4 @@ std::string CGeneralTextHandler::getDescr(std::string text) CGeneralTextHandler::CGeneralTextHandler() { -} \ No newline at end of file +} diff --git a/hch/CGeneralTextHandler.h b/hch/CGeneralTextHandler.h index 38e8b2bea..a993ecb5d 100644 --- a/hch/CGeneralTextHandler.h +++ b/hch/CGeneralTextHandler.h @@ -57,6 +57,7 @@ public: std::vector advobtxt; std::vector xtrainfo; std::vector restypes; + std::vector terrainNames; std::vector randsign; std::vector > mines; //first - name; second - event description