onConfigureClosed (#6523)
* onConfigureClosed * Run the closing of the previous block's config on the opening of another
This commit is contained in:
@@ -1249,6 +1249,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
return self() != other;
|
return self() != other;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when this block's config menu is closed
|
||||||
|
*/
|
||||||
|
public void onConfigureClosed(){}
|
||||||
|
|
||||||
/** Returns whether this config menu should show when the specified player taps it. */
|
/** Returns whether this config menu should show when the specified player taps it. */
|
||||||
public boolean shouldShowConfigure(Player player){
|
public boolean shouldShowConfigure(Player player){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class BlockConfigFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showConfig(Building tile){
|
public void showConfig(Building tile){
|
||||||
|
if(configTile != null) configTile.onConfigureClosed();
|
||||||
if(tile.configTapped()){
|
if(tile.configTapped()){
|
||||||
configTile = tile;
|
configTile = tile;
|
||||||
|
|
||||||
@@ -82,6 +83,7 @@ public class BlockConfigFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void hideConfig(){
|
public void hideConfig(){
|
||||||
|
if(configTile != null) configTile.onConfigureClosed();
|
||||||
configTile = null;
|
configTile = null;
|
||||||
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interp.pow3Out), Actions.visible(false));
|
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interp.pow3Out), Actions.visible(false));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user