Move everything to com.replaymod package Add KeyBindingRegistry and SettingsRegistry Recreate settings GUI with new GUI API and dynamically from SettingsRegistry Use ReplayFile from ReplayStudio ReplayHandler is now object oriented Add GuiOverlay, GuiSlider and GuiTexturedButton to GUI API Rewrite both overlays to use new GUI API Fix size capping in vertical and horizontal layout Allow CustomLayouts to have parents Fix tooltip rendering when close to screen border Allow changing of columns in GridLayout
28 lines
1.2 KiB
Java
28 lines
1.2 KiB
Java
package eu.crushedpixel.replaymod.online.urischeme;
|
|
|
|
import com.replaymod.core.ReplayMod;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.output.StringBuilderWriter;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class WindowsUriScheme extends UriScheme {
|
|
@Override
|
|
public void install() throws IOException, InterruptedException {
|
|
String path = ReplayMod.getContainer().getSource().getAbsolutePath().replace("\\", "\\\\").replace("\"", "\\\"");
|
|
regAdd("\\replaymod /f /ve /d \"URL:replaymod Protocol\"");
|
|
regAdd("\\replaymod /f /v \"URL Protocol\" /d \"\"");
|
|
regAdd("\\replaymod\\shell\\open\\command /f /ve /d \"java -cp \\\"" + path + "\\\" " + UriScheme.class.getName() + " \\\"%1\\\"\"");
|
|
}
|
|
|
|
private void regAdd(String args) throws IOException, InterruptedException {
|
|
Process process = Runtime.getRuntime().exec("REG ADD HKCU\\Software\\Classes" + args);
|
|
if (process.waitFor() != 0) {
|
|
StringBuilderWriter writer = new StringBuilderWriter();
|
|
IOUtils.copy(process.getInputStream(), writer);
|
|
IOUtils.copy(process.getErrorStream(), writer);
|
|
throw new IOException(writer.toString());
|
|
}
|
|
}
|
|
}
|