Compare commits

...

14 Commits

Author SHA1 Message Date
OMGeeky
86b838f755 fix ordering of changed elements with optimized structure 2025-12-21 15:56:11 +01:00
Nut.andor
f66d016d08 fix spritesheet 2025-11-09 21:13:55 +01:00
Nut.andor
9ba45fe848 toList replaced by collect 2025-11-09 18:03:30 +01:00
Nut.andor
f14255ce1c new spritesheets 2025-11-09 16:36:40 +01:00
Nut.andor
c37b56988d sort problem 2025-10-26 02:49:44 +02:00
Nut.andor
9654da02c2 New requirement "skillIncrease" to check if a skill increase for n levels is possible 2025-10-26 02:49:44 +02:00
Nut.andor
d5c1ccebce Merge remote-tracking branch 'origin/master' 2025-10-04 02:13:01 +02:00
Nut.andor
0bf6b3f4d1 spriteFlipChance renamed to horizontalFlipChance to fit the engine 2025-10-04 01:22:11 +02:00
Nut
69c031d28e Merge pull request #16 from OMGeeky/fix-release-workflow
Fix release workflow
2025-10-03 16:30:13 +02:00
OMGeeky
8399ae60ee upload zip as soon as its ready and upload exe later 2025-10-02 17:40:00 +02:00
OMGeeky
1b643f4aa1 fix nsis arguments (from switching to linux) 2025-10-02 17:10:23 +02:00
OMGeeky
4293095e8e fix warning/error output in action 2025-10-02 17:09:08 +02:00
OMGeeky
5f2927e00c switch to linux runner (windows-latest is annoying me with undocumented breaking changes...) 2025-10-02 16:59:48 +02:00
OMGeeky
79eddde155 handle errors during nsis exe creation and only upload zip in those cases 2025-10-02 16:46:08 +02:00
9 changed files with 102 additions and 60 deletions

View File

@@ -2,55 +2,68 @@ name: Release Build
on: on:
release: release:
types: [created] types: [ created ]
workflow_dispatch:
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Get Version - name: Get Version
id: get_version id: get_version
shell: bash shell: bash
run: | run: |
echo "Reading version from file:" echo "Reading version from file:"
cat res/ATCS_latest cat res/ATCS_latest
echo "" echo ""
VERSION=$(tr -d '[:space:]' < "res/ATCS_latest") VERSION=$(tr -d '[:space:]' < "res/ATCS_latest")
echo "Processed version: $VERSION" echo "Processed version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Environment variable set to: $VERSION" echo "Environment variable set to: $VERSION"
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
java-version: '11' java-version: '11'
distribution: 'temurin' distribution: 'temurin'
- name: Build JAR - name: Build JAR
shell: bash shell: bash
run: | run: |
cd packaging cd packaging
chmod +x package.sh chmod +x package.sh
echo "Building JAR and ZIP for version: ${{ env.VERSION }}" echo "Building JAR and ZIP for version: ${{ env.VERSION }}"
./package.sh -windows ./package.sh
echo "Created artifacts:" echo "Created artifacts:"
ls -la common/ATCS.jar ls -la common/ATCS.jar
ls -la ATCS_${{ env.VERSION }}.zip ls -la ATCS_${{ env.VERSION }}.zip
- name: Install NSIS - name: Upload Release Assets (zip)
uses: joncloud/makensis-action@v4 uses: softprops/action-gh-release@v1
with: env:
script-file: packaging/Windows/ATCS_Installer.nsi GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
arguments: /DVERSION="${{ env.VERSION }}" with:
files: |
./packaging/ATCS_${{ env.VERSION }}.zip
- name: Upload Release Assets - name: 'Install makensis (apt)'
uses: softprops/action-gh-release@v1 run: sudo apt update && sudo apt install -y nsis nsis-pluginapi
env: continue-on-error: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: - name: Create Windows-Installer with NSIS
files: | uses: joncloud/makensis-action@v4
./packaging/ATCS_${{ env.VERSION }}.zip with:
./packaging/ATCS_${{ env.VERSION }}_Setup.exe script-file: packaging/Windows/ATCS_Installer.nsi
arguments: -DVERSION="${{ env.VERSION }}"
continue-on-error: true
- name: Upload Release Assets (exe)
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ./packaging/ATCS_${{ env.VERSION }}_Setup.exe
continue-on-error: true

View File

@@ -45,6 +45,7 @@ atcs.spritesheet.items_weapons.category=item
atcs.spritesheet.items_weapons_2.category=item atcs.spritesheet.items_weapons_2.category=item
atcs.spritesheet.items_weapons_3.category=item atcs.spritesheet.items_weapons_3.category=item
atcs.spritesheet.monsters_antison.category=monster
atcs.spritesheet.monsters_armor1.category=monster atcs.spritesheet.monsters_armor1.category=monster
atcs.spritesheet.monsters_arulirs.category=monster atcs.spritesheet.monsters_arulirs.category=monster
@@ -132,3 +133,6 @@ atcs.spritesheet.monsters_newb_3.sizey=64
atcs.spritesheet.monsters_newb_4.category=monster atcs.spritesheet.monsters_newb_4.category=monster
atcs.spritesheet.monsters_newb_4.sizex=32 atcs.spritesheet.monsters_newb_4.sizex=32
atcs.spritesheet.monsters_newb_4.sizey=64 atcs.spritesheet.monsters_newb_4.sizey=64
atcs.spritesheet.monsters_1x2.category=monster
atcs.spritesheet.monsters_1x2.sizex=32
atcs.spritesheet.monsters_1x2.sizey=64

View File

@@ -170,7 +170,7 @@ public class GameDataCategory<E extends JSONElement> implements ProjectTreeNode
@Override @Override
public void notifyCreated() { public void notifyCreated() {
childrenAdded(new ArrayList<ProjectTreeNode>()); childrenAdded(new ArrayList<ProjectTreeNode>());
for (E node : dataMap.values()) { for (E node : toList()) {
node.notifyCreated(); node.notifyCreated();
} }
} }
@@ -232,7 +232,7 @@ public class GameDataCategory<E extends JSONElement> implements ProjectTreeNode
return; return;
} }
List<Map> dataToSave = new ArrayList<Map>(); List<Map> dataToSave = new ArrayList<Map>();
for (E element : dataMap.values()) { for (E element : toList()) {
if (element.jsonFile.equals(jsonFile)) { if (element.jsonFile.equals(jsonFile)) {
dataToSave.add(element.toJson()); dataToSave.add(element.toJson());
} }

View File

@@ -13,9 +13,9 @@ import javax.swing.tree.TreeNode;
import java.awt.*; import java.awt.*;
import java.io.File; import java.io.File;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.*;
import java.util.Enumeration;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
public class GameDataSet implements ProjectTreeNode, Serializable { public class GameDataSet implements ProjectTreeNode, Serializable {
@@ -159,7 +159,9 @@ public class GameDataSet implements ProjectTreeNode, Serializable {
} }
} else if (parent.type != GameSource.Type.referenced) { } else if (parent.type != GameSource.Type.referenced) {
for (File f : baseFolder.listFiles()) { List<File> files = new ArrayList<File>(Arrays.stream(baseFolder.listFiles()).collect(Collectors.toList()));
Collections.sort(files,Comparator.comparing(x->x.getName()));
for (File f : files) {
if (f.getName().startsWith("actorconditions_")) { if (f.getName().startsWith("actorconditions_")) {
ActorCondition.fromJson(f, actorConditions); ActorCondition.fromJson(f, actorConditions);
} else if (f.getName().startsWith("conversationlist_")) { } else if (f.getName().startsWith("conversationlist_")) {

View File

@@ -38,7 +38,7 @@ public class NPC extends JSONElement {
public Integer attack_damage_min = null; public Integer attack_damage_min = null;
public String spawngroup_id = null; public String spawngroup_id = null;
public String faction_id = null; public String faction_id = null;
public Integer spriteFlipChance = null; public Integer horizontalFlipChance = null;
public String dialogue_id = null; public String dialogue_id = null;
public String droplist_id = null; public String droplist_id = null;
public Integer attack_cost = null; public Integer attack_cost = null;
@@ -156,7 +156,7 @@ public class NPC extends JSONElement {
} }
this.spawngroup_id = (String) npcJson.get("spawnGroup"); this.spawngroup_id = (String) npcJson.get("spawnGroup");
this.faction_id = (String) npcJson.get("faction"); this.faction_id = (String) npcJson.get("faction");
this.spriteFlipChance = JSONElement.getInteger((Number) npcJson.get("spriteFlipChance")); this.horizontalFlipChance = JSONElement.getInteger((Number) npcJson.get("horizontalFlipChance"));
this.dialogue_id = (String) npcJson.get("phraseID"); this.dialogue_id = (String) npcJson.get("phraseID");
this.droplist_id = (String) npcJson.get("droplistID"); this.droplist_id = (String) npcJson.get("droplistID");
this.attack_cost = JSONElement.getInteger((Number) npcJson.get("attackCost")); this.attack_cost = JSONElement.getInteger((Number) npcJson.get("attackCost"));
@@ -246,7 +246,7 @@ public class NPC extends JSONElement {
} }
clone.droplist_id = this.droplist_id; clone.droplist_id = this.droplist_id;
clone.faction_id = this.faction_id; clone.faction_id = this.faction_id;
clone.spriteFlipChance = this.spriteFlipChance; clone.horizontalFlipChance = this.horizontalFlipChance;
if (this.hit_effect != null) { if (this.hit_effect != null) {
clone.hit_effect = new HitEffect(); clone.hit_effect = new HitEffect();
copyHitEffectValues(clone.hit_effect, this.hit_effect, clone); copyHitEffectValues(clone.hit_effect, this.hit_effect, clone);
@@ -305,7 +305,7 @@ public class NPC extends JSONElement {
writeMinMaxToMap(npcJson, "attackDamage", this.attack_damage_min, attack_damage_max, 0); writeMinMaxToMap(npcJson, "attackDamage", this.attack_damage_min, attack_damage_max, 0);
if (this.spawngroup_id != null) npcJson.put("spawnGroup", this.spawngroup_id); if (this.spawngroup_id != null) npcJson.put("spawnGroup", this.spawngroup_id);
if (this.faction_id != null) npcJson.put("faction", this.faction_id); if (this.faction_id != null) npcJson.put("faction", this.faction_id);
if (this.spriteFlipChance != null) npcJson.put("spriteFlipChance", this.spriteFlipChance); if (this.horizontalFlipChance != null) npcJson.put("horizontalFlipChance", this.horizontalFlipChance);
if (this.dialogue != null) { if (this.dialogue != null) {
npcJson.put("phraseID", this.dialogue.id); npcJson.put("phraseID", this.dialogue.id);
} else if (this.dialogue_id != null) { } else if (this.dialogue_id != null) {

View File

@@ -64,7 +64,8 @@ public class Requirement extends JSONElement {
date, date,
dateEquals, dateEquals,
time, time,
timeEquals timeEquals,
skillIncrease
} }
public enum SkillID { public enum SkillID {
@@ -166,6 +167,7 @@ public class Requirement extends JSONElement {
case dateEquals: case dateEquals:
case time: case time:
case timeEquals: case timeEquals:
case skillIncrease:
break; break;
} }
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent); if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);

View File

@@ -610,6 +610,17 @@ public class DialogueEditor extends JSONElementEditor {
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener); requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener); requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
break; break;
case skillIncrease:
skillId = null;
try {
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
} catch (IllegalArgumentException e) {
}
requirementObj = null;
requirementSkill = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Level up: ", requirement.required_value, false, writable, listener);
break;
} }
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener); requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
} }
@@ -843,7 +854,7 @@ public class DialogueEditor extends JSONElementEditor {
if (req.required_obj.getIcon() != null) { if (req.required_obj.getIcon() != null) {
label.setIcon(new ImageIcon(req.required_obj.getIcon())); label.setIcon(new ImageIcon(req.required_obj.getIcon()));
} }
} else if (req.type == Requirement.RequirementType.skillLevel) { } else if (req.type == Requirement.RequirementType.skillLevel || req.type == Requirement.RequirementType.skillIncrease) {
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon())); label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
} else if (req.type == Requirement.RequirementType.spentGold) { } else if (req.type == Requirement.RequirementType.spentGold) {
label.setIcon(new ImageIcon(DefaultIcons.getGoldIcon())); label.setIcon(new ImageIcon(DefaultIcons.getGoldIcon()));
@@ -1008,7 +1019,7 @@ public class DialogueEditor extends JSONElementEditor {
selectedRequirement.required_obj.removeBacklink(dialogue); selectedRequirement.required_obj.removeBacklink(dialogue);
selectedRequirement.required_obj = null; selectedRequirement.required_obj = null;
} }
if (selectedRequirement.type == Requirement.RequirementType.skillLevel) { if (selectedRequirement.type == Requirement.RequirementType.skillLevel || selectedRequirement.type == Requirement.RequirementType.skillIncrease) {
selectedRequirement.required_obj_id = value == null ? null : value.toString(); selectedRequirement.required_obj_id = value == null ? null : value.toString();
} }
requirementsListModel.itemChanged(selectedRequirement); requirementsListModel.itemChanged(selectedRequirement);

View File

@@ -37,7 +37,7 @@ public class NPCEditor extends JSONElementEditor {
private JTextField nameField; private JTextField nameField;
private JTextField spawnGroupField; private JTextField spawnGroupField;
private JTextField factionField; private JTextField factionField;
private JSpinner spriteFlipChanceField; private JSpinner horizontalFlipChanceField;
private JSpinner experienceField; private JSpinner experienceField;
private MyComboBox dialogueBox; private MyComboBox dialogueBox;
private MyComboBox droplistBox; private MyComboBox droplistBox;
@@ -129,7 +129,7 @@ public class NPCEditor extends JSONElementEditor {
nameField = addTranslatableTextField(pane, "Display name: ", npc.name, npc.writable, listener); nameField = addTranslatableTextField(pane, "Display name: ", npc.name, npc.writable, listener);
spawnGroupField = addTextField(pane, "Spawn group ID: ", npc.spawngroup_id, npc.writable, listener); spawnGroupField = addTextField(pane, "Spawn group ID: ", npc.spawngroup_id, npc.writable, listener);
factionField = addTextField(pane, "Faction ID: ", npc.faction_id, npc.writable, listener); factionField = addTextField(pane, "Faction ID: ", npc.faction_id, npc.writable, listener);
spriteFlipChanceField = addIntegerField(pane, "Icon Flip Chance: ", npc.spriteFlipChance, false, npc.writable, listener); horizontalFlipChanceField = addIntegerField(pane, "Horizontal flip chance: ", npc.horizontalFlipChance, false, npc.writable, listener);
experienceField = addIntegerField(pane, "Experience reward: ", npc.getMonsterExperience(), false, false, listener); experienceField = addIntegerField(pane, "Experience reward: ", npc.getMonsterExperience(), false, false, listener);
dialogueBox = addDialogueBox(pane, npc.getProject(), "Initial phrase: ", npc.dialogue, npc.writable, listener); dialogueBox = addDialogueBox(pane, npc.getProject(), "Initial phrase: ", npc.dialogue, npc.writable, listener);
droplistBox = addDroplistBox(pane, npc.getProject(), "Droplist / Shop inventory: ", npc.droplist, npc.writable, listener); droplistBox = addDroplistBox(pane, npc.getProject(), "Droplist / Shop inventory: ", npc.droplist, npc.writable, listener);
@@ -207,8 +207,8 @@ public class NPCEditor extends JSONElementEditor {
npc.spawngroup_id = (String) value; npc.spawngroup_id = (String) value;
} else if (source == factionField) { } else if (source == factionField) {
npc.faction_id = (String) value; npc.faction_id = (String) value;
} else if (source == spriteFlipChanceField) { } else if (source == horizontalFlipChanceField) {
npc.spriteFlipChance = (Integer) value; npc.horizontalFlipChance = (Integer) value;
} else if (source == dialogueBox) { } else if (source == dialogueBox) {
if (npc.dialogue != null) { if (npc.dialogue != null) {
npc.dialogue.removeBacklink(npc); npc.dialogue.removeBacklink(npc);

View File

@@ -674,6 +674,16 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener); requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener); requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
break; break;
case skillIncrease:
skillId = null;
try {
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
} catch (IllegalArgumentException e) {
}
requirementObj = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
break;
} }
} }
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener); requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
@@ -1921,7 +1931,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
} else if (source == requirementObj) { } else if (source == requirementObj) {
if (selectedMapObject instanceof KeyArea) { if (selectedMapObject instanceof KeyArea) {
KeyArea area = (KeyArea) selectedMapObject; KeyArea area = (KeyArea) selectedMapObject;
if (area.requirement.type == Requirement.RequirementType.skillLevel) { if (area.requirement.type == Requirement.RequirementType.skillLevel || area.requirement.type == Requirement.RequirementType.skillIncrease) {
area.requirement.required_obj_id = value == null ? null : value.toString(); area.requirement.required_obj_id = value == null ? null : value.toString();
} else { } else {
area.requirement.required_obj = (GameDataElement) value; area.requirement.required_obj = (GameDataElement) value;
@@ -1938,7 +1948,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
} }
} else if (selectedMapObject instanceof ReplaceArea) { } else if (selectedMapObject instanceof ReplaceArea) {
ReplaceArea area = (ReplaceArea) selectedMapObject; ReplaceArea area = (ReplaceArea) selectedMapObject;
if (area.requirement.type == Requirement.RequirementType.skillLevel) { if (area.requirement.type == Requirement.RequirementType.skillLevel || area.requirement.type == Requirement.RequirementType.skillIncrease) {
area.requirement.required_obj_id = value == null ? null : value.toString(); area.requirement.required_obj_id = value == null ? null : value.toString();
} else { } else {
area.requirement.required_obj = (GameDataElement) value; area.requirement.required_obj = (GameDataElement) value;