support for texture packs

This commit is contained in:
minjaesong
2022-02-23 17:59:38 +09:00
parent 841a77403b
commit 7c966b0da8
36 changed files with 2818 additions and 142 deletions

View File

@@ -28,7 +28,7 @@ import net.torvald.util.CircularArray
/**
* Created by minjaesong on 2018-07-06.
*/
class BuildingMaker(batch: SpriteBatch) : IngameInstance(batch) {
class BuildingMaker(batch: FlippingSpriteBatch) : IngameInstance(batch) {
private val menuYaml = Yaml("""
- File

View File

@@ -20,7 +20,7 @@ class EntryPoint : ModuleEntryPoint() {
private val moduleName = "basegame"
override fun getTitleScreen(batch: SpriteBatch): IngameInstance? {
override fun getTitleScreen(batch: FlippingSpriteBatch): IngameInstance? {
return TitleScreen(batch)
}

View File

@@ -61,7 +61,7 @@ import java.util.*
* Created by minjaesong on 2017-06-16.
*/
open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
var historicalFigureIDBucket: ArrayList<Int> = ArrayList<Int>()

View File

@@ -41,7 +41,7 @@ import kotlin.math.sin
/**
* Created by minjaesong on 2017-09-02.
*/
class TitleScreen(batch: SpriteBatch) : IngameInstance(batch) {
class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
// todo register titlescreen as the ingame, similar in a way that the buildingmaker did

View File

@@ -24,7 +24,7 @@ object InjectCreatureRaw {
* @param jsonFileName with extension
*/
operator fun invoke(actorValueRef: ActorValue, module: String, jsonFileName: String) {
val jsonObj = JsonFetcher(ModMgr.getPath(module, "creatures/$jsonFileName"))
val jsonObj = JsonFetcher(ModMgr.getFile(module, "creatures/$jsonFileName"))
JsonFetcher.forEach(jsonObj) { key, value -> if (!key.startsWith("_")) {

View File

@@ -10,8 +10,8 @@ import net.torvald.terrarum.gameactors.AVKey
object PlayerBuilderTestSubject1 {
operator fun invoke(): IngamePlayer {
val p: IngamePlayer = IngamePlayer(
ModMgr.getPath("basegame", "sprites/test_sprite.properties"),
ModMgr.getPath("basegame", "sprites/test_sprite_glow.properties"),
ModMgr.getGdxFile("basegame", "sprites/test_sprite.properties").path(),
ModMgr.getGdxFile("basegame", "sprites/test_sprite_glow.properties").path(),
-589141658L // random value thrown
)
InjectCreatureRaw(p.actorValue, "basegame", "CreatureHuman.json")

View File

@@ -11,8 +11,8 @@ import net.torvald.terrarum.gameactors.AVKey
object PlayerBuilderWerebeastTest {
operator fun invoke(): IngamePlayer {
val p: IngamePlayer = IngamePlayer(
ModMgr.getPath("basegame", "sprites/taimu.properties"),
ModMgr.getPath("basegame", "sprites/taimu_glow.properties"),
ModMgr.getGdxFile("basegame", "sprites/taimu.properties").path(),
ModMgr.getGdxFile("basegame", "sprites/taimu_glow.properties").path(),
-589141658L // random value thrown
)
InjectCreatureRaw(p.actorValue, "basegame", "CreatureWerebeastBase.json")

View File

@@ -29,7 +29,7 @@ class UIBasicInfo() : UICanvas() {
private var ELon = false
private var watchFont = WatchFont
private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/basic_info1.tga"), width, height)
private var atlas = TextureRegionPack(ModMgr.getGdxFile("basegame", "gui/basic_info1.tga"), width, height)
private var font = Watch7SegSmall

View File

@@ -23,10 +23,10 @@ class UITierOneWatch() : UICanvas() {
private val ELuptime = 4f
private var ELon = false
private var atlas = TextureRegionPack(ModMgr.getPath("basegame", "gui/watchface_atlas.tga"), width, height)
private var atlas = TextureRegionPack(ModMgr.getGdxFile("basegame", "gui/watchface_atlas.tga"), width, height)
private var watchFont = WatchFont
private var moonDial = TextureRegionPack(ModMgr.getPath("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17)
private var moonDial = TextureRegionPack(ModMgr.getGdxFile("basegame", "fonts/watch_17pxmoondial.tga"), 17, 17)
private var moonDialCount = moonDial.horizontalCount
private val drawCol = Color(1f, 1f, 1f, UIQuickslotBar.DISPLAY_OPACITY)