"[E] to enable building" hint while building is paused (#3857)
* Show building hints while building is paused * Add hint: [E] to enable building * Remove .left() * Fix build enable hint display inconsistencies when changing build auto-pause setting * Combine building hint tables * Fix indentation
This commit is contained in:
@@ -312,6 +312,7 @@ cancelbuilding = [accent][[{0}][] to clear plan
|
|||||||
selectschematic = [accent][[{0}][] to select+copy
|
selectschematic = [accent][[{0}][] to select+copy
|
||||||
pausebuilding = [accent][[{0}][] to pause building
|
pausebuilding = [accent][[{0}][] to pause building
|
||||||
resumebuilding = [scarlet][[{0}][] to resume building
|
resumebuilding = [scarlet][[{0}][] to resume building
|
||||||
|
enablebuilding = [scarlet][[{0}][] to enable building
|
||||||
showui = UI hidden.\nPress [accent][[{0}][] to show UI.
|
showui = UI hidden.\nPress [accent][[{0}][] to show UI.
|
||||||
wave = [accent]Wave {0}
|
wave = [accent]Wave {0}
|
||||||
wave.cap = [accent]Wave {0}/{1}
|
wave.cap = [accent]Wave {0}/{1}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
/** Selected build request for movement. */
|
/** Selected build request for movement. */
|
||||||
public @Nullable BuildPlan sreq;
|
public @Nullable BuildPlan sreq;
|
||||||
/** Whether player is currently deleting removal requests. */
|
/** Whether player is currently deleting removal requests. */
|
||||||
public boolean deleting = false, shouldShoot = false, panning = false;
|
public boolean deleting = false, wasBuilding = true, shouldShoot = false, panning = false;
|
||||||
/** Mouse pan speed. */
|
/** Mouse pan speed. */
|
||||||
public float panScale = 0.005f, panSpeed = 4.5f, panBoostSpeed = 11f;
|
public float panScale = 0.005f, panSpeed = 4.5f, panBoostSpeed = 11f;
|
||||||
|
|
||||||
@@ -62,18 +62,19 @@ public class DesktopInput extends InputHandler{
|
|||||||
group.fill(t -> {
|
group.fill(t -> {
|
||||||
t.bottom();
|
t.bottom();
|
||||||
t.visible(() -> {
|
t.visible(() -> {
|
||||||
t.color.a = Mathf.lerpDelta(t.color.a, player.unit().isBuilding() ? 1f : 0f, 0.15f);
|
t.color.a = Mathf.lerpDelta(t.color.a, !isBuilding && !Core.settings.getBool("buildautopause") || player.unit().isBuilding() ? 1f : 0f, 0.15f);
|
||||||
|
|
||||||
return ui.hudfrag.shown && Core.settings.getBool("hints") && selectRequests.isEmpty() && t.color.a > 0.01f;
|
return ui.hudfrag.shown && Core.settings.getBool("hints") && selectRequests.isEmpty() && t.color.a > 0.01f;
|
||||||
});
|
});
|
||||||
t.touchable(() -> t.color.a < 0.1f ? Touchable.disabled : Touchable.childrenOnly);
|
t.touchable(() -> t.color.a < 0.1f ? Touchable.disabled : Touchable.childrenOnly);
|
||||||
t.table(Styles.black6, b -> {
|
t.table(Styles.black6, b -> {
|
||||||
b.defaults().left();
|
b.defaults().left();
|
||||||
b.label(() -> Core.bundle.format(!isBuilding ? "resumebuilding" : "pausebuilding", Core.keybinds.get(Binding.pause_building).key.toString())).style(Styles.outlineLabel);
|
b.label(() -> ((!isBuilding || !wasBuilding) && !Core.settings.getBool("buildautopause") && !player.unit().isBuilding() ?
|
||||||
b.row();
|
Core.bundle.format("enablebuilding", Core.keybinds.get(Binding.pause_building).key.toString()) :
|
||||||
b.label(() -> Core.bundle.format("cancelbuilding", Core.keybinds.get(Binding.clear_building).key.toString())).style(Styles.outlineLabel);
|
Core.bundle.format(isBuilding ? "pausebuilding" : "resumebuilding", Core.keybinds.get(Binding.pause_building).key.toString()) +
|
||||||
b.row();
|
"\n" + Core.bundle.format("cancelbuilding", Core.keybinds.get(Binding.clear_building).key.toString()) +
|
||||||
b.label(() -> Core.bundle.format("selectschematic", Core.keybinds.get(Binding.schematic_select).key.toString())).style(Styles.outlineLabel);
|
"\n" + Core.bundle.format("selectschematic", Core.keybinds.get(Binding.schematic_select).key.toString())
|
||||||
|
)).style(Styles.outlineLabel);
|
||||||
}).margin(10f);
|
}).margin(10f);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -454,6 +455,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
buildWasAutoPaused = false;
|
buildWasAutoPaused = false;
|
||||||
|
|
||||||
if(isBuilding){
|
if(isBuilding){
|
||||||
|
wasBuilding = player.unit().isBuilding();
|
||||||
player.shooting = false;
|
player.shooting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -561,6 +563,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
mode = none;
|
mode = none;
|
||||||
|
wasBuilding = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.toggle_block_status)){
|
if(Core.input.keyTap(Binding.toggle_block_status)){
|
||||||
|
|||||||
Reference in New Issue
Block a user