diff --git a/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java b/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java index 3710a5723..2d68b39fd 100755 --- a/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java +++ b/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java @@ -1877,7 +1877,7 @@ protected void onMissionStarted() if (missionBehaviour.lowLevelInputs) { Minecraft.getMinecraft().gameSettings.hideGUI = false; - Minecraft.getMinecraft().gameSettings.guiScale = 2; + Minecraft.getMinecraft().gameSettings.guiScale = missionBehaviour.guiScale; Minecraft.getMinecraft().gameSettings.fancyGraphics = true; } else { // Disable the gui for the episode! diff --git a/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java b/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java index a3bf94fcf..421991ae5 100755 --- a/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java +++ b/minerl/Malmo/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MissionBehaviour.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.logging.Logger; import com.microsoft.Malmo.MissionHandlerInterfaces.IAudioProducer; import com.microsoft.Malmo.MissionHandlerInterfaces.ICommandHandler; @@ -37,7 +36,6 @@ import com.microsoft.Malmo.Schemas.AgentSection; import com.microsoft.Malmo.Schemas.MissionInit; import com.microsoft.Malmo.Schemas.ServerHandlers; -import com.microsoft.Malmo.Utils.TimeHelper; /** Holder class for the various MissionHandler interfaces that together define the behaviour of the mission.
*/ @@ -53,6 +51,7 @@ public class MissionBehaviour public IPerformanceProducer performanceProducer = null; public IWantToQuit quitProducer = null; public boolean lowLevelInputs = false; + public Integer guiScale = null; private String failedHandlers = ""; @@ -120,6 +119,7 @@ private void initAgent(MissionInit missionInit) // TODO hack - low level inputs are read from first agent. Ideally they should be either agent-specific, // or mission-level lowLevelInputs = agents.get(0).getAgentStart().isLowLevelInputs() != null && agents.get(0).getAgentStart().isLowLevelInputs(); + guiScale = agents.get(0).getAgentStart().getGuiScale(); } public boolean addExtraHandlers(List handlers) diff --git a/minerl/Malmo/Schemas/Mission.xsd b/minerl/Malmo/Schemas/Mission.xsd index 565800331..2512b1156 100755 --- a/minerl/Malmo/Schemas/Mission.xsd +++ b/minerl/Malmo/Schemas/Mission.xsd @@ -242,6 +242,13 @@ + + + + Overrides default gui scale + + + diff --git a/minerl/herobraine/env_specs/human_controls.py b/minerl/herobraine/env_specs/human_controls.py index 7ca489dfc..a26f98fc1 100644 --- a/minerl/herobraine/env_specs/human_controls.py +++ b/minerl/herobraine/env_specs/human_controls.py @@ -54,4 +54,4 @@ def create_monitors(self) -> List[TranslationHandler]: return [] # No monitors by default!o def create_agent_start(self) -> List[Handler]: - return [handlers.LowLevelInputsAgentStart()] + return [handlers.LowLevelInputsAgentStart(), handlers.GuiScale(5)] diff --git a/minerl/herobraine/hero/handlers/agent/start.py b/minerl/herobraine/hero/handlers/agent/start.py index 4d1ace19f..6bfe276ab 100644 --- a/minerl/herobraine/hero/handlers/agent/start.py +++ b/minerl/herobraine/hero/handlers/agent/start.py @@ -218,3 +218,13 @@ def to_string(self) -> str: def xml_template(self) -> str: return "true" + +class GuiScale(Handler): + def __init__(self, gui_scale=4.0): + self.gui_scale = gui_scale + + def to_string(self) -> str: + return "gui_scale" + + def xml_template(self) -> str: + return "{{gui_scale}}"