Skip to content

Commit

Permalink
Release Zomboid Storm v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew committed Jun 27, 2021
2 parents 5c98544 + 4e3b78b commit 31b1c12
Show file tree
Hide file tree
Showing 79 changed files with 718 additions and 444 deletions.
82 changes: 41 additions & 41 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ dependencies {
// https://mvnrepository.com/artifact/org.ow2.asm/asm-tree
implementation 'org.ow2.asm:asm-tree:9.1'

if (!CI) {
compileOnly files(rootConfigurations.zomboidImplementation.files).filter {
return !(it.name.equals('media'))
}
compileOnly files(rootConfigurations.zomboidImplementation.files).filter {
return !(it.name.equals('media'))
}
}
jar.archiveBaseName.set('storm-api')
44 changes: 44 additions & 0 deletions api/src/main/java/io/pzstorm/storm/event/OnLoadSoundBankEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Zomboid Storm - Java modding toolchain for Project Zomboid
* Copyright (C) 2021 Matthew Cain
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.pzstorm.storm.event;

import io.pzstorm.storm.event.lua.LuaEvent;

/**
* This event triggers when a sound bank is being loaded.
* Users can use this event to change the path of sound banks being loaded,
* effectively replacing vanilla with their own custom sound banks.
*/
@SuppressWarnings({ "WeakerAccess", "unused" })
public class OnLoadSoundBankEvent implements LuaEvent {

/**
* {@code StringBuffer} containing the string that denotes the path to the sound bank being loaded.
* In order to replace the given path with a custom path you can do the following:
* <pre>
* String customPath = "path/to/custom/sound/bank";
* soundBankPath.delete(0, soundBankPath.length()).append(customPath);
* </pre>
*/
public final StringBuffer soundBankPath;

public OnLoadSoundBankEvent(StringBuffer soundBankPath) {
this.soundBankPath = soundBankPath;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Zomboid Storm - Java modding toolchain for Project Zomboid
* Copyright (C) 2021 Matthew Cain
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.pzstorm.storm.event;

/**
* <p>This event triggers after vanilla FMOD sound banks finish loading.</p>
* You can use this event to load custom sound banks like this:
* <pre>
* String path = "path/to/sound/bank";
* javafmod.FMOD_Studio_System_LoadBankFile(path);
* </pre>
*/
public class OnLoadSoundBanksEvent implements ZomboidEvent {

@Override
public String getName() {
return "OnLoadSoundBanks";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
package io.pzstorm.storm.event.lua;

/**
* Triggered after sound banks have been loaded.
* This event triggers when {@link zombie.GameWindow} is initialized.
*/
@SuppressWarnings({ "WeakerAccess", "unused" })
public class OnLoadSoundBanksEvent implements LuaEvent {

// TODO: this event is not actually triggered directly after sound banks have been loaded,
// so move this event to be triggered directly after sound banks have been loaded
public class OnGameWindowInitEvent implements LuaEvent {

}
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//file:noinspection SpellCheckingInspection
//file:noinspection GroovyAssignabilityCheck

import io.pzstorm.capsid.setup.VmParameter
import io.pzstorm.capsid.setup.xml.LaunchRunConfig
Expand Down Expand Up @@ -34,13 +35,13 @@ allprojects {
repositories { mavenCentral() }
project.ext.set('CI', isCI)
group 'io.github.pzstorm'
version '0.1.1'
version '0.2.0'
}

// make sure to configure zombie subproject first because other
// subprojects depend on including it's sourceset output
subprojects.sort {
return it.name.equals('zombie') ? 0 : 1
return it.name == 'zombie' ? 0 : 1
}.each {
it.apply plugin: 'java'
it.apply plugin: 'maven-publish'
Expand Down Expand Up @@ -68,14 +69,8 @@ subprojects.sort {
compileOnly 'org.jetbrains:annotations:20.1.0'
}
}

def zombieProject = project(':zombie')
def mainProjects = [ project(':api'), project(':core') ]
mainProjects.each {
// add dummy zomboid classes to classpath when compiling on CI
if (isCI) {
it.sourceSets.main.compileClasspath += zombieProject.sourceSets.main.output
}
// assemble project jars in root build directory
it.jar.getDestinationDirectory().set(new File(buildDir, 'libs'))
}
Expand Down
11 changes: 6 additions & 5 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ dependencies {
implementation apiProject
testImplementation apiProject, zombieProject

def zomboidImplementationFiles = files(rootConfigurations.zomboidImplementation.files).filter {
return !(it.name.equals('media'))
}
implementation zomboidImplementationFiles
testImplementation zomboidImplementationFiles

if (!CI) {
implementation files(rootConfigurations.zomboidImplementation.files).filter {
return !(it.name.equals('media'))
}
runtimeOnly files(rootConfigurations.zomboidRuntimeOnly.files).filter {
return !(it.name.contains('test') || it.name.contains('junit'))
}
}
// depend on dummy zombie classes when building on CI
else implementation zombieProject
}

test {
Expand Down
Loading

0 comments on commit 31b1c12

Please sign in to comment.