Added 2 small poi

fixed some crashes in the item view
This commit is contained in:
Grimm
2021-12-07 23:03:40 +01:00
parent d6f55eddfe
commit 58eded5d09
18 changed files with 387 additions and 57 deletions

View File

@@ -79,11 +79,11 @@ public class PlayerStatisticScene extends UIScene {
enemyImage.setSize(8,8);
Label name = Controls.newLabel(data.name);
enemiesGroup.add(enemyImage).align(Align.left).space(2);
enemiesGroup.add((data.name)).align(Align.left).space(2);
enemiesGroup.add((entry.getValue().getLeft().toString())).align(Align.right).space(2);
enemiesGroup.add(("/")).align(Align.right).space(2);
enemiesGroup.add((entry.getValue().getRight().toString())).align(Align.right).space(2);
enemiesGroup.add(enemyImage).align(Align.left).space(5);
enemiesGroup.add((data.name)).align(Align.left).space(5);
enemiesGroup.add((entry.getValue().getLeft().toString())).align(Align.right).space(5);
enemiesGroup.add(("/")).align(Align.right).space(5);
enemiesGroup.add((entry.getValue().getRight().toString())).align(Align.right).space(5);
enemiesGroup.row().space(5);
}

View File

@@ -255,6 +255,8 @@ public class CardUtil {
}
public static int getCardPrice(PaperCard card)
{
if(card==null)
return 0;
switch (card.getRarity())
{
case BasicLand:

View File

@@ -1,63 +1,40 @@
package forge.itemmanager.views;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Align;
import forge.Forge;
import forge.Forge.KeyInputAdapter;
import forge.Graphics;
import forge.ImageKeys;
import forge.assets.FImage;
import forge.assets.FImageComplex;
import forge.assets.FSkin;
import forge.assets.FSkinColor;
import forge.assets.*;
import forge.assets.FSkinColor.Colors;
import forge.assets.FSkinFont;
import forge.assets.FSkinImage;
import forge.assets.ImageCache;
import forge.card.*;
import forge.card.CardRenderer.CardStackPosition;
import forge.deck.ArchetypeDeckGenerator;
import forge.deck.CardThemedDeckGenerator;
import forge.deck.CommanderDeckGenerator;
import forge.deck.DeckProxy;
import forge.deck.FDeckViewer;
import forge.deck.*;
import forge.deck.io.DeckPreferences;
import forge.game.card.CardView;
import forge.gamemodes.planarconquest.ConquestCommander;
import forge.item.InventoryItem;
import forge.item.PaperCard;
import forge.itemmanager.ColumnDef;
import forge.itemmanager.GroupDef;
import forge.itemmanager.ItemColumn;
import forge.itemmanager.ItemManager;
import forge.itemmanager.ItemManagerConfig;
import forge.itemmanager.ItemManagerModel;
import forge.itemmanager.SItemManagerUtil;
import forge.itemmanager.*;
import forge.itemmanager.filters.ItemFilter;
import forge.toolbox.FCardPanel;
import forge.toolbox.FComboBox;
import forge.toolbox.FDisplayObject;
import forge.toolbox.FEvent;
import forge.toolbox.*;
import forge.toolbox.FEvent.FEventHandler;
import forge.toolbox.FLabel;
import forge.toolbox.FScrollPane;
import forge.toolbox.FTextField;
import forge.util.ImageUtil;
import forge.util.Localizer;
import forge.util.TextUtil;
import forge.util.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
public class ImageView<T extends InventoryItem> extends ItemView<T> {
private static final float PADDING = Utils.scale(5);
private static final float PILE_SPACING_Y = 0.1f;
@@ -584,7 +561,10 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
private ItemInfo getItemAtPoint(float x, float y) {
//check selected items first since they appear on top
for (int i = selectedIndices.size() - 1; i >= 0; i--) {
ItemInfo item = orderedItems.get(selectedIndices.get(i));
int currentIndex=selectedIndices.get(i);
if(currentIndex<0||orderedItems.size()<=currentIndex)
continue;
ItemInfo item = orderedItems.get(currentIndex);
float relX = x + item.group.getScrollLeft() - item.group.getLeft();
float relY = y + getScrollValue();
if (item.contains(relX, relY)) {
@@ -760,16 +740,20 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
@Override
public void scrollSelectionIntoView() {
if (selectedIndices.isEmpty()) { return; }
int index=selectedIndices.get(0);
if(index<0||orderedItems.size()<=index) { return ; }
ItemInfo itemInfo = orderedItems.get(selectedIndices.get(0));
ItemInfo itemInfo = orderedItems.get(index);
getScroller().scrollIntoView(itemInfo);
}
@Override
public Rectangle getSelectionBounds() {
if (selectedIndices.isEmpty()) { return null; }
if (selectedIndices.isEmpty()) { return new Rectangle(); }
ItemInfo itemInfo = orderedItems.get(selectedIndices.get(0));
int index=selectedIndices.get(0);
if(index<0||orderedItems.size()<=index) { return new Rectangle(); }
ItemInfo itemInfo = orderedItems.get(index);
Vector2 relPos = itemInfo.group.getChildRelativePosition(itemInfo);
return new Rectangle(itemInfo.group.screenPos.x + relPos.x - SEL_BORDER_SIZE + itemInfo.group.getLeft(),
itemInfo.group.screenPos.y + relPos.y - SEL_BORDER_SIZE,

View File

@@ -6,7 +6,7 @@
"colors":["Green"],
"tribe":"Bear",
"tribeCards":1.0,
"tribeSynergyCards":0.2
"rares":0.8
"tribeSynergyCards":0.2,
"rares":0.4
}
}

View File

@@ -0,0 +1,11 @@
{
"name":"Wurm",
"template":
{
"count":60,
"colors":["Green"],
"tribe":"Wurm",
"tribeCards":1.0,
"rares":0.3
}
}

View File

@@ -7,12 +7,28 @@
],
"file.lastUsedOpenFilter": "Alle Dateien (*)",
"fileStates": {
"map/cave_1.tmx": {
"scale": 3.8134072580645157,
"selectedLayer": 4,
"viewCenter": {
"x": 232.07592059002357,
"y": 136.0987602104206
}
},
"map/cave_2.tmx": {
"scale": 3.8134072580645157,
"selectedLayer": 1,
"viewCenter": {
"x": 231.8136879113908,
"y": 135.8365275317878
}
},
"map/crypt.tmx": {
"scale": 3.8134072580645157,
"selectedLayer": 0,
"viewCenter": {
"x": 231.8136879113908,
"y": 136.0987602104206
"x": 232.07592059002357,
"y": 136.36099288905336
}
},
"map/forest_town.tmx": {
@@ -59,8 +75,8 @@
"scale": 1.7753124999999998,
"selectedLayer": 3,
"viewCenter": {
"x": 240.52103502904419,
"y": 135.75074810772753
"x": 239.957753916564,
"y": 136.31402922020771
}
},
"map/waste_town.tmx": {

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.7.1" orientation="orthogonal" renderorder="right-down" width="30" height="17" tilewidth="16" tileheight="16" infinite="0" nextlayerid="6" nextobjectid="53">
<editorsettings>
<export target="wastetown..tmx" format="tmx"/>
</editorsettings>
<tileset firstgid="1" source="../tileset/main.tsx"/>
<tileset firstgid="3477" source="../tileset/buildings.tsx"/>
<layer id="1" name="Background" width="30" height="17">
<data encoding="base64" compression="zlib">
eJzz42Rg8BvFo3gUj+JRPIpH8YjAAAvyrVM=
</data>
</layer>
<layer id="2" name="Ground" width="30" height="17">
<data encoding="base64" compression="zlib">
eJxz42RgcBvFo3gA8CoOBoY1HPS31x2IHwPxaqDdTzjp4waQX58CaWTgSie/ogOY31fTMPyx2YvuBlrYTcheWoX7MyBeAfTPSg7sdi4Hir+gYTyD7Ee3m9Z2YrObXnaixzc98hIy9oDa6zVE7QUATYCf+g==
</data>
</layer>
<layer id="3" name="Foreground" width="30" height="17">
<properties>
<property name="spriteLayer" type="bool" value="true"/>
</properties>
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIJRMApGwUgBAAf4AAE=
</data>
</layer>
<layer id="5" name="AboveSprites" width="30" height="17">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIJRMApGwUgBAAf4AAE=
</data>
</layer>
<objectgroup id="4" name="Objects">
<object id="38" template="../obj/entry_up.tx" x="208" y="281">
<properties>
<property name="teleport" value=""/>
</properties>
</object>
<object id="48" template="../obj/treasure.tx" x="137" y="143"/>
<object id="49" template="../obj/gold.tx" x="152" y="116"/>
<object id="50" template="../obj/enemy.tx" x="208" y="239">
<properties>
<property name="enemy" value="Wurm"/>
</properties>
</object>
<object id="51" template="../obj/treasure.tx" x="192" y="128"/>
<object id="52" template="../obj/gold.tx" x="246" y="152"/>
</objectgroup>
</map>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.7.1" orientation="orthogonal" renderorder="right-down" width="30" height="17" tilewidth="16" tileheight="16" infinite="0" nextlayerid="6" nextobjectid="53">
<editorsettings>
<export target="wastetown..tmx" format="tmx"/>
</editorsettings>
<tileset firstgid="1" source="../tileset/main.tsx"/>
<tileset firstgid="3477" source="../tileset/buildings.tsx"/>
<layer id="1" name="Background" width="30" height="17">
<data encoding="base64" compression="zlib">
eJzz42Rg8BvFo3gUj+JRPIpH8YjAAAvyrVM=
</data>
</layer>
<layer id="2" name="Ground" width="30" height="17">
<data encoding="base64" compression="zlib">
eJxz42RgcBvFo3gE4lUcDAyrgXgNB33tfAqkQcCVjn59BsQrOSD2Puakr789oP4FgeVAO18MgJ+9oGFPDz8jxzEorEFsLzqHMz3DGjmc6Rm/IOzOSf+8hBzW9IhXWtgLAD1zph0=
</data>
</layer>
<layer id="3" name="Foreground" width="30" height="17">
<properties>
<property name="spriteLayer" type="bool" value="true"/>
</properties>
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIJRMApGwUgBAAf4AAE=
</data>
</layer>
<layer id="5" name="AboveSprites" width="30" height="17">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIJRMApGwUgBAAf4AAE=
</data>
</layer>
<objectgroup id="4" name="Objects">
<object id="38" template="../obj/entry_up.tx" x="209" y="282">
<properties>
<property name="teleport" value=""/>
</properties>
</object>
<object id="51" template="../obj/treasure.tx" x="198" y="139"/>
</objectgroup>
</map>

View File

@@ -34,6 +34,9 @@ WasteTown
Gate
xy: 384, 128
size: 64, 48
Cave
xy: 192, 272
size: 32, 32
Monestory
xy: 384, 592
size: 64, 64

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.5" tiledversion="1.7.2" name="main" tilewidth="16" tileheight="16" tilecount="3476" columns="158">
<tileset version="1.5" tiledversion="1.7.1" name="main" tilewidth="16" tileheight="16" tilecount="3476" columns="158">
<image source="main.png" width="2528" height="352"/>
<tile id="105">
<objectgroup draworder="index" id="2">
@@ -423,6 +423,44 @@
<object id="1" x="0" y="0" width="15" height="16"/>
</objectgroup>
</tile>
<tile id="2214">
<objectgroup draworder="index" id="2">
<object id="1" x="12" y="12" width="4" height="4"/>
</objectgroup>
</tile>
<tile id="2215">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="16" height="4"/>
</objectgroup>
</tile>
<tile id="2216">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="4" height="4"/>
</objectgroup>
</tile>
<tile id="2217">
<objectgroup draworder="index" id="3">
<object id="2" x="0" y="0" width="4" height="16"/>
<object id="3" x="4" y="0" width="12" height="8"/>
<object id="4" x="4" y="8" width="4" height="4"/>
<object id="5" x="8" y="8" width="2" height="2"/>
<object id="6" x="4" y="12" width="2" height="2"/>
</objectgroup>
</tile>
<tile id="2218">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="9"/>
</objectgroup>
</tile>
<tile id="2219">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="7"/>
<object id="2" x="11" y="7" width="5" height="9"/>
<object id="3" x="5" y="7" width="6" height="4"/>
<object id="4" x="2" y="7" width="3" height="2"/>
<object id="6" x="8" y="11" width="3" height="2"/>
</objectgroup>
</tile>
<tile id="2350">
<objectgroup draworder="index" id="2">
<object id="1" x="3" y="0" width="13" height="14"/>
@@ -443,6 +481,31 @@
<object id="1" x="1" y="0" width="14" height="15"/>
</objectgroup>
</tile>
<tile id="2372">
<objectgroup draworder="index" id="2">
<object id="1" x="11" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="2373">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
</objectgroup>
</tile>
<tile id="2374">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="2375">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="2377">
<objectgroup draworder="index" id="2">
<object id="1" x="10" y="0" width="6" height="16"/>
</objectgroup>
</tile>
<tile id="2475">
<objectgroup draworder="index" id="2">
<object id="1" x="2" y="1" width="12" height="13"/>
@@ -458,6 +521,43 @@
<object id="1" x="0" y="0" width="14" height="15"/>
</objectgroup>
</tile>
<tile id="2530">
<objectgroup draworder="index" id="2">
<object id="1" x="11" y="0" width="5" height="8"/>
</objectgroup>
</tile>
<tile id="2531">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="9"/>
</objectgroup>
</tile>
<tile id="2532">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="5" height="8"/>
</objectgroup>
</tile>
<tile id="2533">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="13" width="16" height="3"/>
<object id="3" x="0" y="11" width="14" height="2"/>
<object id="4" x="0" y="5" width="10" height="6"/>
<object id="6" x="0" y="-1" width="7" height="6"/>
</objectgroup>
</tile>
<tile id="2534">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="16" height="4"/>
</objectgroup>
</tile>
<tile id="2535">
<objectgroup draworder="index" id="2">
<object id="1" x="12" y="0" width="4" height="16"/>
<object id="3" x="0" y="12" width="12" height="4"/>
<object id="6" x="4" y="9" width="8" height="3"/>
<object id="7" x="7" y="6" width="5" height="3"/>
<object id="8" x="11" y="0" width="1" height="6"/>
</objectgroup>
</tile>
<tile id="2668">
<objectgroup draworder="index" id="2">
<object id="1" x="1" y="1" width="13" height="14"/>
@@ -515,6 +615,84 @@
<object id="4" x="7" y="8" width="4" height="4"/>
</objectgroup>
</tile>
<tile id="3319">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="5" height="8"/>
<object id="2" x="13" y="25"/>
</objectgroup>
</tile>
<tile id="3320">
<objectgroup draworder="index" id="2">
<object id="1" x="11" y="0" width="5" height="8"/>
</objectgroup>
</tile>
<tile id="3321">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="9"/>
</objectgroup>
</tile>
<tile id="3322">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="4" height="4"/>
</objectgroup>
</tile>
<tile id="3323">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="3325">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="4" height="16"/>
<object id="2" x="4" y="0" width="4" height="13"/>
<object id="3" x="8" y="0" width="3" height="11"/>
<object id="4" x="11" y="0" width="5" height="8"/>
</objectgroup>
</tile>
<tile id="3326">
<objectgroup draworder="index" id="2">
<object id="1" x="12" y="12" width="4" height="4"/>
</objectgroup>
</tile>
<tile id="3328">
<objectgroup draworder="index" id="2">
<object id="1" x="10" y="0" width="6" height="16"/>
</objectgroup>
</tile>
<tile id="3329">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="8"/>
<object id="2" x="4" y="8" width="12" height="3"/>
<object id="3" x="8" y="11" width="8" height="1"/>
<object id="4" x="11" y="12" width="5" height="4"/>
</objectgroup>
</tile>
<tile id="3330">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="16" height="4"/>
</objectgroup>
</tile>
<tile id="3331">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="7" width="10" height="9"/>
<object id="2" x="10" y="11" width="6" height="5"/>
<object id="4" x="0" y="4" width="8" height="3"/>
<object id="5" x="0" y="0" width="5" height="4"/>
</objectgroup>
</tile>
<tile id="3332">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="12" width="16" height="4"/>
<object id="3" x="4" y="9" width="12" height="3"/>
<object id="5" x="7" y="6" width="9" height="3"/>
<object id="6" x="11" y="0" width="5" height="6"/>
</objectgroup>
</tile>
<tile id="3333">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
</objectgroup>
</tile>
<tile id="3417">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="8"/>

View File

@@ -24,6 +24,6 @@
"color": "110903",
"spriteNames":[ "SwampTree","SwampTree2","DarkGras","Skull","SwampRock","DarkWood","Reed","Waterlily","Shroom","Shroom2"] ,
"enemies":[ "Zombie","Skeleton","Vampire","High Vampire","Zombie Lord","Big Zombie","Demon","Black Wiz1"] ,
"pointsOfInterest":[ "Graveyard","Swamp Town"]
"pointsOfInterest":[ "Graveyard","Swamp Town","Cave_1","Cave_2"]
}

View File

@@ -24,5 +24,5 @@
"color": "10a2e0",
"spriteNames":["IslandTree","Coral","Shell"] ,
"enemies":[ "Merfolk","Merfolk warrior","Merfolk Avatar","Djinn","Blue Wiz1"] ,
"pointsOfInterest":[ "Island Town"]
"pointsOfInterest":[ "Island Town","Cave_1","Cave_2"]
}

View File

@@ -488,6 +488,40 @@
}
]
},
{
"name": "Wurm",
"sprite": "sprites/leech.atlas",
"deck": "decks/wurm.json",
"spawnRate": 0.2,
"difficulty": 0.1,
"speed": 25,
"life": 14,
"rewards": [
{
"type": "deckCard",
"probability": 1,
"count": 2,
"addMaxCount": 4
},
{
"type": "gold",
"probability": 0.7,
"count": 10,
"addMaxCount": 90
},
{
"type": "card",
"probability": 0.5,
"count": 2,
"colors": [
"White"
],
"rarity": [
"Rare"
]
}
]
},
{
"name": "Human elite",
"sprite": "sprites/legionite.atlas",

View File

@@ -24,5 +24,5 @@
"color": "59a650" ,
"spriteNames":[ "WoodTree","WoodTree2","Bush","Stump","Moss","Stone","Flower","Wood"] ,
"enemies":[ "Elf","Elf warrior","High Elf","Dino","Snake","Hydra","Bear","Spider","Green Wiz1"] ,
"pointsOfInterest":[ "Forest Town"]
"pointsOfInterest":[ "Forest Town","Cave_1","Cave_2"]
}

View File

@@ -54,5 +54,21 @@
"spriteAtlas":"maps/tileset/buildings.atlas",
"sprite":"Graveyard",
"map": "maps/map/graveyard.tmx"
}
},
{
"name":"Cave_1",
"count":20,
"radiusFactor":0.8,
"spriteAtlas":"maps/tileset/buildings.atlas",
"sprite":"Cave",
"map": "maps/map/cave_1.tmx"
},
{
"name":"Cave_2",
"count":20,
"radiusFactor":0.8,
"spriteAtlas":"maps/tileset/buildings.atlas",
"sprite":"Cave",
"map": "maps/map/cave_2.tmx"
}
]

View File

@@ -24,5 +24,5 @@
"color": "e53b28",
"spriteNames":[ "MountainTree","MountainTree2","MountainRock","LargeMountainRock","Gravel"] ,
"enemies":[ "Goblin","Goblin Warrior","Goblin Chief","Minotaur","Devil","Red Wiz1"] ,
"pointsOfInterest":[ "Mountain Town"]
"pointsOfInterest":[ "Mountain Town","Cave_1","Cave_2"]
}

View File

@@ -24,5 +24,5 @@
"color": "aeaeae",
"spriteNames":[ "WasteTree","Stone","WasteRock"] ,
"enemies":[ "Golem","ClayGolem","Black Wiz1","White Wiz1","Blue Wiz1","Red Wiz1","Green Wiz1"] ,
"pointsOfInterest":[ "Waste Town"]
"pointsOfInterest":[ "Waste Town","Cave_1","Cave_2"]
}

View File

@@ -24,5 +24,5 @@
"color": "efe697" ,
"spriteNames":[ "PlainsTree","Cactus","PlainsRock","LargePlainsRock","DarkGras"] ,
"enemies":[ "Cat","Human","Human guard","Human elite","Knight","White Wiz1"] ,
"pointsOfInterest":[ "Plains Town"]
"pointsOfInterest":[ "Plains Town","Cave_1","Cave_2"]
}