Color cleanup
This commit is contained in:
@@ -140,7 +140,7 @@ public class ContentLoader{
|
||||
if(color == 0) continue;
|
||||
|
||||
Block block = block(i);
|
||||
Color.rgba8888ToColor(block.color, color);
|
||||
block.color.set(color);
|
||||
}
|
||||
}
|
||||
pixmap.dispose();
|
||||
|
||||
@@ -193,7 +193,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
|
||||
Core.settings.defaults(
|
||||
"ip", "localhost",
|
||||
"color-0", Color.rgba8888(playerColors[8]),
|
||||
"color-0", playerColors[8].rgba(),
|
||||
"name", "",
|
||||
"lastBuild", 0
|
||||
);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class NetClient implements ApplicationListener{
|
||||
c.mods = mods.getModStrings();
|
||||
c.mobile = mobile;
|
||||
c.versionType = Version.type;
|
||||
c.color = Color.rgba8888(player.color);
|
||||
c.color = player.color.rgba();
|
||||
c.usid = getUsid(packet.addressTCP);
|
||||
c.uuid = platform.getUUID();
|
||||
|
||||
|
||||
@@ -900,7 +900,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
||||
super.writeSave(buffer, !isLocal);
|
||||
TypeIO.writeStringData(buffer, name);
|
||||
buffer.writeByte(Pack.byteValue(isAdmin) | (Pack.byteValue(dead) << 1) | (Pack.byteValue(isBoosting) << 2) | (Pack.byteValue(isTyping) << 3)| (Pack.byteValue(isBuilding) << 4));
|
||||
buffer.writeInt(Color.rgba8888(color));
|
||||
buffer.writeInt(color.rgba());
|
||||
buffer.writeByte(mech.id);
|
||||
buffer.writeInt(mining == null ? noSpawner : mining.pos());
|
||||
buffer.writeInt(spawner == null || !spawner.hasUnit(this) ? noSpawner : spawner.getTile().pos());
|
||||
|
||||
@@ -75,7 +75,7 @@ public class MapIO{
|
||||
|
||||
Pixmap floors = new Pixmap(map.width, map.height, Format.RGBA8888);
|
||||
Pixmap walls = new Pixmap(map.width, map.height, Format.RGBA8888);
|
||||
int black = Color.rgba8888(Color.black);
|
||||
int black = 255;
|
||||
int shade = Color.rgba8888(0f, 0f, 0f, 0.5f);
|
||||
CachedTile tile = new CachedTile(){
|
||||
@Override
|
||||
@@ -148,7 +148,7 @@ public class MapIO{
|
||||
if(wall.synthetic()){
|
||||
return team.color.rgba();
|
||||
}
|
||||
return Color.rgba8888(wall.solid ? wall.color : ore == Blocks.air ? floor.color : ore.color);
|
||||
return (wall.solid ? wall.color : ore == Blocks.air ? floor.color : ore.color).rgba();
|
||||
}
|
||||
|
||||
/** Reads a pixmap in the 3.5 pixmap format. */
|
||||
@@ -164,7 +164,7 @@ public class MapIO{
|
||||
if(block.ore != null) tile.setOverlay(block.ore);
|
||||
|
||||
//place core
|
||||
if(color == Color.rgba8888(Color.green)){
|
||||
if(color == Color.green.rgba()){
|
||||
//actual core parts
|
||||
tile.setBlock(Blocks.coreShard);
|
||||
tile.setTeam(Team.sharded);
|
||||
|
||||
@@ -244,7 +244,7 @@ public class TypeIO{
|
||||
|
||||
@WriteClass(Color.class)
|
||||
public static void writeColor(ByteBuffer buffer, Color color){
|
||||
buffer.putInt(Color.rgba8888(color));
|
||||
buffer.putInt(color.rgba());
|
||||
}
|
||||
|
||||
@ReadClass(Color.class)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package mindustry.ui.dialogs;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.scene.ui.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
@@ -33,7 +32,7 @@ public class HostDialog extends FloatingDialog{
|
||||
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||
new PaletteDialog().show(color -> {
|
||||
player.color.set(color);
|
||||
Core.settings.put("color-0", Color.rgba8888(color));
|
||||
Core.settings.put("color-0", color.rgba());
|
||||
Core.settings.save();
|
||||
});
|
||||
}).size(54f).get();
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package mindustry.ui.dialogs;
|
||||
|
||||
import arc.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import arc.struct.*;
|
||||
import arc.graphics.*;
|
||||
import arc.input.*;
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.serialization.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
@@ -275,7 +274,7 @@ public class JoinDialog extends FloatingDialog{
|
||||
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||
new PaletteDialog().show(color -> {
|
||||
player.color.set(color);
|
||||
Core.settings.put("color-0", Color.rgba8888(color));
|
||||
Core.settings.put("color-0", color.rgba());
|
||||
Core.settings.save();
|
||||
});
|
||||
}).size(54f).get();
|
||||
|
||||
@@ -43,15 +43,15 @@ public class LegacyColorMapper implements ContentList{
|
||||
}
|
||||
|
||||
private void map(String color, Block block, Block wall, Block ore){
|
||||
blockMap.put(Color.rgba8888(Color.valueOf(color)), new LegacyBlock(block, wall, ore));
|
||||
blockMap.put(Color.valueOf(color).rgba(), new LegacyBlock(block, wall, ore));
|
||||
}
|
||||
|
||||
private void map(String color, Block block, Block wall){
|
||||
blockMap.put(Color.rgba8888(Color.valueOf(color)), new LegacyBlock(block, wall));
|
||||
blockMap.put(Color.valueOf(color).rgba(), new LegacyBlock(block, wall));
|
||||
}
|
||||
|
||||
private void map(String color, Block block){
|
||||
blockMap.put(Color.rgba8888(Color.valueOf(color)), new LegacyBlock(block, Blocks.air));
|
||||
blockMap.put(Color.valueOf(color).rgba(), new LegacyBlock(block, Blocks.air));
|
||||
}
|
||||
|
||||
public static class LegacyBlock{
|
||||
|
||||
Reference in New Issue
Block a user