summaryrefslogtreecommitdiffstats
path: root/src/core/Frontend.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-09 12:43:08 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-09 12:58:31 +0200
commitb80c4bae6be24ff7f261238a36e4c0c5519bef5f (patch)
tree36f82233c2627587b4d21d590b0350b4d3125b95 /src/core/Frontend.cpp
parentMerge pull request #526 from Nick007J/miami (diff)
downloadre3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar.gz
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar.bz2
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar.lz
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar.xz
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.tar.zst
re3-b80c4bae6be24ff7f261238a36e4c0c5519bef5f.zip
Diffstat (limited to '')
-rw-r--r--src/core/Frontend.cpp37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index e2c2a453..06b9a151 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -901,6 +901,25 @@ CMenuManager::Draw()
bool foundTheHoveringItem = false;
wchar unicodeTemp[64];
+#ifdef MENU_MAP
+ if (m_nCurrScreen == MENUPAGE_MAP) {
+ // Back button
+ wchar *backTx = TheText.Get("FEDS_TB");
+ CFont::SetDropShadowPosition(1);
+ CFont::SetDropColor(CRGBA(0, 0, 0, 255));
+ CFont::PrintString(MENU_X(60.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), backTx);
+ CFont::SetDropShadowPosition(0);
+ if (!CheckHover(MENU_X(30.0f), MENU_X(30.0f) + CFont::GetStringWidth(backTx), SCREEN_SCALE_FROM_BOTTOM(125.0f), SCREEN_SCALE_FROM_BOTTOM(105.0f))) {
+ m_nHoverOption = HOVEROPTION_NOT_HOVERING;
+ m_nCurrOption = m_nPrevOption = 0;
+ } else {
+ m_nHoverOption = HOVEROPTION_RANDOM_ITEM;
+ m_nCurrOption = m_nPrevOption = 1;
+ }
+ return;
+ }
+#endif
+
for (int i = 0; i < NUM_MENUROWS; ++i) {
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action != MENUACTION_LABEL && aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName[0] != '\0') {
wchar *rightText = nil;
@@ -5381,13 +5400,13 @@ CMenuManager::PrintController(void)
#define ZOOM(x, y, in) \
do { \
- if(fMapSize > SCREEN_WIDTH * 2 && in) \
+ if(fMapSize > SCREEN_HEIGHT * 3.0f && in) \
break; \
float z2 = in? 1.1f : 1.f/1.1f; \
fMapCenterX += (x - fMapCenterX) * (1.0f - z2); \
fMapCenterY += (y - fMapCenterY) * (1.0f - z2); \
\
- if (fMapSize < SCREEN_WIDTH / 3 && !in) \
+ if (fMapSize < SCREEN_HEIGHT / 2 && !in) \
break; \
\
fMapSize *= z2; \
@@ -5400,10 +5419,18 @@ CMenuManager::PrintMap(void)
bMenuMapActive = true;
CRadar::InitFrontEndMap();
+ // Just entered to map
if (!bMapLoaded) {
- fMapCenterX = SCREEN_WIDTH / 2;
- fMapCenterY = SCREEN_HEIGHT / 3;
- fMapSize = SCREEN_HEIGHT / CDraw::GetAspectRatio();
+ fMapSize = SCREEN_HEIGHT * 2.0f;
+ fMapCenterX = 0.0f;
+ fMapCenterY = 0.0f;
+ CVector2D radarSpacePlayer;
+ CVector2D screenSpacePlayer;
+ CRadar::TransformRealWorldPointToRadarSpace(radarSpacePlayer, CVector2D(FindPlayerCoors()));
+ CRadar::TransformRadarPointToScreenSpace(screenSpacePlayer, radarSpacePlayer);
+
+ fMapCenterX = (-screenSpacePlayer.x) + SCREEN_WIDTH / 2;
+ fMapCenterY = (-screenSpacePlayer.y) + SCREEN_HEIGHT / 2;
bMapMouseShownOnce = false;
bMapLoaded = true;