Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
remade the UI with the intelliJ builder
Browse files Browse the repository at this point in the history
  • Loading branch information
celedev97 committed Nov 10, 2023
1 parent 1618acc commit 6875c3c
Show file tree
Hide file tree
Showing 43 changed files with 1,665 additions and 1,002 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
<version>2.15.3</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>4.0.4</version>
</dependency>

</dependencies>

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/dev/cele/asa_sm/AsaSmApplication.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.cele.asa_sm;

import com.formdev.flatlaf.FlatDarculaLaf;
import com.formdev.flatlaf.*;
import dev.cele.asa_sm.ui.frames.MainFrame;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -9,13 +9,15 @@
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Arrays;

@SpringBootApplication
@EnableFeignClients
@Slf4j
public class AsaSmApplication implements CommandLineRunner {

Expand All @@ -26,7 +28,7 @@ public class AsaSmApplication implements CommandLineRunner {
private MainFrame frame;

public static void main(String[] args) {
FlatDarculaLaf.setup();
IntelliJTheme.setup( AsaSmApplication.class.getResourceAsStream("/nord.theme.json") );
new SpringApplicationBuilder(AsaSmApplication.class)
.web(WebApplicationType.NONE)
.headless(false)
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/dev/cele/asa_sm/Const.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dev.cele.asa_sm;

import java.nio.file.Path;

public final class Const {
public final static String ASA_STEAM_GAME_NUMBER = "2430930";

public final static Path DATA_DIR = Path.of("data");

public final static Path PROFILES_DIR = DATA_DIR.resolve("profiles");
public final static Path SERVERS_DIR = Path.of("servers");

public final static Path MOD_CACHE_DIR = DATA_DIR.resolve("mod_cache");

}
12 changes: 0 additions & 12 deletions src/main/java/dev/cele/asa_sm/Const.kt

This file was deleted.

This file was deleted.

5 changes: 3 additions & 2 deletions src/main/java/dev/cele/asa_sm/config/MapperConfig.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package dev.cele.asa_sm.config

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
open class MapperConfig {
@Bean
open fun modelMapper(): ObjectMapper {
return ObjectMapper()
open fun modelMapper() = ObjectMapper().apply {
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
}
}
28 changes: 28 additions & 0 deletions src/main/java/dev/cele/asa_sm/config/SpringApplicationContext.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.cele.asa_sm.config

import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationContextAware
import org.springframework.context.annotation.Configuration

@Configuration
internal open class SpringApplicationContext : ApplicationContextAware {

override fun setApplicationContext(context: ApplicationContext) {
Companion.context = context
}

companion object {
@JvmStatic
fun<T> autoWire(java: Class<T>): T {
return context!!.getBean(java)
}

@JvmStatic
fun<T> autoWire(qualifier: String): T {
return context!!.getBean(qualifier) as T
}

@JvmStatic
var context: ApplicationContext? = null
}
}
4 changes: 1 addition & 3 deletions src/main/java/dev/cele/asa_sm/dto/AsaServerConfigDto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import java.io.File
import java.util.*

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class AsaServerConfigDto {
var installFolder = ""
var map = MapsEnum.THE_ISLAND.mapName
var guid = UUID.randomUUID().toString()
var profileName = "Server"
Expand All @@ -20,7 +18,7 @@ class AsaServerConfigDto {
var serverPort: Int = 7777
var serverQueryPort: Int = 27015
var serverMaxPlayers: Int = 70
var battlEye = true
var battlEye = false
var serverSpectatorPassword = ""
var serverLocalIp = ""
var rconEnabled = false
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/dev/cele/asa_sm/dto/curseforge/DataDto.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.cele.asa_sm.dto.curseforge

class DataDto<T> {
var data: T? = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.cele.asa_sm.dto.curseforge

class GetModFilesRequestBody(
var modIds: List<Int>? = null
)
7 changes: 7 additions & 0 deletions src/main/java/dev/cele/asa_sm/dto/curseforge/ModAuthorDto.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package dev.cele.asa_sm.dto.curseforge

class ModAuthorDto {
var id: Int? = null
var name: String? = null
var url: String? = null
}
33 changes: 33 additions & 0 deletions src/main/java/dev/cele/asa_sm/dto/curseforge/ModDto.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package dev.cele.asa_sm.dto.curseforge

import com.fasterxml.jackson.annotation.JsonIgnoreProperties

class ModDto {
var id: Int? = null
var gameId: Int? = null
var name: String? = null
var slug: String? = null
var links: ModLinksDto? = null
var summary: String? = null
var status: Int? = null
var downloadCount: Long? = null

//public Boolean isFeatured;
//public Integer primaryCategoryId;
//public CategoryDto[] categories;
//public Integer classId;
var authors: List<ModAuthorDto> = listOf()

//public ModAssetDto logo;
//public ModAssetDto[] screenshots;
//public Integer mainFileId;
//public FileDto[] latestFiles;
//public FileIndexDto[] latestFilesIndexes;
//public FileIndexDto[] latestEarlyAccessFilesIndexes;
//public String dateCreated;
var dateModified: String? = null //public String dateReleased;
//public Boolean allowModDistribution;
//public Integer gamePopularityRank;
//public Boolean isAvailable;
//public Integer thumbsUpCount;
}
11 changes: 11 additions & 0 deletions src/main/java/dev/cele/asa_sm/dto/curseforge/ModLinksDto.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.cele.asa_sm.dto.curseforge

import lombok.Data

@Data
class ModLinksDto {
var websiteUrl: String? = null
var wikiUrl: String? = null
var issuesUrl: String? = null
var sourceUrl: String? = null
}
98 changes: 0 additions & 98 deletions src/main/java/dev/cele/asa_sm/services/CommandRunnerService.java

This file was deleted.

Loading

0 comments on commit 6875c3c

Please sign in to comment.