Skip to content

Commit

Permalink
Fixed some more bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed Apr 9, 2021
1 parent 0ec748e commit 23ca1e0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class WorkspaceTabula extends Workspace

public Identifiable<?> clipboard = null;

public HeadInfo headInfoRender = null;
public HeadInfo<?> headInfoRender = null;

private WorkspaceTabula(Screen lastScreen, Mainframe mainframe, int oriScale)
{
Expand Down Expand Up @@ -925,7 +925,7 @@ public void closeScreen()
{
for(Window<?> window : windows)
{
if(window.getClass().getName().contains("popup") || window instanceof WindowEditList) //I'm lazy ok
if(window.getClass().getName().contains("popup") && !(window instanceof WindowSaveAs) || window instanceof WindowEditList) //I'm lazy ok
{
removeWindow(window);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setCurrentProject(Mainframe.ProjectInfo info)
@Override
public void projectChanged(ChangeType type)
{
if(type == ChangeType.PROJECTS)
if(type == ChangeType.PROJECTS || type == ChangeType.PROJECT)
{
populate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;

public class WindowTexture extends Window<WorkspaceTabula>
implements IProjectInfo
Expand Down Expand Up @@ -247,7 +248,13 @@ public void tick()
}
catch(IOException ignored){}

parentFragment.parent.mainframe.setImage(currentInfo, image, true);
if(!Arrays.equals(currentInfo.project.getTextureBytes(), image))
{
parentFragment.parent.mainframe.setImage(currentInfo, image, true);
}

currentInfo.textureFileMd5 = md5;
currentInfo.project.textureFileMd5 = md5;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,9 @@ public ProjectInfo(@Nonnull Mainframe mainframe, Project project)
project.setImageBytes(image);
mainframe.workspace.projectChanged(IProjectInfo.ChangeType.TEXTURE);
}

textureFile = file;
textureFileMd5 = md5;
}
}
}
Expand Down

0 comments on commit 23ca1e0

Please sign in to comment.