-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Artemis Messenger 5.3.2: Re-fixed player ship name bug
- Loading branch information
1 parent
311c530
commit 6d226a6
Showing
10 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Artemis Messenger 5.3.1 | ||
# Artemis Messenger 5.3.2 | ||
|
||
## What is Artemis Messenger? | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
bin/dexedLibs/appcompat_v7-c958b99d5111e7b7a41e540bcdbc30da.jar
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package artemis.messenger; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
public enum RewardType { | ||
BATTERY(R.string.batteryChargePref, R.string.batteryChargeKey, "batteries."), | ||
PRODUCTION(R.string.prodSpeedPref, R.string.speedKey, "speed."), | ||
NUCLEAR(R.string.nukePref, R.string.nuclearKey, "torpedoes."), | ||
COOLANT(R.string.extraCoolantPref, R.string.extraCoolantKey, "coolant."), | ||
SHIELD(R.string.shieldBoostPref, R.string.shieldKey, "generators."); | ||
|
||
private final int value, prefKey; | ||
private final String keySet; | ||
private String displayName; | ||
|
||
private boolean shown; | ||
|
||
RewardType(int v, int p, String... s) { | ||
value = v; | ||
prefKey = p; | ||
String keys = ""; | ||
for (String key: s) { | ||
if (!keys.isEmpty()) keys += "^"; | ||
keys += key; | ||
} | ||
keySet = keys; | ||
shown = true; | ||
} | ||
|
||
public static RewardType from(String key) { | ||
for (RewardType type: values()) { | ||
if (key.equals(type.displayName) || type.matches(key)) | ||
return type; | ||
} | ||
|
||
throw new RuntimeException("No RewardType conforms to " + key); | ||
} | ||
|
||
public boolean matches(String key) { | ||
return keySet.contains(key); | ||
} | ||
|
||
public String getValue(Context context) { | ||
return context.getString(value); | ||
} | ||
|
||
public boolean isShown() { return shown; } | ||
|
||
public static void updateVisibility(SharedPreferences preferences) { | ||
for (RewardType type: values()) { | ||
type.shown = preferences.getBoolean(type.displayName, true); | ||
} | ||
} | ||
|
||
public static void initDisplayNames(Context context) { | ||
for (RewardType type: values()) { | ||
if (type.displayName != null) break; | ||
type.displayName = context.getString(type.prefKey); | ||
} | ||
} | ||
} |