Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Add Translations
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossScarDev committed Apr 26, 2023
1 parent bf07108 commit 5f7616b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.14.17

# Mod Properties
mod_version = 2.0+1.19.4
mod_version = 2.1+1.19.4
maven_group = net.crossscar
archives_base_name = cshacks

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/crossscar/cshacks/gui/CsOpenButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

public class CsOpenButton extends ButtonWidget {
public CsOpenButton(int x, int y, int width, int height, Screen screen) {
super(x, y, width, height, Text.of("csHacks"), button -> MinecraftClient.getInstance().setScreen(new CsScreen(screen)), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
super(x, y, width, height, Text.translatable("net.crossscar.cshacks"), button -> MinecraftClient.getInstance().setScreen(new CsScreen(screen)), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
}
}
12 changes: 6 additions & 6 deletions src/main/java/net/crossscar/cshacks/gui/CsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CsScreen extends SpruceScreen {
private SpruceButtonWidget flyButton;

public CsScreen(Screen previousScreen) {
super(Text.of("csHacks"));
super(Text.translatable("net.crossscar.cshacks"));
this.previousScreen = previousScreen;
}

Expand All @@ -26,25 +26,25 @@ protected void init() {
int startx = 10;

if (this.fly) {
this.flyButton = new SpruceButtonWidget(Position.of(startx, 10), 70, 20, Text.of("Fly [ON]"),
this.flyButton = new SpruceButtonWidget(Position.of(startx, 10), 70, 20, Text.translatable("net.crossscar.cshacks.gui.flybtn.on"),
btn -> this.toggleFly());
} else {
this.flyButton = new SpruceButtonWidget(Position.of(startx, 10), 70, 20, Text.of("Fly [OFF]"),
this.flyButton = new SpruceButtonWidget(Position.of(startx, 10), 70, 20, Text.translatable("net.crossscar.cshacks.gui.flybtn.off"),
btn -> this.toggleFly());
}
this.addDrawableChild(flyButton);

this.addDrawableChild(new SpruceButtonWidget(Position.of(this.width - 55, 10), 45, 20, Text.of("Back"),
this.addDrawableChild(new SpruceButtonWidget(Position.of(this.width - 55, 10), 45, 20, Text.translatable("net.crossscar.cshacks.gui.backbtn"),
btn -> this.client.setScreen(this.previousScreen)));
}

public void toggleFly() {
this.fly = !this.fly;
if (fly) {
this.flyButton.setMessage(Text.of("Flying [ON]"));
this.flyButton.setMessage(Text.translatable("net.crossscar.cshacks.gui.flybtn.on"));
}
if (!fly) {
this.flyButton.setMessage(Text.of("Flying [OFF]"));
this.flyButton.setMessage(Text.translatable("net.crossscar.cshacks.gui.flybtn.off"));
}
}
}
Binary file removed src/main/resources/assets/cshacks/icon.png
Binary file not shown.
6 changes: 6 additions & 0 deletions src/main/resources/assets/cshacks/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"net.crossscar.cshacks": "csHacks",
"net.crossscar.cshacks.gui.backbtn": "Back",
"net.crossscar.cshacks.gui.flybtn.on": "Flying [ON]",
"net.crossscar.cshacks.gui.flybtn.off": "Flying [OFF]"
}
Binary file added src/main/resources/assets/cshacks/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "cshacks",
"version": "2.0+1.19.4",
"version": "2.1+1.19.4",
"environment": "client",
"name": "csHacks",
"description": "A simple Minecraft hack client.",
Expand All @@ -10,11 +10,12 @@
],
"contact": {
"homepage": "https://github.com/CommanderGL/csHacks/releases",
"sources": "https://github.com/CommanderGL/csHacks"
"sources": "https://github.com/CommanderGL/csHacks",
"issues": "https://gitub.com/CommanderGL/csHacks"
},

"license": "Mozilla Public License 2.0",
"icon": "assets/cshacks/icon.png",
"icon": "assets/cshacks/logo.png",
"entrypoints": {
"client": [
"net.crossscar.cshacks.Main"
Expand Down

0 comments on commit 5f7616b

Please sign in to comment.