-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from RedstoneTools/dev
Update 1.1.3
- Loading branch information
Showing
23 changed files
with
137 additions
and
234 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
55 changes: 0 additions & 55 deletions
55
src/main/java/tools/redstone/redstonetools/gui/PopupScreen.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/tools/redstone/redstonetools/gui/UpdatePopupScreen.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/main/java/tools/redstone/redstonetools/mixin/TelemetryPromptPopupMixin.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...etools/mixin/MinecraftClientAccessor.java → ...in/accessors/MinecraftClientAccessor.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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/tools/redstone/redstonetools/mixin/macros/InitializeMacroManagerMixin.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,18 @@ | ||
package tools.redstone.redstonetools.mixin.macros; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.RunArgs; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import tools.redstone.redstonetools.RedstoneToolsClient; | ||
import tools.redstone.redstonetools.macros.MacroManager; | ||
|
||
@Mixin(MinecraftClient.class) | ||
public class InitializeMacroManagerMixin { | ||
@Inject(method = "<init>", at = @At("TAIL")) | ||
public void registerMacros(RunArgs args, CallbackInfo ci){ | ||
RedstoneToolsClient.INJECTOR.getInstance(MacroManager.class);// should register macro keybinds | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...stonetools/mixin/KeyBindingMixinImpl.java → ...ols/mixin/macros/KeyBindingMixinImpl.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
2 changes: 1 addition & 1 deletion
2
...ls/mixin/ClientPlayerEntityMixinImpl.java → ...complete/ClientPlayerEntityMixinImpl.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
2 changes: 1 addition & 1 deletion
2
...netools/mixin/CommandDispatcherMixin.java → .../autocomplete/CommandDispatcherMixin.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
2 changes: 1 addition & 1 deletion
2
...onetools/mixin/CommandSuggestorMixin.java → ...s/autocomplete/CommandSuggestorMixin.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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/tools/redstone/redstonetools/mixin/telemetry/ShowTelemetryPopupMixin.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,44 @@ | ||
package tools.redstone.redstonetools.mixin.telemetry; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.ConfirmScreen; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.client.gui.screen.TitleScreen; | ||
import net.minecraft.text.Text; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import tools.redstone.redstonetools.telemetry.TelemetryManager; | ||
|
||
import static tools.redstone.redstonetools.RedstoneToolsClient.INJECTOR; | ||
|
||
@Mixin(TitleScreen.class) | ||
public class ShowTelemetryPopupMixin extends Screen { | ||
private static final String TELEMETRY_PROMPT = "Redstone Tools includes an optional telemetry feature that collects anonymous usage data to help us improve the mod. By enabling telemetry, you can help us better understand how the mod is being used and identify areas for improvement.\n\n\n\nWould you like to help us improve Redstone Tools by enabling anonymous usage data?"; // TODO: Add "You can turn this off at any time in the settings menu." once you can actually turn it off in the settings menu | ||
|
||
public ShowTelemetryPopupMixin(Text title) { | ||
super(title); | ||
} | ||
|
||
@Inject(method = "init", at = @At("TAIL")) | ||
public void init(CallbackInfo ci) { | ||
var manager = INJECTOR.getInstance(TelemetryManager.class); | ||
|
||
if (!manager.showTelemetryPrompt) { | ||
return; | ||
} | ||
|
||
var parentScreen = MinecraftClient.getInstance().currentScreen; | ||
var popup = new ConfirmScreen(accepted -> { | ||
manager.showTelemetryPrompt = false; | ||
manager.telemetryEnabled = accepted; | ||
|
||
manager.saveChanges(); | ||
|
||
MinecraftClient.getInstance().setScreen(parentScreen); | ||
}, Text.of("Telemetry"), Text.of(TELEMETRY_PROMPT)); | ||
|
||
MinecraftClient.getInstance().setScreen(popup); | ||
} | ||
} |
Oops, something went wrong.