CombatGUI-lib - A playground to try to work out how to make in-combat GUIs work

Related tags

SDK CombatGUI-lib
Overview

Starsector Mod Template using Gradle and IntelliJ

v1.2.0

Description

This is a template for a generic Starsector mod using Java.

Simply download it as a .zip, clone it using git clone https://github.com/davidwhitman/starsector-mod-template.git, or click "Use this template" and then follow the instructions below.

When you are done, you will have a mod that does nothing, but is ready for anything to be added.

Written for IntelliJ Community (free download), but should work with any IDE. Latest version of IntelliJ is 2021.2 as of writing.

Features

  • A one-click command to build your mod and launch Starsector with full breakpoint debugging.
  • Automatically generated mod_info.json and Version Checker files.
    • Set your mod's version once in build.gradle.kts and both files will be updated.
  • A new GitHub Release will be created automatically whenever a git tag is pushed, if the mod is hosted on GitHub.
    • Delete the .github folder to disable this.
  • Gradle build system, works with any IDE (but you don't need to know what Gradle is).

Initial Setup Checklist

Step 1

Choose whether you wish to manually update the mod_info.json and Version Checker files (manual updating is the default option) or have it done automatically (requires slightly more setup).

First do these, then choose Option A or Option B

  • In build.gradle.kts SECTION A, set the modName variable.
  • In build.gradle.kts SECTION A, check starsectorDirectory for correctness. It will need to be updated if you've installed the game to a non-default location or aren't on Windows.

Option A (recommended): I will manually update my mod_info.json and Version Checker files

  • Go and update the mod_info.json and Version Checker (if you are supporting Version Checker) files by hand

Option B: Automatically update my mod_info.json and Version Checker files from a single config file

  • In build.gradle.kts SECTION B, set shouldAutomaticallyCreateMetadataFiles to true, then set the rest of the variables in SECTION B. Whenever you would normally manually update mod_info.json or Version Checker, update these values in SECTION B instead and, upon mod recompile, they will be updated.

Step 2

Option 1: If starting a brand-new project

  • Change the package from the template default. In IntelliJ, open up ExampleEveryFrameScript, right-click on the first line in the file (package com.example;) and go to Refactor - Rename. From there, you may rename com.example to anything lowercase you like (e.g. "wisp.perseanchronicles"). If it pops up a refactoring preview, keep everything selected and click Do Refactor.
    • You will put any new code you write into the src/com/example directory (or src/wisp/perseanchronicles or whatever you named it in the previous step).
  • Any other assets, such as graphics or data, can go directly into the top-level folder (next to, but not inside, src).

Option 2: If importing existing code

  • Copy the code you want to use into the src directory.
    • For example, if your code was in a folder structure like data/scripts (the .java files would start with a line like package data.scripts;), then the new folder structure would be src/data/scripts.
    • If in doubt, look at the package name at the top of a .java file, then look for that folder. For example, Nexerelin has a file that starts with package exerelin;, so we look inside Nexerelin's jars/src.zip and find sources/ExerelinCore/exerelin. We copy only the exerelin folder into our template's src folder so that the .java file's location relative to src perfectly matches the package.
    • The main folder in src can be ignored. It would be used for new projects, but is not needed for importing.
  • Any other assets, such as graphics or data, can go directly into the top-level folder (next to, but not inside, src).

Optional

  • In settings.gradle, change rootProject.name = 'template' to be your new name instead.
    • This changes how IntelliJ itself refers to the project, but shouldn't affect anything else.
  • Change LICENSE to something else. GPL-3 is a popular one.

IntelliJ Configuration

Ensure that your run configuration is correct:

  • In IntelliJ, click Run - Edit Configurations.

  • Select "Run Starsector"

  • Set Working directory to the location of your starsector-core folder, if different than what's currently there.

  • Check other values to make sure they fit your Starsector install. By default, they are set for a typical Windows install.

  • Click Ok. You should now be able to choose Run Starsector from the Run menu and then click the Debug button (the icon of a bug) icon

  • Don't forget to enable your mod on the Starsector launcher!

  • If you are running on linux, the VM Arguments should instead be

    -server -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Djava.library.path=./native/linux -Xms1536m -Xmx1536m -Xss2048k -classpath janino.jar:commons-compiler.jar:commons-compiler-jdk.jar:starfarer.api.jar:starfarer_obf.jar:jogg-0.0.7.jar:jorbis-0.0.15.jar:json.jar:lwjgl.jar:jinput.jar:log4j-1.2.9.jar:lwjgl_util.jar:fs.sound_obf.jar:fs.common_obf.jar:xstream-1.4.10.jar -Dcom.fs.starfarer.settings.paths.saves=./saves -Dcom.fs.starfarer.settings.paths.screenshots=./screenshots -Dcom.fs.starfarer.settings.paths.mods=./mods -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.linux=true com.fs.starfarer.StarfarerLauncher

Example for this template

Final Run Configuration

Adding new libraries as dependencies

By default, only LazyLib is added. To add other mod dependencies, open build.gradle.kts and navigate down to the dependencies section (SECTION D.2).

The easiest thing to do is to copy the existing LazyLib dependency, which starts with compileOnly, and modify it to point to the folder containing the .jar file(s) of the mod you're adding.

After making any change to the build.gradle.kts file, click the "Load Gradle changes" button that should have appeared in the top-right corner.

gradle sync

Releasing (automatic)

Tag a commit and push it. The tag name will become a release name, and the commit message will become a release message.

git commit -m "My first release" # you can just `git commit` and type a body of release as well
git push origin master           # Send the commit to your repo (no release yet)
git tag 1.0.0                    # No release yet, it's only local now
git push --tags origin master    # Release is happening now

In-Depth Description & Purpose

This is a template for a generic Starsector mod that uses Gradle as its build system, Kotlin as the Gradle DSL, and Java and/or Kotlin as the programming language.

Knowledge of Kotlin is not required.

One of the main goals is to move as much of the build process out of IntelliJ as possible, so that anybody can pull down the source code and build the project with minimal hassle. IntelliJ is not even required to build the mod, which can be done using the Gradle wrapper on the command line (for advanced users only, not described here).

Another goal is to have more project configuration as code, rather than IDE-specific files. That way, they'll get versioned (and be shared, as mentioned).

Other

Author: Wisp

Contributors

  • Jaghaimo for tons of suggestions, inspiration, and corrections.
  • ruddygreat for battling her way through using an earlier version and providing lots of clear, much-needed feedback.

License: GPL v3

You might also like...
The lib can make the ActivityOptions animations use in Android api3.1+
The lib can make the ActivityOptions animations use in Android api3.1+

ActivityOptionsICS 本项目停止维护 =========== f you are thinking on customizing the animation of Activity transition then probably you would look for Activit

Make Android DrawerLayout can be dragged out in real-time within the range of fullscreen
Make Android DrawerLayout can be dragged out in real-time within the range of fullscreen

FullDraggableDrawer Make the DrawerLayout can be dragged/pulled out in real-time within the range of fullscreen, like Pure Writer: * Full demo video:

Sanctuary relies on the Android Work Profile APIs to create a self-contained work profile on a user's personal device.
Sanctuary relies on the Android Work Profile APIs to create a self-contained work profile on a user's personal device.

Sanctuary relies on the Android Work Profile APIs to create a self-contained work profile on a user's personal device. Managed apps, data, and management policies are restricted to the work profile, keeping them secure and separate from personal data while maintaining user privacy.

when you use restful api and network get disconnect you have to store your data local for make your app faster and work on ofline mode

AppArchitectureOflineMode when you use restful api and network get disconnect you have to store your data local for make your app faster and work on o

A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.
The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

Il Bil App Introduction I will introduce you to how to implement Account Kit, Map Kit, Game Service. About the game: The app has got fullscreen Turkey

Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android.
Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android.

Klimatic Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android. Built using Android Architectu

Sample app to try compose and showcase principles from Composing (UI) beyond the UI
Sample app to try compose and showcase principles from Composing (UI) beyond the UI

Composing clocks sample app This is a sample app to show how to build an app that follows the practices described in the series of articles Compose (U

If you have trouble pinning your custom icon to Launcher dynamically, try this library

CustomIconHelperX If you have trouble pinning your custom icon to Launcher dynam

Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Candroid app store, try visiting the Candroid Market.
Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Candroid app store, try visiting the Candroid Market.

Candroid App Store Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Ca

Clean Code and Reactive Programming PlayGround for Bangkit 2021

Clean Code and Reactive Programming PlayGround for Bangkit 2021 Hello! This repo contains the IntelliJ project that I use to present my talk, "Clean A

Android playground project with modularization by feature (android libraries), unit tests, MVVM & MVI.
Android playground project with modularization by feature (android libraries), unit tests, MVVM & MVI.

Movies Movies is a simple project to study and play with some android components, architecture and tools for Android development. Tech Stack This proj

Playground for learning Kotlin Multiplatform Mobile
Playground for learning Kotlin Multiplatform Mobile

This is a playground for learning KMP (KMM Plugin for android studio). Requirements Android Studio Canary 8 Architecture Thanks https://twitter.com/jo

Playground project for Koin Koin Compiler - Sandbox

Koin Compiler - Sandbox The goal of Koin compiler & Annotations project is to help declare Koin definition in a very fast and intuitive way, and gener

Simulate the running route of each player on the playground, and can be timed with a stopwatch
Simulate the running route of each player on the playground, and can be timed with a stopwatch

PathView (Simulate the running route of each player on the playground, and can be timed with a stopwatch) Generally speaking, high frequency and dense

This repository is a playground of jetpack compose for android developers
This repository is a playground of jetpack compose for android developers

Pritesh Jetpack Compose This repository is a playground of jetpack compose for Android Developers, I tried to get my hands dirty with challenging UI t

A Playground repository to showcase UI's and transitions built using Motion Layout.
A Playground repository to showcase UI's and transitions built using Motion Layout.

A collection of UI's built to showcase the capabilities of Motion Layout and Constraint Layout 2.0/2.1

Playground Android project to test jacoco-report github action

jacoco-android-playground Playground Android project to test jacoco-report github action Running Code Coverage at Module level The app module has mult

Playground Jetpack Compose Samples
Playground Jetpack Compose Samples

Playground Jetpack Compose Samples For more information, please read the documentation 💻 Requirements To try out these sample apps, you need to use A

Owner
null
Playground project built with MVVM with Clean Artchitect to try out new tech in Android 🌍

Clean-MVVM-Playground Playground project built with MVVM with Clean Artchitect to try out new tech in Android ?? Features ?? 100% Kotlin Following MVV

Somesh Kumar 8 Dec 9, 2022
Compose app with dummy data which serves as a playground to try out new things in the Android world.

Music Event Manager Compose app with dummy data which serves as a playground to try out new things in the Android world. Description The app primarily

Igor Tepavac 4 Apr 4, 2022
Here you can try out Kotlin Multiplatform and Jetpack Compose with some other cutting-edge technologies.

wire The Wire is a Kotlin Multiplatform sample project, currently supporting Android and Windows. Tools And Technolagies Architecture: MVVM MultiThrea

Ali Rezaiyan 9 Aug 16, 2022
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.

ThinkRchive An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android. WORK IN PROGRESS GOALS: Use Ret

Racka98 81 Dec 16, 2022
From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out Jetpack Compose.

Appettider From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out

Arianna Masciolini 0 Dec 6, 2021
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.

An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android. This repo is a Mutliplatform version of the initial Thinkrchive which was Android-centric

Thinkrchive 59 Dec 28, 2022
An exploratory playground library to figure out how to Draw and animate using Jetpack Compose

Jetpack Compose Chart Library This is an exploratory playground library to figure out how to Draw and animate using Android Jetpack Compose library. C

null 2 Sep 8, 2022
A highlight lib and also it can be a simple popup window lib for android

HighlightPro 中文 HighlightPro is a highlight library for android and also it can be a simple popup window library for android. Features: One or more hi

heyangyang 192 Jan 2, 2023
Fast android task that finished in only 3 hours, it gets the information from national number without database. I just wanna refine my skills in android basics so I try to make this simple project.

RaqmQawmy it is a fast android task that finished in only 3 hours, it gets the information from national number without database. I just wanna refine

Mahmoud Abdelazim 3 May 15, 2022