Skip to content

Commit

Permalink
feat(code): Starry Map cleanup (#208)
Browse files Browse the repository at this point in the history
Removing un-needed code from earlier version of Starry Map.
  • Loading branch information
Zitchas authored Feb 3, 2025
1 parent 7918224 commit e74853d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 58 deletions.
26 changes: 0 additions & 26 deletions data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2037,19 +2037,6 @@ interface "map buttons" bottom right
from -50 -90 to -80 -120
size 18

sprite "ui/map display"
from 0 -120 to -49 -169
button x ""
from 0 -120 to -49 -169
visible if "map is starry"
ring "system ring"
center -24 -145
dimensions 10 10
color "map system ring"
size 2
visible if "!map is starry"
sprite "ui/star icon"
from 0 -120 to -49 -169


interface "map buttons (small screen)" bottom right
Expand Down Expand Up @@ -2106,19 +2093,6 @@ interface "map buttons (small screen)" bottom right
from -50 -90 to -80 -120
size 18

sprite "ui/map display"
from 0 -120 to -49 -169
button x ""
from 0 -120 to -49 -169
visible if "map is starry"
ring "system ring"
center -24 -145
dimensions 10 10
color "map system ring"
size 2
visible if "!map is starry"
sprite "ui/star icon"
from 0 -120 to -49 -169


interface "map"
Expand Down
8 changes: 0 additions & 8 deletions source/MapPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,6 @@ void MapPanel::FinishDrawing(const string &buttonCondition)
info.SetCondition("max zoom");
if(player.MapZoom() <= static_cast<int>(mapInterface->GetValue("min zoom")))
info.SetCondition("min zoom");
mapIsStarry = player.StarryMap();
if(mapIsStarry)
{
info.SetCondition("map is starry");
info.SetBar("system ring", 1.);
}
const Interface *mapButtonUi = GameData::Interfaces().Get(Screen::Width() < 1280
? "map buttons (small screen)" : "map buttons");
mapButtonUi->Draw(info, this);
Expand Down Expand Up @@ -622,8 +616,6 @@ bool MapPanel::KeyDown(SDL_Keycode key, Uint16 mod, const Command &command, bool
this, &MapPanel::Find, "Search for:", "", Truncate::NONE, true));
return true;
}
else if(key == 'x')
player.SetStarryMap(!mapIsStarry);
else if(key == SDLK_PLUS || key == SDLK_KP_PLUS || key == SDLK_EQUALS)
player.SetMapZoom(min<int>(mapInterface->GetValue("max zoom"), player.MapZoom() + 1));
else if(key == SDLK_MINUS || key == SDLK_KP_MINUS)
Expand Down
1 change: 0 additions & 1 deletion source/MapPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class MapPanel : public Panel {
int recentering = 0;
int commodity;
int step = 0;
bool mapIsStarry = false;
std::string buttonCondition;

// Distance from the screen center to the nearest owned system,
Expand Down
19 changes: 0 additions & 19 deletions source/PlayerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ void PlayerInfo::Load(const filesystem::path &path)
mapColoring = child.Value(1);
else if(child.Token(0) == "map zoom" && child.Size() >= 2)
mapZoom = child.Value(1);
else if(child.Token(0) == "starry map" && child.Size() >= 2)
isStarry = child.Value(1);
else if(child.Token(0) == "collapsed" && child.Size() >= 2)
{
for(const DataNode &grand : child)
Expand Down Expand Up @@ -3071,22 +3069,6 @@ void PlayerInfo::SetMapZoom(int level)



// Get the map display mode.
bool PlayerInfo::StarryMap() const
{
return isStarry;
}



// Set the map display mode.
void PlayerInfo::SetStarryMap(bool state)
{
isStarry = state;
}



// Get the set of collapsed categories for the named panel.
set<string> &PlayerInfo::Collapsed(const string &name)
{
Expand Down Expand Up @@ -4396,7 +4378,6 @@ void PlayerInfo::Save(DataWriter &out) const
// Save the current setting for the map coloring;
out.Write("map coloring", mapColoring);
out.Write("map zoom", mapZoom);
out.Write("starry map", isStarry);
// Remember what categories are collapsed.
for(const auto &it : collapsed)
{
Expand Down
4 changes: 0 additions & 4 deletions source/PlayerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ class PlayerInfo {
// Get or set the map zoom level.
int MapZoom() const;
void SetMapZoom(int level);
// Get or set the map display mode.
bool StarryMap() const;
void SetStarryMap(bool state);
// Get the set of collapsed categories for the named panel.
std::set<std::string> &Collapsed(const std::string &name);
// Should help dialogs relating to carriers be displayed?
Expand Down Expand Up @@ -473,7 +470,6 @@ class PlayerInfo {
// Currently selected coloring, in the map panel (defaults to reputation):
int mapColoring = -6;
int mapZoom = 0;
bool isStarry = false;

// Currently collapsed categories for various panels.
std::map<std::string, std::set<std::string>> collapsed;
Expand Down

0 comments on commit e74853d

Please sign in to comment.