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