-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed to bind based on UV coordinates and Improved ModelViewScreen
- Loading branch information
Showing
13 changed files
with
295 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
common/src/main/java/com/xtracr/realcamera/gui/FloatFieldWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.xtracr.realcamera.gui; | ||
|
||
import net.minecraft.client.font.TextRenderer; | ||
import net.minecraft.client.gui.widget.TextFieldWidget; | ||
import net.minecraft.text.Text; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
|
||
public class FloatFieldWidget extends TextFieldWidget { | ||
|
||
public FloatFieldWidget(TextRenderer textRenderer, int x, int y, int width, int height, @Nullable FloatFieldWidget copyFrom, Text text) { | ||
super(textRenderer, x, y, width, height, text); | ||
setMaxLength(8); | ||
setValue(0); | ||
if (copyFrom != null) setValue(copyFrom.getValue()); | ||
} | ||
|
||
protected float getValue() { | ||
try { | ||
String text = getText(); | ||
if (text.startsWith(".")) setText("0" + text); | ||
return Float.parseFloat(getText()); | ||
} catch (Exception exception) { | ||
return 0f; | ||
} | ||
} | ||
|
||
protected void setValue(float value) { | ||
setText(String.valueOf(value)); | ||
} | ||
|
||
@Override | ||
public boolean charTyped(char chr, int modifiers) { | ||
if (chr != '.' && (chr < '0' || chr > '9')) return false; | ||
if (chr == '.' && getText().contains(".")) return false; | ||
return super.charTyped(chr, modifiers); | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
common/src/main/java/com/xtracr/realcamera/gui/IntFieldWidget.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.