Re-made all weapon sprites and finalized weapon layout

This commit is contained in:
Anuken
2017-09-24 13:03:20 -04:00
parent 2f092604a3
commit c0505338f2
13 changed files with 188 additions and 182 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 243 B

View File

@@ -6,862 +6,862 @@ filter: Nearest,Nearest
repeat: none
backgrounds/background
rotate: false
xy: 1, 241
xy: 1, 235
size: 356, 270
orig: 356, 270
offset: 0, 0
index: -1
blank
rotate: false
xy: 509, 510
xy: 17, 198
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
blocks/block
rotate: false
xy: 489, 503
xy: 135, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal1
rotate: false
xy: 149, 231
xy: 485, 497
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal2
rotate: false
xy: 359, 361
xy: 1, 81
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal3
rotate: false
xy: 499, 503
xy: 145, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coaldrill
rotate: false
xy: 1, 71
xy: 359, 357
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coalpurifier
rotate: false
xy: 159, 231
xy: 495, 497
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/compositewall
rotate: false
xy: 359, 351
xy: 1, 71
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduit
rotate: false
xy: 1, 61
xy: 155, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitbottom
rotate: false
xy: 169, 231
xy: 359, 347
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitliquid
rotate: false
xy: 359, 341
xy: 1, 61
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduittop
rotate: false
xy: 1, 51
xy: 165, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyor
rotate: false
xy: 179, 231
xy: 359, 337
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyormove
rotate: false
xy: 359, 331
xy: 1, 51
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/core
rotate: false
xy: 1, 41
xy: 175, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/cross
rotate: false
xy: 189, 231
xy: 359, 327
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/crucible
rotate: false
xy: 359, 321
xy: 1, 41
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/deepwater
rotate: false
xy: 1, 31
xy: 185, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt1
rotate: false
xy: 199, 231
xy: 359, 317
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt2
rotate: false
xy: 359, 311
xy: 1, 31
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt3
rotate: false
xy: 1, 21
xy: 195, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtblock
rotate: false
xy: 209, 231
xy: 359, 307
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtedge
rotate: false
xy: 359, 419
xy: 375, 445
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/doubleturret
rotate: false
xy: 359, 407
xy: 437, 495
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/drill
rotate: false
xy: 359, 301
xy: 1, 21
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/duriumwall
rotate: false
xy: 1, 11
xy: 205, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/flameturret
rotate: false
xy: 453, 501
xy: 1, 125
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/grass1
rotate: false
xy: 1, 1
xy: 1, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass2
rotate: false
xy: 219, 231
xy: 215, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass3
rotate: false
xy: 359, 291
xy: 359, 287
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock
rotate: false
xy: 229, 231
xy: 1, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock2
rotate: false
xy: 359, 281
xy: 225, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassedge
rotate: false
xy: 407, 467
xy: 423, 493
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/iron1
rotate: false
xy: 269, 231
xy: 359, 247
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron2
rotate: false
xy: 359, 241
xy: 265, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron3
rotate: false
xy: 279, 231
xy: 359, 237
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/irondrill
rotate: false
xy: 289, 231
xy: 275, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/ironwall
rotate: false
xy: 299, 231
xy: 285, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/junction
rotate: false
xy: 309, 231
xy: 295, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/laserturret
rotate: false
xy: 1, 115
xy: 99, 223
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/liquidrouter
rotate: false
xy: 319, 231
xy: 305, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/machineturret
rotate: false
xy: 113, 229
xy: 359, 401
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/megarepairturret
rotate: false
xy: 359, 395
xy: 449, 495
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mortarturret
rotate: false
xy: 465, 501
xy: 1, 113
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mossblock
rotate: false
xy: 329, 231
xy: 325, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/mossstone
rotate: false
xy: 329, 231
xy: 325, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/omnidrill
rotate: false
xy: 339, 231
xy: 345, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/plasmaturret
rotate: false
xy: 1, 103
xy: 111, 223
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/pump
rotate: false
xy: 359, 231
xy: 373, 413
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/repairturret
rotate: false
xy: 125, 229
xy: 359, 389
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/rock
rotate: false
xy: 21, 215
xy: 371, 393
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2
rotate: false
xy: 31, 215
xy: 371, 383
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2shadow
rotate: false
xy: 41, 215
xy: 371, 373
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rockshadow
rotate: false
xy: 51, 215
xy: 369, 363
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/router
rotate: false
xy: 61, 215
xy: 369, 353
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shadow
rotate: false
xy: 359, 383
xy: 461, 495
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shotgunturret
rotate: false
xy: 477, 501
xy: 1, 101
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shrub
rotate: false
xy: 71, 215
xy: 369, 343
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shrubshadow
rotate: false
xy: 81, 215
xy: 369, 333
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/smelter
rotate: false
xy: 91, 215
xy: 369, 323
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/sniperturret
rotate: false
xy: 1, 91
xy: 123, 223
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/steelconveyor
rotate: false
xy: 101, 219
xy: 369, 313
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelconveyormove
rotate: false
xy: 111, 219
xy: 369, 303
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelwall
rotate: false
xy: 121, 219
xy: 369, 293
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone
rotate: false
xy: 423, 483
xy: 1, 137
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stone1
rotate: false
xy: 131, 219
xy: 369, 283
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone2
rotate: false
xy: 141, 219
xy: 369, 273
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone3
rotate: false
xy: 151, 221
xy: 369, 263
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock
rotate: false
xy: 161, 221
xy: 369, 253
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock2
rotate: false
xy: 171, 221
xy: 369, 243
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock3
rotate: false
xy: 181, 221
xy: 369, 233
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stonedrill
rotate: false
xy: 191, 221
xy: 359, 227
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneedge
rotate: false
xy: 439, 499
xy: 85, 221
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stonewall
rotate: false
xy: 201, 221
xy: 369, 223
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium1
rotate: false
xy: 211, 221
xy: 21, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium2
rotate: false
xy: 221, 221
xy: 31, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium3
rotate: false
xy: 231, 221
xy: 41, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumdrill
rotate: false
xy: 241, 221
xy: 51, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumpurifier
rotate: false
xy: 251, 221
xy: 61, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumwall
rotate: false
xy: 261, 221
xy: 71, 209
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/turret
rotate: false
xy: 137, 229
xy: 359, 377
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/water
rotate: false
xy: 271, 221
xy: 30, 199
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/wateredge
rotate: false
xy: 1, 127
xy: 359, 413
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/waveturret
rotate: false
xy: 359, 371
xy: 473, 495
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
bullet
rotate: false
xy: 1, 81
xy: 359, 367
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
circle
rotate: false
xy: 101, 229
xy: 375, 433
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
enemies/blastenemy-t1
rotate: false
xy: 359, 497
xy: 359, 491
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/blastenemy-t2
rotate: false
xy: 1, 205
xy: 1, 199
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/blastenemy-t3
rotate: false
xy: 21, 225
xy: 21, 219
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/enemy-t1
rotate: false
xy: 375, 497
xy: 359, 475
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/enemy-t2
rotate: false
xy: 375, 435
xy: 391, 461
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/enemy-t3
rotate: false
xy: 391, 451
xy: 407, 477
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/fastenemy-t1
rotate: false
xy: 1, 189
xy: 375, 491
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t2
rotate: false
xy: 37, 225
xy: 1, 183
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t3
rotate: false
xy: 359, 465
xy: 37, 219
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t1
rotate: false
xy: 375, 481
xy: 359, 459
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t2
rotate: false
xy: 391, 497
xy: 375, 475
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t3
rotate: false
xy: 1, 173
xy: 391, 491
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t1
rotate: false
xy: 375, 465
xy: 1, 167
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t2
rotate: false
xy: 391, 481
xy: 53, 219
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t3
rotate: false
xy: 407, 497
xy: 359, 443
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t1
rotate: false
xy: 359, 433
xy: 375, 459
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t2
rotate: false
xy: 375, 449
xy: 391, 475
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t3
rotate: false
xy: 391, 465
xy: 407, 491
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t1
rotate: false
xy: 407, 481
xy: 1, 151
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t2
rotate: false
xy: 423, 497
xy: 69, 219
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t3
rotate: false
xy: 1, 141
xy: 359, 427
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
icon-coal
rotate: false
xy: 239, 231
xy: 359, 277
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-dirium
rotate: false
xy: 359, 271
xy: 235, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-iron
rotate: false
xy: 249, 231
xy: 359, 267
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-steel
rotate: false
xy: 359, 261
xy: 245, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-stone
rotate: false
xy: 259, 231
xy: 359, 257
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-titanium
rotate: false
xy: 359, 251
xy: 255, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
laser
rotate: false
xy: 17, 207
xy: 17, 201
size: 1, 12
orig: 1, 12
offset: 0, 0
index: -1
laserend
rotate: false
xy: 1, 221
xy: 1, 215
size: 18, 18
orig: 18, 18
offset: 0, 0
index: -1
player
rotate: false
xy: 349, 231
xy: 375, 423
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/blaster
rotate: false
xy: 359, 481
size: 14, 14
orig: 14, 14
xy: 1, 91
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/flamethrower
weapons/flamer
rotate: false
xy: 53, 225
size: 14, 14
orig: 14, 14
xy: 359, 297
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/mortar
rotate: false
xy: 359, 449
size: 14, 14
orig: 14, 14
xy: 315, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/multigun
rotate: false
xy: 1, 157
size: 14, 14
orig: 14, 14
xy: 335, 225
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/railgun
rotate: false
xy: 69, 225
size: 14, 14
orig: 14, 14
xy: 371, 403
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/triblaster
rotate: false
xy: 85, 225
size: 14, 14
orig: 14, 14
xy: 20, 199
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -534,26 +534,36 @@ public class UI extends SceneModule{
public void updateWeapons(){
weapontable.clearChildren();
ButtonGroup group = new ButtonGroup();
weapontable.defaults().size(58, 62);
for(Weapon weapon : control.getWeapons()){
ImageButton button = new ImageButton(Draw.region(weapon.name()), "static");
button.getImageCell().size(14*3);
button.setDisabled(true);
ImageButton button = new ImageButton(Draw.region(weapon.name()), "toggle");
button.getImageCell().size(8*5);
if(weapon != player.weapon)
button.setColor(Color.GRAY);
group.add(button);
weapontable.add(button).size(52, 56);
button.clicked(()->{
if(weapon == player.weapon) return;
player.weapon = weapon;
button.setChecked(true);
});
button.setChecked(weapon == player.weapon);
weapontable.add(button);
Table tiptable = new Table();
String description = weapon.description;
tiptable.background("button");
tiptable.add("[PURPLE]" + weapon.name(), 0.75f).left().padBottom(2f);
tiptable.add("" + weapon.name(), 0.5f).left().padBottom(3f);
tiptable.row();
tiptable.row();
tiptable.add("[ORANGE]" + description).left();
tiptable.pad(10f);
tiptable.add("[GRAY]" + description).left();
tiptable.pad(14f);
Tooltip tip = new Tooltip(tiptable);
@@ -563,9 +573,9 @@ public class UI extends SceneModule{
}
weapontable.addIButton("icon-menu", 8*3, ()->{
weapontable.addIButton("icon-menu", 8*4, ()->{
upgrades.show();
}).size(52, 56);
});
}
public void showLoading(){

View File

@@ -82,7 +82,7 @@ import io.anuke.ucore.entities.Entity;
*/
public class SaveIO{
/**Save file version ID. Should be incremented every breaking release.*/
private static final int fileVersionID = 5;
private static final int fileVersionID = 6;
private static FormatProvider provider = null;

View File

@@ -50,7 +50,7 @@ public enum Weapon{
Effects.effect("shoot2", p.x + vector.x, p.y+vector.y);
}
},
flamethrower(5, BulletType.flame, "Shoots a stream of fire.", stack(Item.steel, 60), stack(Item.coal, 60)){
flamer(5, BulletType.flame, "Shoots a stream of fire.", stack(Item.steel, 60), stack(Item.coal, 60)){
{
shootsound = "flame2";
@@ -65,12 +65,7 @@ public enum Weapon{
bullet(p, p.x, p.y, ang + Mathf.range(12));
}
},
//TODO
railgun(40, BulletType.sniper, "Shoots a stream of fire.", stack(Item.steel, 60), stack(Item.coal, 60)){
{
shootsound = "flame2";
}
railgun(40, BulletType.sniper, "Shoots one long-range bullet.", stack(Item.steel, 60), stack(Item.iron, 60)){
@Override
public void shoot(Player p){
@@ -79,12 +74,7 @@ public enum Weapon{
bullet(p, p.x, p.y, ang);
}
},
//TODO
mortar(20, BulletType.shell, "Shoots a stream of fire.", stack(Item.steel, 60), stack(Item.coal, 60)){
{
shootsound = "flame2";
}
mortar(100, BulletType.shell, "Shoots a slow, but damaging shell.", stack(Item.titanium, 40), stack(Item.steel, 60)){
@Override
public void shoot(Player p){

View File

@@ -12,7 +12,6 @@ import io.anuke.mindustry.resource.Weapon;
import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.function.Listenable;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.*;
import io.anuke.ucore.scene.ui.layout.Table;
@@ -35,10 +34,10 @@ public class UpgradeDialog extends Dialog{
getButtonTable().addButton("Ok", ()->{
hide();
}).size(84, 48).pad(4);
}).size(96, 50).pad(5);
Table weptab = new Table();
weptab.background("button");
//weptab.background("button");
weptab.pad(20);
int i = 0;
@@ -46,23 +45,22 @@ public class UpgradeDialog extends Dialog{
TextButton button = new TextButton(weapon.name());
Image img = new Image(Draw.region(weapon.name()));
button.add(img).size(14*4);
button.add(img).size(8*5);
button.getCells().reverse();
button.row();
button.pad(14);
button.getLabelCell().left();
button.pack();
button.update(()->{
if(control.hasWeapon(weapon)){
button.setDisabled(true);
button.setColor(Color.GRAY);
button.setTouchable(Touchable.disabled);
}else{
button.setColor(Color.WHITE);
button.setDisabled(false);
}else if(!Inventory.hasItems(weapon.requirements)){
button.setDisabled(true);
}
button.setDisabled(!Inventory.hasItems(weapon.requirements));
});
if(i > 0 && (i)%2==0)
@@ -70,7 +68,7 @@ public class UpgradeDialog extends Dialog{
i++;
weptab.add(button).width(210);
weptab.add(button).width(250);
Table tiptable = new Table();
@@ -79,28 +77,36 @@ public class UpgradeDialog extends Dialog{
String description = weapon.description;
tiptable.background("button");
tiptable.add("[PURPLE]" + weapon.name(), 0.75f).left().padBottom(2f);
tiptable.background("pane");
tiptable.add("[orange]" + weapon.name(), 0.5f).left().padBottom(4f);
Table reqtable = new Table();
tiptable.row();
tiptable.add(reqtable).left();
if(!control.hasWeapon(weapon)){
ItemStack[] req = weapon.requirements;
for(ItemStack s : req){
tiptable.row();
int amount = Math.min(Inventory.getAmount(s.item), s.amount);
tiptable.add(
(amount >= s.amount ? "[YELLOW]" : "[RED]")
+s.item + ": " + amount + " / " +s.amount, 0.5f).left();
reqtable.addImage(Draw.region("icon-" + s.item.name())).padRight(3).size(8*2);
reqtable.add(
(amount >= s.amount ? "" : "[RED]")
+ amount + " / " +s.amount, 0.5f).left();
reqtable.row();
}
}
tiptable.row();
tiptable.add().size(10);
tiptable.row();
tiptable.add("[ORANGE]" + description).left();
tiptable.add("[gray]" + description).left();
tiptable.row();
if(control.hasWeapon(weapon))
tiptable.add("[LIME]Purchased!").left();
tiptable.pad(10f);
if(control.hasWeapon(weapon)){
tiptable.add("[LIME]Purchased!").padTop(6).left();
}
tiptable.pad(14f);
};
run.listen();