mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-04 00:46:01 +02:00
Add tool tips to build items
This commit is contained in:
@@ -28,7 +28,7 @@ public class GameManager {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
EntityRegistry.register(new RegistryEntry("test", "test machine", TestMachine.class));
|
EntityRegistry.register(new RegistryEntry("test", "test machine", TestMachine.class));
|
||||||
EntityRegistry.register(new RegistryEntry("test2", "test machine", TestMachine2.class));
|
EntityRegistry.register(new RegistryEntry("test2", "test machine2", TestMachine2.class));
|
||||||
} catch (AlreadyExistsException e) {
|
} catch (AlreadyExistsException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.yes.yes.utils.EntityRegistry;
|
|||||||
import com.yes.yes.world.Chunk;
|
import com.yes.yes.world.Chunk;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.Tooltip;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -27,8 +28,11 @@ public class BuildItem extends javafx.scene.layout.StackPane {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
Button button = new Button();
|
Tooltip tooltip = new Tooltip();
|
||||||
|
tooltip.setText(display_name);
|
||||||
|
|
||||||
|
Button button = new Button();
|
||||||
|
button.setTooltip(tooltip);
|
||||||
button.setStyle("-fx-background-color: null; -fx-border-color: null");
|
button.setStyle("-fx-background-color: null; -fx-border-color: null");
|
||||||
button.setPrefSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);
|
button.setPrefSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);
|
||||||
button.setMinSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);
|
button.setMinSize(Chunk.ENTITY_SIZE, Chunk.ENTITY_SIZE);
|
||||||
|
|||||||
Reference in New Issue
Block a user