Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
Now InputPanel cann't be called when changing view from WorkingScreen to StartScreen
  • Loading branch information
Nikola-Mircic committed Sep 16, 2020
1 parent f689688 commit c6e6848
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/com/nm/elems/PageElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.nm.elems.tagsystem.Tag;
import com.nm.wpc.filesystem.FileManager;


/*
* Class: com.nm.elems.PageElement
* Superclass :
Expand Down
15 changes: 14 additions & 1 deletion src/com/nm/wpc/screen/MainScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MainScreen extends Screen{

private InputListener listener;

private boolean work = true;
private boolean work;

public MainScreen(int w,int h) {
super(w, h);
Expand Down Expand Up @@ -61,12 +61,15 @@ public void paint(Graphics g) {
}else {
this.content = start.getContent();
}

g.drawImage(this.content, 0, 0, null);

if(panelsActivity) {
drawPanels(g);
}else{
panels.clear();
}

g.dispose();
}

Expand All @@ -78,12 +81,14 @@ private void drawPanels(Graphics g) {

public void changeContent() {
panelsActivity = false;

work = !work;
repaint();
}

public void changeContent(String projectName) {
panelsActivity = false;

working.setProjectName(projectName);
work = true;
repaint();
Expand Down Expand Up @@ -198,5 +203,13 @@ public InputPanel getClicked(int x,int y) {
}
return null;
}

public boolean isWork() {
return work;
}

public void setWork(boolean work) {
this.work = work;
}

}
4 changes: 3 additions & 1 deletion src/com/nm/wpc/screen/WorkingScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ private PageElement getElement(Tag tag) {

@Override
public void onMousePressed(int x,int y) {
if(x>(width-66) && y>(height-64))
if(x>(width-66) && y>(height-64)) {
ms.changeContent();
return;
}

if(editors[eeIdx].findEditingField()!=null)
((ElementEditor)this.editors[eeIdx]).checkValues();
Expand Down

0 comments on commit c6e6848

Please sign in to comment.