How do I keep the minimap hidden by default? version 0.0.24

Got something on your mind about the project? This is the correct place for that.
Forum rules
This forum is for feature requests, content changes additions, anything not a Bug in the software.
Please report all bugs on the Support Forums
Post Reply
User avatar
bigglesworth
Novice
Novice
Posts: 211
Joined: 11 Nov 2007, 04:23
Location: Land of Ooo

How do I keep the minimap hidden by default? version 0.0.24

Post by bigglesworth » 19 Feb 2008, 06:09

Hi! Each time I walk onto a different map, the minimap pops up.

I know I can turn it off with the "F6" key, but how do I turn it off and make it appear only when I want it to?

In the 0.0.24 source, within the file "minimap.cpp", is all I have to do is change...

Code: Select all

void Minimap::setMapImage(Image *img)
{
    if (mMapImage)
    {
        mMapImage->decRef();
    }

    mMapImage = img;

    if (mMapImage)
    {
        setVisible(true);
        mMapImage->setAlpha(0.7);
    }
    else
    {
        setVisible(false);
    }
}
to...

Code: Select all

void Minimap::setMapImage(Image *img)
{
    if (mMapImage)
    {
        mMapImage->decRef();
    }

    mMapImage = img;

    if (mMapImage)
    {
        setVisible(false);
    }
    else
    {
        setVisible(true);
        mMapImage->setAlpha(0.7);
    }
}
to have the minimap off by default?
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Re: How do I keep the minimap hidden by default? version 0.0.24

Post by ElvenProgrammer » 19 Feb 2008, 09:12

Doesn't seem to be the right way, you could create a mantis ticket and work on a patch
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: How do I keep the minimap hidden by default? version 0.0.24

Post by Crush » 19 Feb 2008, 13:08

When no map image exists you make the nonexisten map image visible and transparent? This should cause a crash when you go to a map without a minimap image.

When you really want to disable the minimap permanently you should just insert the line

Code: Select all

return;
between the lines 71 and 72 of minimap.cpp.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
bigglesworth
Novice
Novice
Posts: 211
Joined: 11 Nov 2007, 04:23
Location: Land of Ooo

Re: How do I keep the minimap hidden by default? version 0.0.24

Post by bigglesworth » 20 Feb 2008, 09:29

I don't think I want to permanently disable the minimap.

ElvenProgrammer, I'll request this through mantis and follow what happens.

Crush, I will try your suggestion, only to see if I desire a minimap at all. If eventually the minimap shows a location that is hidden on the map itself, I will regret it! ;)

Thank you.

Edit: This has mantis id #222. http://mantis.themanaworld.org/view.php?id=222
Right click to open in a new window or tab.
User avatar
knivey
Novice
Novice
Posts: 187
Joined: 05 Mar 2006, 04:01
Location: Your Base
Contact:

Re: How do I keep the minimap hidden by default? version 0.0.24

Post by knivey » 25 Feb 2008, 05:42

I would suggest changing the following in minimap.cpp

Code: Select all

    if (mMapImage)
    {
        setVisible(true);
        mMapImage->setAlpha(0.7);
    }
    else
    {
        setVisible(false);
    }
to this...

Code: Select all

    if (mMapImage)
    {
        mMapImage->setAlpha(0.7);
    }
this should keep the map from reappearing when a new mapimage loads and shouldn't affect users who prefer to see the minimap
if you're on a map that has no minimap image then it just shows the map square with no map

if you want to make it real sophisticated you could use the configuration class to store your preference on it being shown
All your base are belong to us.
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Re: How do I keep the minimap hidden by default? version 0.0.24

Post by ElvenProgrammer » 25 Feb 2008, 11:14

@knivey: could you make your changes in the from of a patch and submit it to our bug tracker? http://mantis.themanaworld.org/view.php?id=222

Actually some base code for keeping the status of gui windows is there, whoever wants to improve it and apply it also to the minimap window is welcome.
Post Reply