Skip to content

Commit

Permalink
Add remastered support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahmul committed May 24, 2018
1 parent d93b95a commit 5946d81
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>SpeedSouls</groupId>
<artifactId>SaveOrganizer</artifactId>
<version>1.4-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
4 changes: 3 additions & 1 deletion src/com/speedsouls/organizer/data/OrganizerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
public class OrganizerManager
{

public static final String VERSION = "1.4";
public static final String VERSION = "1.4.1";

/**
* Constants defining various URLs.
Expand Down Expand Up @@ -682,6 +682,8 @@ public static boolean isAlwaysOnTop()
*/
public static void switchCurrentGameFileWritableState()
{
if (getSelectedGame().equals(Game.DARK_SOULS_REMASTERED))
return;
File gameFile = getSelectedGame().getSaveFileLocation();
gameFile.setWritable(!gameFile.canWrite());
fireGameFileWritableStateChangedEvent(gameFile.canWrite());
Expand Down
1 change: 1 addition & 0 deletions src/com/speedsouls/organizer/games/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum Game
{

DARK_SOULS("Dark Souls", "DS1", "DRAKS0005.sl2"),
DARK_SOULS_REMASTERED("Dark Souls Remastered", "DSR", "DRAKS0005.sl2"),
DARK_SOULS_II("Dark Souls II", "DS2", "DARKSII0000.sl2"),
DARK_SOULS_II_SOTFS("Dark Souls II: SotFS", "DS2SOTFS", "DS2SOFS0000.sl2"),
DARK_SOULS_III("Dark Souls III", "DS3", "DS30000.sl2");
Expand Down
3 changes: 2 additions & 1 deletion src/com/speedsouls/organizer/savelist/GamesComboBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author Kahmul (www.twitch.tv/kahmul78)
* @date 29 Sep 2015
*/
public class GamesComboBox extends JComboBox<Game>implements ListCellRenderer<Game>
public class GamesComboBox extends JComboBox<Game> implements ListCellRenderer<Game>
{

private static final long serialVersionUID = -3428616630686103313L;
Expand All @@ -39,6 +39,7 @@ public GamesComboBox(Game[] games, ProfilesComboBox profilesCB)
fillWith(games);

setRenderer(this);
setPrototypeDisplayValue(Game.DARK_SOULS_II_SOTFS);
addItemListener(event -> {
if (event.getStateChange() == ItemEvent.SELECTED)
{
Expand Down
9 changes: 8 additions & 1 deletion src/com/speedsouls/organizer/savelist/ReadOnlyButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public ReadOnlyButton(File file, ImageIcon img)
addMouseListener(this);
OrganizerManager.addProfileListener(this);
OrganizerManager.addSaveListener(this);

if (OrganizerManager.getSelectedGame().equals(Game.DARK_SOULS_REMASTERED))
setVisible(false);
}


Expand Down Expand Up @@ -82,7 +85,7 @@ public void setFile(File file)
*/
public void doClick()
{
if (file == null || !file.exists())
if (file == null || !file.exists() || OrganizerManager.getSelectedGame().equals(Game.DARK_SOULS_REMASTERED))
return;
setEnabled(!isEnabled());
file.setWritable(!isEnabled());
Expand Down Expand Up @@ -159,6 +162,10 @@ public void changedToProfile(Profile profile)
public void changedToGame(Game game)
{
setFile(game.getSaveFileLocation());
if (game.equals(Game.DARK_SOULS_REMASTERED))
setVisible(false);
else
setVisible(true);
}


Expand Down
2 changes: 2 additions & 0 deletions src/com/speedsouls/organizer/savelist/SaveList.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public void sortEntries()
{
SaveListEntry selectedEntry = OrganizerManager.getSelectedEntry();
Profile currentProfile = OrganizerManager.getSelectedProfile();
if (currentProfile.getRoot() == null)
return;
currentProfile.getRoot().sort();
fillWith(currentProfile, null);
int selectedIndex = ((DefaultListModel<SaveListEntry>) getModel()).indexOf(selectedEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javax.swing.KeyStroke;

import com.speedsouls.organizer.data.OrganizerManager;
import com.speedsouls.organizer.games.Game;

import jiconfont.icons.Elusive;
import jiconfont.icons.Entypo;
Expand Down Expand Up @@ -55,7 +56,8 @@ public SaveListContextMenu(SaveList saveList, int x, int y)
add(itemAdd);
add(itemRemove);
add(itemEdit);
add(itemReadOnly);
if (!OrganizerManager.getSelectedGame().equals(Game.DARK_SOULS_REMASTERED))
add(itemReadOnly);
add(itemRefresh);
add(itemOpenInExplorer);

Expand Down

0 comments on commit 5946d81

Please sign in to comment.