Add docs
This commit is contained in:
parent
2a8efdb420
commit
91a6a4cff2
|
@ -33,9 +33,7 @@ build_test:
|
|||
- latest.jar
|
||||
- wrapper.jar
|
||||
- wrapper.exe
|
||||
- latest-linux.jar
|
||||
- latest-macos.jar
|
||||
- latest-windows.jar
|
||||
- latest-*.jar
|
||||
- version.json
|
||||
expire_in: 2 days
|
||||
only:
|
||||
|
@ -60,7 +58,7 @@ portable:
|
|||
- 7z x jvm.zip -oportable/
|
||||
- mv portable/jdk*/* portable/jvm/
|
||||
- rm -r portable/jdk*
|
||||
- cp resource/launch.bat portable/
|
||||
- cp packaging/windows/launch.bat portable/
|
||||
- cd portable
|
||||
- 7z a ../portable.7z * -mx9
|
||||
artifacts:
|
||||
|
@ -80,3 +78,15 @@ deploy:
|
|||
- gradle --build-cache build publish -Pflavor=windows -Ppublic -Prelease
|
||||
- gradle --build-cache build publish -Pflavor=linux -Ppublic -Prelease
|
||||
- gradle --build-cache build publish -Pflavor=macos -Ppublic -Prelease
|
||||
|
||||
pages:
|
||||
image: python:3.8-buster
|
||||
stage: deploy
|
||||
script:
|
||||
- pip install mkdocs
|
||||
- mkdocs build
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "packaging/arch-linux"]
|
||||
path = packaging/arch-linux
|
||||
url = ssh://aur@aur.archlinux.org/inceptum-git.git
|
26
README.md
26
README.md
|
@ -1,23 +1,7 @@
|
|||
# Inceptum Launcher ![Lines of code](https://img.shields.io/tokei/lines/gitlab/JFronny/Inceptum)
|
||||
A FOSS Launcher for Minecraft written in Java
|
||||
An advanced FOSS Launcher for Minecraft written in Java
|
||||
|
||||
Inceptum is a WIP minecraft launcher\
|
||||
Since it is very bare-bones currently, I would not recommend using it
|
||||
|
||||
# Downloads
|
||||
You can download builds for [Windows](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/wrapper.exe?job=build_test) and a [Cross-Platform Jar](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/wrapper.jar?job=build_test) \
|
||||
The windows build uses FabricInstallers code to automatically launch using the java install of the minecraft launcher if present.\
|
||||
|
||||
# Installation
|
||||
On most modern systems, simply launching the wrapper and waiting for it to download the latest Inceptum version will be enough.\
|
||||
It will be placed in your config directory (~/.config/Inceptum, %APPDATA%\Inceptum or ~/Library/Application Support/Inceptum).\
|
||||
On some older systems without OpenGL drivers, Inceptum won't run by default. For these, look at the next section
|
||||
|
||||
# Portable installation for Windows systems without OpenGL and/or java
|
||||
Download the portable build from [here](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/portable.7z?job=portable) \
|
||||
This archive includes Inceptum using the Inceptum wrapper, a JVM and a Mesa build for CPU-based graphics.\
|
||||
Please be aware that mesa WILL result in lower FPS.
|
||||
If all your systems support OpenGL and are simply missing java, remove the `run/natives/forceload` subdirectory!
|
||||
For documentation on how to use or install Inceptum, please head to the [wiki](https://jfmods.gitlab.io/Inceptum)
|
||||
|
||||
## Licenses
|
||||
Inceptum utilizes code/libraries/assets from:
|
||||
|
@ -28,10 +12,8 @@ Inceptum utilizes code/libraries/assets from:
|
|||
- [LWJGL](https://github.com/LWJGL/lwjgl3): Used as a backend for imgui-java
|
||||
- [gson](https://github.com/google/gson): Used for interacting with various APIs and configs
|
||||
- [slf4j](https://github.com/qos-ch/slf4j): Used for logging
|
||||
- [logback](https://github.com/qos-ch/logback): An implementation of lsf4j
|
||||
- [JLHTTP](https://github.com/curtcox/JLHTTP): Used for ATLaunchers Microsoft Authentication implementation
|
||||
- [JGit](https://www.eclipse.org/jgit/): Used in instance creation, hopefully also for sync soon
|
||||
- [fabric-meta](https://github.com/FabricMC/fabric-meta): Code for launching servers from PR#16
|
||||
- [logback](https://github.com/qos-ch/logback): An implementation of slf4j
|
||||
- [JGit](https://www.eclipse.org/jgit/): Used to allow syncing repositories
|
||||
- [Ubuntu](https://design.ubuntu.com/font/): Used with nerd font symbols as the font
|
||||
- [Nerd Fonts](https://www.nerdfonts.com/): Extra symbols for the font, currently unused
|
||||
- [meteor-client](https://github.com/MeteorDevelopment/meteor-client): A simple HTTP client
|
||||
|
|
BIN
bingchilling
BIN
bingchilling
Binary file not shown.
|
@ -0,0 +1,34 @@
|
|||
# CLI
|
||||
Inceptum provides a CLI which performs similar functions to the GUI. If you have feature requests, [open an issue](https://gitlab.com/jfmods/inceptum/-/issues)
|
||||
To view up-to-date information on the commands provided by Inceptum, run `inceptum help` or `inceptum help <command>`, this page is intended to explain more advanced features
|
||||
|
||||
## The inceptum wrapper
|
||||
Inceptum Wrapper looks through the libraries dir and launches the latest available Inceptum version.
|
||||
If it doesn't find a usable version, it will download the latest from GitLab.
|
||||
Launching is performed through a custom ClassLoader and the wrapper command is prepended to the arguments provided by the user.
|
||||
|
||||
## The "wrapper" command
|
||||
Inceptum internally uses this command to inform the main Inceptum jar that it was launched through the Inceptum Wrapper and should allow installing updates.
|
||||
It sets an internal flag and launches the command provided in its arguments.
|
||||
Manually invoking this command WILL cause problems, so a check has been implemented that should prevent this from starting Inceptum in unintended environments.
|
||||
|
||||
## The "batch" command
|
||||
This command will go through every line in the file provided in its arguments and executes the command written there.
|
||||
It is intended to be used in scripts that only want to run inceptum once, such as the systemd unit in the AUR package.
|
||||
For example,
|
||||
```
|
||||
git pull icesrv
|
||||
run server restart icesrv
|
||||
```
|
||||
is equivalent to the bash script
|
||||
```shell
|
||||
#!/bin/sh
|
||||
inceptum git pull icesrv
|
||||
inceptum run server restart icesrv
|
||||
```
|
||||
|
||||
## The "git" command
|
||||
The git command does NOT mirror the behavior of the actual git binary.
|
||||
It merely provides subcommands for running common actions such as cloning, pulling, committing and pushing on instances using the included JGit
|
||||
and performs additional sanitization.
|
||||
Using actual git commands is recommended when the commands provided are not enough for a particular purpose.
|
|
@ -0,0 +1,142 @@
|
|||
# File Formats
|
||||
Inceptum uses several json formats to store metadata and configs.
|
||||
All of these are subject to change, though automatic migrations will likely be provided.
|
||||
|
||||
## inceptum.json (Main Config)
|
||||
```json
|
||||
{
|
||||
// Whether to show snapshots in the version selector for new instances
|
||||
"snapshots": false,
|
||||
// Whether to launch the GUI in dark mode.
|
||||
// Configurable in Settings->Dark Theme
|
||||
"darkTheme": true,
|
||||
// Whether to require an account to launch the game.
|
||||
// Intended to allow running the game from USB sticks on constrained networks
|
||||
"enforceAccount": false,
|
||||
// The currently selected account.
|
||||
// Used to launch the game
|
||||
"lastAccount": "some UUID",
|
||||
// The update channel. Either "CI" or "Stable".
|
||||
// I personally recommend the CI channel as it gets the latest fixes and features quicker
|
||||
"channel": "CI",
|
||||
// Configuration for the git integration.
|
||||
// This is also used during instance creation, but you can pretty much ignore it if you use an external client or don't create modpacks
|
||||
"git": {
|
||||
// Authentication for git
|
||||
// Used when pushing or pulling from remote repos
|
||||
"instanceAuths": {
|
||||
// The name of an instance. This is equal to its directory name
|
||||
"someInstance": {
|
||||
// The username to use for authentication
|
||||
"username": "yourusername@gmail.com",
|
||||
// The password to use for authentication
|
||||
"password": "SomePassword"
|
||||
},
|
||||
"someOtherInstance": {
|
||||
"username": "yourusername@gmail.com",
|
||||
"password": "SomePassword"
|
||||
}
|
||||
},
|
||||
// The username to use when creating commits
|
||||
"commitUsername": "Inceptum",
|
||||
// The E-Mail address to use when creating commits. This default address doesn't exist btw
|
||||
"commitMail": "inceptum@jfronny.gitlab.io",
|
||||
// Whether to sign commits.
|
||||
// If you want this for additional security, don't use the git integration
|
||||
"signCommits": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## accounts.json
|
||||
Do not EVER use this file manually!
|
||||
NEVER upload it anywhere!
|
||||
It stores your minecraft account login and CAN BE USED TO IMPERSONATE YOU!
|
||||
|
||||
## instance.json (Instance Metadata)
|
||||
Please note that all entries except for "version" are optional
|
||||
```json
|
||||
{
|
||||
// The version to use for launching this
|
||||
// Can be a fabric loader version (as seen here) or a normal minecraft version (like "1.17.1")
|
||||
"version": "fabric-loader-0.12.12-1.17.1",
|
||||
// A custom java executable to use for launching this instance
|
||||
"java": "/path/to/java",
|
||||
// Sets the initial size of the Java heap
|
||||
// In bytes (this is 2MB)
|
||||
"minMem": 2097152,
|
||||
// Sets the maximum size to which the Java heap can grow
|
||||
// In bytes (this is 2GB)
|
||||
"maxMem": 2147483648,
|
||||
// Additional arguments to pass to minecraft
|
||||
"arguments": {
|
||||
// JVM arguments to add
|
||||
// Use this for things like aikars flags or java agents
|
||||
"jvm": [
|
||||
"-Dsome.argument=value"
|
||||
],
|
||||
// Arguments to add when launching as a client
|
||||
// Generally not needed, but can be used to do things like launching a server (I think)
|
||||
"client": [
|
||||
"someArgument"
|
||||
],
|
||||
// Arguments to add when launching as a server
|
||||
// Things like "nogui" go here
|
||||
"server": [
|
||||
"nogui"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## *.imod (Mod Metadata)
|
||||
```json
|
||||
{
|
||||
// Where the JAR file for this mod can be obtained
|
||||
"sources": [
|
||||
{
|
||||
// The type of the source
|
||||
// In this case, Modrinth
|
||||
"type": "modrinth",
|
||||
// The ID of the version on modrinth
|
||||
"id": "31ES0yWr"
|
||||
},
|
||||
{
|
||||
// The type of the source
|
||||
// In this case, CurseForge
|
||||
"type": "curseforge",
|
||||
// The ID of the project on CurseForge
|
||||
"projectId": 306612,
|
||||
// The ID of the file on CurseForge
|
||||
"fileId": 3609590
|
||||
},
|
||||
{
|
||||
// The type of the source
|
||||
// In this case, a direct download
|
||||
"type": "direct",
|
||||
// The name of the file this should be saved as
|
||||
"fileName": "fabric-api-0.46.1+1.17.jar",
|
||||
// The URL to download from
|
||||
"url": "https://cdn.modrinth.com/data/P7dR8mSH/versions/0.46.1+1.17/fabric-api-0.46.1+1.17.jar",
|
||||
// Dependencies for this file (optional)
|
||||
"dependencies": [
|
||||
// Dependencies in the same dependency format used int "sources"
|
||||
]
|
||||
}
|
||||
],
|
||||
// The sha1 hash of this file
|
||||
// Used to verify downloads and for modrinth
|
||||
"sha1": "a7d86f36c5b27bdb0008a84c3ce91e2b095a2834",
|
||||
// The murmur2 hash of this file
|
||||
// Used for curseforge
|
||||
"murmur2": "1020327834",
|
||||
// A list of dependent mods by their file names
|
||||
"dependents": [
|
||||
"someMod.imod"
|
||||
],
|
||||
// A list of dependencies by their file names
|
||||
"dependencies": [
|
||||
"someOtherMod.imod"
|
||||
]
|
||||
}
|
||||
```
|
|
@ -0,0 +1,48 @@
|
|||
# Installing
|
||||
Inceptum can be installed in a number of ways, all of which are documented below.
|
||||
|
||||
## Simple installation
|
||||
First, download the Inceptum build appropriate for your system:
|
||||
|
||||
- [Windows x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-windows.jar?job=build_test)
|
||||
- [MacOS x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-macos.jar?job=build_test) (untested)
|
||||
- [Linux x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-linux.jar?job=build_test)
|
||||
|
||||
The following additional builds are also available but not recommended for normal use:
|
||||
|
||||
- [Windows/Mac/Linux x86_64 in one](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-fat.jar?job=build_test)
|
||||
- [Headless](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-nogui.jar?job=build_test)
|
||||
|
||||
Once you have a jar, run it with an [up-to-date java version](https://adoptium.net/).
|
||||
Inceptum will use your config directory ($XDG_CONFIG_HOME, ~/.config/Inceptum, %APPDATA%\Inceptum or ~/Library/Application Support/Inceptum) for saving instances/caches/etc.
|
||||
If you want them somewhere else, read on
|
||||
|
||||
### Config files in current directory
|
||||
If the Inceptum jar detects a directory called "run" in the directory it is placed in,
|
||||
it will use that instead of the users config directory.
|
||||
|
||||
Create a directory (= Folder) next to the inceptum jar.
|
||||
|
||||
### Config files in a custom location
|
||||
You may specify the java VM parameter `-Dinceptum.base=$DIRECTORY` to use a custom directory for Inceptum.
|
||||
If this parameter is specified, all other locations will be ignored.
|
||||
|
||||
## Simple installation with updates
|
||||
To use automatic updates, you must use the Inceptum Wrapper.
|
||||
Simply launch this [cross-platform jar](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/wrapper.jar?job=build_test)
|
||||
and Inceptum will launch as described above (though the initial startup may take a bit longer). The same rules for config locations apply.
|
||||
|
||||
You may also download the [windows exe](https://gitlab.com/jfmods/inceptum/-/jobs/artifacts/master/raw/wrapper.exe?job=build_test)
|
||||
which uses fabric-installer-native-bootstrap to locate the JVM used by the official minecraft launcher and launch Inceptum using that.
|
||||
Please be aware that this is pretty much untested
|
||||
|
||||
## Installation from the AUR
|
||||
Inceptum is available in the AUR as [`inceptum-git`](https://aur.archlinux.org/packages/inceptum-git)
|
||||
If you use arch linux or a derivative, you may use this package instead of a manual installation.
|
||||
It also includes a template systemd service which you can copy and customize to launch your minecraft server.
|
||||
For more information on the syntax of this services config file, go [here](Commands.md)
|
||||
|
||||
## Using Inceptum on Windows without OpenGL drivers
|
||||
Download the portable build from [here](https://gitlab.com/jfmods/inceptum/-/jobs/artifacts/master/raw/portable.7z?job=portable)
|
||||
This archive includes Inceptum using the Inceptum wrapper, a JVM and a Mesa build for CPU-based graphics.
|
||||
Please be aware that using this WILL result in worse performance.
|
|
@ -0,0 +1,17 @@
|
|||
# About
|
||||
Inceptum is advanced FOSS Launcher for Minecraft written in Java
|
||||
|
||||
Features:
|
||||
|
||||
- Syncing instances between multiple clients and servers through git
|
||||
- Easy fabric mod management (installing, removing, updating) from CurseForge and Modrinth through a GUI
|
||||
- ".imod" format to keep mod jars out of git
|
||||
- Exports to common formats
|
||||
- Cross-Platform
|
||||
- Automatic updates through Inceptum Wrapper
|
||||
- Support for running without OpenGL drivers
|
||||
- Proxy support
|
||||
- Integrated headless server launcher for inceptum packs
|
||||
- LWJGL-based GUI (not a web browser!)
|
||||
- Uses Mojangs JVMs to launch instances
|
||||
- Needs nothing but a JVM, OpenGL or mesa and an internet connection during setup
|
|
@ -0,0 +1,49 @@
|
|||
# Syncing instances
|
||||
Inceptum supports syncing repositories between instances through git.
|
||||
This is roughly comparable to updatable modpacks in other launchers.
|
||||
There are two workflows for this, you can choose one based on your use case.
|
||||
|
||||
## Uploading a local pack to a game server
|
||||
This approach assumes that your intention is to have a game server running Inceptum
|
||||
and to regularly push updates built and tested in an Inceptum instance on your PC.
|
||||
To set this up, initialize a repo on your server and clone it locally
|
||||
|
||||
Server:
|
||||
```shell
|
||||
cd /srv/inceptum/instances
|
||||
mkdir icesrv
|
||||
cd icesrv
|
||||
git init
|
||||
git config receive.denyCurrentBranch ignore
|
||||
```
|
||||
Client:
|
||||
```shell
|
||||
git clone inceptum@example.com:/srv/inceptum/instances/icesrv
|
||||
cd icesrv
|
||||
git branch --set-upstream-to origin/master
|
||||
# copy your instance content to your new instance
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
git push
|
||||
```
|
||||
After that, you can use a script similar to the following to push changes:
|
||||
```shell
|
||||
git push -u origin master
|
||||
rconc icesrv stop
|
||||
sleep 1
|
||||
ssh -t inceptum@example.com "cd /srv/inceptum/instances/icesrv; git reset --hard"
|
||||
ssh -t admin@example.com "sudo systemctl restart inceptum-icesrv"
|
||||
```
|
||||
icesrv is the name of the instance in this example and inceptum-icesrv is a systemd service based on the one included
|
||||
in the AUR package.
|
||||
|
||||
## Providing a pack to multiple users
|
||||
To do this, create a new repository on a git hosting site (like GitHub or GitLab) and push your local instance there.
|
||||
Since a git repository is created for every instance, simply following the instructions for pushing an existing
|
||||
repository or using any graphical tool is enough to set this up.
|
||||
|
||||
Users can add an instance created this way in the GUI under File->New Instance->Inceptum.
|
||||
|
||||
To update the pack, simply create a new commit and push it to your repository.
|
||||
Users can then update the pack under Edit->Git->Pull or using the Inceptum CLI.
|
||||
You may also export the pack to other formats to upload it on sites like CurseForge
|
|
@ -0,0 +1,16 @@
|
|||
site_name: Inceptum Docs
|
||||
site_url: https://jfmods.gitlab.io/Inceptum
|
||||
theme:
|
||||
name: readthedocs
|
||||
hljs_languages:
|
||||
- json5
|
||||
site_dir: public
|
||||
repo_url: https://gitlab.com/jfmods/Inceptum
|
||||
site_description: Documentation for the Inceptum Launcher
|
||||
site_author: JFronny
|
||||
nav:
|
||||
- 'README.md'
|
||||
- 'Installing.md'
|
||||
- 'Commands.md'
|
||||
- 'Syncing.md'
|
||||
- 'FileFormats.md'
|
|
@ -0,0 +1 @@
|
|||
Subproject commit b9c62f0945e29c14112a1bcd562e005bb0d80ecf
|
File diff suppressed because it is too large
Load Diff
|
@ -27,11 +27,6 @@ public class Inceptum {
|
|||
if (Wrapper.class.getClassLoader() != Inceptum.class.getClassLoader()) {
|
||||
throw new IllegalStateException("Mismatching classloader between two classes. Something is wrong here");
|
||||
}
|
||||
if (args.length > 0 && args[0].equals("wrapper")) {
|
||||
if (WrapperStrap.class.getClassLoader() == Inceptum.class.getClassLoader()) {
|
||||
throw new IllegalStateException("The WrapperStrap classloader does not match the inceptum loader. Are you using the latest wrapper?");
|
||||
}
|
||||
}
|
||||
|
||||
GsonHolder.registerTypeAdapter(MinecraftArgument.class, new MinecraftArgumentDeserializer());
|
||||
GsonHolder.registerTypeAdapter(Rules.class, new RulesDeserializer());
|
||||
|
|
|
@ -32,7 +32,6 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
|
||||
public class InceptumGui {
|
||||
public static final int INPUT_FIELD_LENGTH = 1024; // Arbitrary value, can be any int 0<=x<MAX_VALUE. Be aware that an array of this length will be allocated for every input box
|
||||
public static final Set<Window> WINDOWS = new LinkedHashSet<>();
|
||||
private static final ImGuiImplGlfw imGuiGlfw = new ImGuiImplGlfw();
|
||||
private static final ImGuiImplGl3 imGuiGl3 = new ImGuiImplGl3();
|
||||
|
@ -147,8 +146,6 @@ public class InceptumGui {
|
|||
ImGuiIO io = ImGui.getIO();
|
||||
io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable);
|
||||
io.setConfigViewportsNoAutoMerge(true);
|
||||
//TODO use included icons (https://www.nerdfonts.com/cheat-sheet)
|
||||
//Nerd Fonts-patched ubuntu font
|
||||
try (InputStream is = Inceptum.class.getClassLoader().getResourceAsStream("font.ttf")) {
|
||||
assert is != null;
|
||||
io.setFontDefault(io.getFonts().addFontFromMemoryTTF(is.readAllBytes(), 16f));
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package io.gitlab.jfronny.inceptum.frontend.cli.commands;
|
||||
|
||||
import io.gitlab.jfronny.inceptum.Inceptum;
|
||||
import io.gitlab.jfronny.inceptum.WrapperStrap;
|
||||
import io.gitlab.jfronny.inceptum.frontend.cli.*;
|
||||
|
||||
public class WrapperCommand extends Command {
|
||||
|
@ -14,6 +16,9 @@ public class WrapperCommand extends Command {
|
|||
|
||||
@Override
|
||||
public CommandResolution resolve(CommandArgs args) {
|
||||
if (WrapperStrap.class.getClassLoader() == Inceptum.class.getClassLoader()) {
|
||||
throw new IllegalStateException("The WrapperStrap classloader does not match the inceptum loader. Are you using the latest wrapper?");
|
||||
}
|
||||
return Commands.COMMANDS_ROOT.resolve(args);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import imgui.ImGui;
|
|||
import imgui.flag.ImGuiTableFlags;
|
||||
import imgui.type.ImString;
|
||||
import io.gitlab.jfronny.inceptum.Inceptum;
|
||||
import io.gitlab.jfronny.inceptum.InceptumGui;
|
||||
import io.gitlab.jfronny.inceptum.model.curseforge.CurseforgeMod;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.InstanceMeta;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.ModDescription;
|
||||
|
@ -27,7 +26,7 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
|
||||
public class AddModWindow extends Window {
|
||||
private final ImString query = new ImString("", InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString query = new ImString("", GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final Path modsDir;
|
||||
private final InstanceMeta instance;
|
||||
private final ModsDirScanner mds;
|
||||
|
|
|
@ -15,6 +15,8 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
|
||||
public class GuiUtil {
|
||||
public static final int INPUT_FIELD_LENGTH = 1024; // Arbitrary value, can be any int 0<=x<MAX_VALUE. Be aware that an array of this length will be allocated for every input box
|
||||
|
||||
public static void reload() {
|
||||
try {
|
||||
List<Path> paths = Utils.ls(MetaHolder.INSTANCE_DIR);
|
||||
|
|
|
@ -10,12 +10,11 @@ import io.gitlab.jfronny.inceptum.frontend.gui.control.InstanceManageControls;
|
|||
import io.gitlab.jfronny.inceptum.frontend.gui.dialog.ProcessStateWatcherWindow;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.Config;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.InstanceMeta;
|
||||
import io.gitlab.jfronny.inceptum.util.source.ModSource;
|
||||
import io.gitlab.jfronny.inceptum.util.*;
|
||||
import io.gitlab.jfronny.inceptum.util.source.ModSource;
|
||||
import org.eclipse.jgit.api.Git;
|
||||
import org.eclipse.jgit.api.Status;
|
||||
import org.eclipse.jgit.api.errors.GitAPIException;
|
||||
import org.eclipse.jgit.lib.IndexDiff;
|
||||
import org.eclipse.jgit.transport.CredentialsProvider;
|
||||
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
|
||||
import org.lwjgl.PointerBuffer;
|
||||
|
@ -36,9 +35,9 @@ public class InstanceEditWindow extends Window {
|
|||
private final InstanceManageControls imc;
|
||||
private final ImBoolean customJava;
|
||||
private final ImBoolean filterUpdates = new ImBoolean();
|
||||
private final ImString customJavaPath = new ImString(InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString gitUsername = new ImString(InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString gitPassword = new ImString(InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString customJavaPath = new ImString(GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final ImString gitUsername = new ImString(GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final ImString gitPassword = new ImString(GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final ModsDirScanner mds;
|
||||
private Path selected = null;
|
||||
private boolean reDownload = false;
|
||||
|
@ -126,7 +125,7 @@ public class InstanceEditWindow extends Window {
|
|||
save();
|
||||
}
|
||||
if (customJava.get() && ImGui.inputText("Path", customJavaPath)) {
|
||||
instance.java = customJavaPath.get();;
|
||||
instance.java = customJavaPath.get();
|
||||
save();
|
||||
}
|
||||
ImGui.endTabItem();
|
||||
|
@ -348,6 +347,8 @@ public class InstanceEditWindow extends Window {
|
|||
ConfigHolder.saveConfig();
|
||||
credentialsProvider = new UsernamePasswordCredentialsProvider(config.username, config.password);
|
||||
}
|
||||
ImGui.text("Please note that Inceptum's git integration intentionally does not cover advanced usage");
|
||||
ImGui.text("Using software intended to work with git (such as the git CLI or GitHub Desktop) is recommended");
|
||||
ImGui.endTabItem();
|
||||
}
|
||||
if (ImGui.beginTabItem("Export")) {
|
||||
|
|
|
@ -3,7 +3,6 @@ package io.gitlab.jfronny.inceptum.frontend.gui;
|
|||
import imgui.ImGui;
|
||||
import imgui.type.ImString;
|
||||
import io.gitlab.jfronny.inceptum.Inceptum;
|
||||
import io.gitlab.jfronny.inceptum.InceptumGui;
|
||||
import io.gitlab.jfronny.inceptum.frontend.cli.commands.GitCommand;
|
||||
import io.gitlab.jfronny.inceptum.frontend.gui.control.InstanceManageControls;
|
||||
import io.gitlab.jfronny.inceptum.util.Utils;
|
||||
|
@ -16,8 +15,8 @@ import java.net.URISyntaxException;
|
|||
|
||||
public class NewInstanceWindow extends Window {
|
||||
private final InstanceManageControls imc = new InstanceManageControls(null);
|
||||
private final ImString inceptumRepo = new ImString(InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString inceptumName = new ImString(InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString inceptumRepo = new ImString(GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final ImString inceptumName = new ImString(GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private String inceptumNamePrev = "";
|
||||
public NewInstanceWindow() {
|
||||
super("New Instance");
|
||||
|
|
|
@ -4,7 +4,7 @@ import imgui.ImGui;
|
|||
import imgui.type.ImBoolean;
|
||||
import imgui.type.ImInt;
|
||||
import imgui.type.ImString;
|
||||
import io.gitlab.jfronny.inceptum.InceptumGui;
|
||||
import io.gitlab.jfronny.inceptum.frontend.gui.GuiUtil;
|
||||
import io.gitlab.jfronny.inceptum.model.fabric.FabricVersionLoaderInfo;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.InstanceMeta;
|
||||
import io.gitlab.jfronny.inceptum.model.inceptum.LoaderInfo;
|
||||
|
@ -29,7 +29,7 @@ public class InstanceManageControls {
|
|||
private final VersionsList manifest = McApi.getVersions();
|
||||
private final Map<VersionsListInfo, List<FabricVersionLoaderInfo>> loaderInfoCache = new HashMap<>();
|
||||
private final ImInt version = new ImInt(0);
|
||||
private final ImString name = new ImString("", InceptumGui.INPUT_FIELD_LENGTH);
|
||||
private final ImString name = new ImString("", GuiUtil.INPUT_FIELD_LENGTH);
|
||||
private final ImInt fabricVersion = new ImInt(0);
|
||||
private final ImBoolean snapshots = new ImBoolean(ConfigHolder.CONFIG.snapshots);
|
||||
private final ImBoolean fabric = new ImBoolean(true);
|
||||
|
|
|
@ -2,7 +2,7 @@ package io.gitlab.jfronny.inceptum.frontend.gui.dialog;
|
|||
|
||||
import imgui.ImGui;
|
||||
import imgui.type.ImString;
|
||||
import io.gitlab.jfronny.inceptum.InceptumGui;
|
||||
import io.gitlab.jfronny.inceptum.frontend.gui.GuiUtil;
|
||||
import io.gitlab.jfronny.inceptum.frontend.gui.Window;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
@ -19,7 +19,7 @@ public class TextBoxWindow extends Window {
|
|||
this.message = message;
|
||||
this.onOk = onOk;
|
||||
this.onCancel = onCancel;
|
||||
selected = new ImString(defaultValue, InceptumGui.INPUT_FIELD_LENGTH);
|
||||
selected = new ImString(defaultValue, GuiUtil.INPUT_FIELD_LENGTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Binary file not shown.
|
@ -5,7 +5,6 @@ import java.io.IOException;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class WrapperStrap {
|
||||
public static final ClassLoader SYSTEM_LOADER = ClassLoader.getSystemClassLoader();
|
||||
|
|
Loading…
Reference in New Issue