Skip to content

Commit

Permalink
Center Lines and guides color change
Browse files Browse the repository at this point in the history
  • Loading branch information
etoshapovalov authored and mchorse committed Nov 25, 2021
1 parent d87f85b commit 14ef7b4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aperture gradle properties
version=1.7
mclib=2.3.6
minema=3.6
minema=3.6.1

mc_version=1.12.2
forge_version=14.23.3.2655
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/mchorse/aperture/Aperture.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

import mchorse.aperture.commands.CommandAperture;
import mchorse.mclib.McLib;
import mchorse.mclib.client.gui.utils.ValueColors;
import mchorse.mclib.commands.utils.L10n;
import mchorse.mclib.config.ConfigBuilder;
import mchorse.mclib.config.values.ValueBoolean;
import mchorse.mclib.config.values.ValueFloat;
import mchorse.mclib.config.values.ValueInt;
import mchorse.mclib.config.values.ValueRL;
import mchorse.mclib.config.values.ValueString;
import mchorse.mclib.config.values.*;
import mchorse.mclib.events.RegisterConfigEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
Expand Down Expand Up @@ -76,7 +73,11 @@ public class Aperture
public static ValueRL editorOverlayRL;
public static ValueBoolean editorF1Tooltip;
public static ValueBoolean editorDisplayPosition;

public static ValueInt editorGuidesColor;
public static ValueBoolean editorRuleOfThirds;
public static ValueBoolean editorCenterLines;

public static ValueBoolean editorCrosshair;
public static ValueBoolean editorLetterbox;
public static ValueString editorLetterboxAspect;
Expand Down Expand Up @@ -156,7 +157,9 @@ public void onConfigRegister(RegisterConfigEvent event)
editorOverlayRL = builder.getRL("overlay_rl", null);
editorF1Tooltip = builder.getBoolean("f1_tooltip", true);
editorDisplayPosition = builder.getBoolean("position", false);
editorGuidesColor = builder.getInt("guides_color",0xcccc0000);
editorRuleOfThirds = builder.getBoolean("rule_of_thirds", false);
editorCenterLines = builder.getBoolean("center_lines", false);
editorCrosshair = builder.getBoolean("crosshair", false);
editorLetterbox = builder.getBoolean("letter_box", false);
editorLetterboxAspect = builder.getString("aspect_ratio", "21:9");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1604,14 +1604,20 @@ private void drawOverlays()

if (Aperture.editorRuleOfThirds.get())
{
int color = 0xcccc0000;
int color = Aperture.editorGuidesColor.get();

Gui.drawRect(rx + rw / 3 - 1, ry, rx + rw / 3, ry + rh, color);
Gui.drawRect(rx + rw - rw / 3, ry, rx + rw - rw / 3 + 1, ry + rh, color);

Gui.drawRect(rx, ry + rh / 3 - 1, rx + rw, ry + rh / 3, color);
Gui.drawRect(rx, ry + rh - rh / 3, rx + rw, ry + rh - rh / 3 + 1, color);
}
if(Aperture.editorCenterLines.get())
{
int color = Aperture.editorGuidesColor.get();
this.drawHorizontalLine(0,this.width,this.height/2,color);
this.drawVerticalLine(this.width/2,0,this.height,color);
}

if (Aperture.editorCrosshair.get())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import mchorse.mclib.client.gui.framework.elements.IGuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiColorElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTexturePicker;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.Color;
import net.minecraft.client.Minecraft;

public class GuiConfigCameraOptions extends GuiAbstractConfigOptions
Expand All @@ -21,7 +23,9 @@ public class GuiConfigCameraOptions extends GuiAbstractConfigOptions
public GuiToggleElement flight;
public GuiToggleElement displayPosition;
public GuiToggleElement essentialsTeleport;
public GuiColorElement guidesColor;
public GuiToggleElement ruleOfThirds;
public GuiToggleElement centerLines;
public GuiToggleElement crosshair;
public GuiToggleElement letterBox;
public GuiTextElement aspectRatio;
Expand Down Expand Up @@ -60,7 +64,10 @@ public GuiConfigCameraOptions(Minecraft mc, GuiCameraEditor editor)

this.displayPosition = new GuiToggleElement(mc, Aperture.editorDisplayPosition);
this.essentialsTeleport = new GuiToggleElement(mc, Aperture.essentialsTeleport);
this.guidesColor = new GuiColorElement(mc, Aperture.editorGuidesColor);
this.guidesColor.picker.editAlpha = true;
this.ruleOfThirds = new GuiToggleElement(mc, Aperture.editorRuleOfThirds);
this.centerLines = new GuiToggleElement(mc, Aperture.editorCenterLines);
this.crosshair = new GuiToggleElement(mc, Aperture.editorCrosshair);
this.letterBox = new GuiToggleElement(mc, Aperture.editorLetterbox);
this.aspectRatio = new GuiTextElement(mc, Aperture.editorLetterboxAspect, this.editor::setAspectRatio);
Expand All @@ -86,7 +93,7 @@ public GuiConfigCameraOptions(Minecraft mc, GuiCameraEditor editor)
this.overlayPicker.flex().relative(this.editor.viewport).wh(1F, 1F);
this.hideChat = new GuiToggleElement(mc, Aperture.editorHideChat);

this.add(this.outside, this.spectator, this.renderPath, this.sync, this.flight, this.displayPosition, this.ruleOfThirds, this.crosshair, this.letterBox, this.aspectRatio, this.loop, this.overlay, this.pickOverlay, this.hideChat);
this.add(this.outside, this.spectator, this.renderPath, this.sync, this.flight, this.displayPosition, this.guidesColor, this.ruleOfThirds, this.centerLines, this.crosshair, this.letterBox, this.aspectRatio, this.loop, this.overlay, this.pickOverlay, this.hideChat);

if (!mc.isSingleplayer())
{
Expand All @@ -113,7 +120,9 @@ public void update()
this.flight.toggled(this.editor.flight.isFlightEnabled());
this.displayPosition.toggled(Aperture.editorDisplayPosition.get());
this.essentialsTeleport.toggled(Aperture.essentialsTeleport.get());
this.guidesColor.picker.color = new Color(Aperture.editorGuidesColor.get());
this.ruleOfThirds.toggled(Aperture.editorRuleOfThirds.get());
this.centerLines.toggled(Aperture.editorCenterLines.get());
this.crosshair.toggled(Aperture.editorCrosshair.get());
this.letterBox.toggled(Aperture.editorLetterbox.get());
this.aspectRatio.setText(Aperture.editorLetterboxAspect.get());
Expand Down

0 comments on commit 14ef7b4

Please sign in to comment.