Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Store minimap zoom level in the game properties #1832

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/com/lilithsthrone/game/Properties.java
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ public void loadPropertiesFromXML(){
if(Main.isVersionOlderThan(versionNumber, "0.4.9.6")) {
values.add(PropertyValue.lipLispContent);
}
if(Main.isVersionOlderThan(versionNumber, "0.4.10.1")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: make sure this is the correct version.

values.add(PropertyValue.mapZoomedIn);
}


} else {
Expand Down
3 changes: 2 additions & 1 deletion src/com/lilithsthrone/game/PropertyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public enum PropertyValue {
newWeaponDiscovered(false),
newClothingDiscovered(false),
newItemDiscovered(false),
newRaceDiscovered(false);
newRaceDiscovered(false),
mapZoomedIn(true);

private boolean defaultValue;
private boolean fetishRelated;
Expand Down
11 changes: 5 additions & 6 deletions src/com/lilithsthrone/rendering/RenderingEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
public enum RenderingEngine {
ENGINE;

private static boolean zoomedIn = true;
private static boolean renderedDisabledMap = false;

private static int pageLeft = 0;
Expand Down Expand Up @@ -2122,10 +2121,10 @@ public String renderedHTMLMap() {
// renderedDisabledMap = true;
// }

int mapSize = zoomedIn ? 2 : 3;
float unit = zoomedIn ? 18f : 13.25f;
int mapSize = isZoomedIn() ? 2 : 3;
float unit = isZoomedIn() ? 18f : 13.25f;

String tileWidthStyle = "width:" + unit + "%; border-width:1%; margin:"+(zoomedIn?1:0.5)+"%;";
String tileWidthStyle = "width:" + unit + "%; border-width:1%; margin:"+(isZoomedIn()?1:0.5)+"%;";
String tileMovementDisabledStyle = "border-color:#111;";
Vector2i playerPosition = Main.game.getPlayer().getLocation();

Expand Down Expand Up @@ -2500,11 +2499,11 @@ public void renderButtonsRight() {
}

public static boolean isZoomedIn() {
return zoomedIn;
return Main.getProperties().hasValue(PropertyValue.mapZoomedIn);
}

public static void setZoomedIn(boolean zoomedIn) {
RenderingEngine.zoomedIn = zoomedIn;
Main.getProperties().setValue(PropertyValue.mapZoomedIn, zoomedIn);
}

public static boolean isRenderedDisabledMap() {
Expand Down