Cleanup
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ class App {
|
||||
public static var dragMaterial: MaterialSlot = null;
|
||||
public static var dragLayer: LayerSlot = null;
|
||||
public static var dragAsset: TAsset = null;
|
||||
public static var dragSwatch: TSwatch = null;
|
||||
public static var dragSwatch: TSwatchColor = null;
|
||||
public static var dragFile: String = null;
|
||||
public static var dragTint = 0xffffffff;
|
||||
public static var dragSize = -1;
|
||||
|
||||
@@ -62,7 +62,7 @@ class Context {
|
||||
public static var materialPreview = false; // Drawing material previews
|
||||
public static var savedCamera = Mat4.identity();
|
||||
|
||||
public static var swatch: TSwatch;
|
||||
public static var swatch: TSwatchColor;
|
||||
public static var materialIdPicked = 0;
|
||||
public static var uvxPicked = 0.0;
|
||||
public static var uvyPicked = 0.0;
|
||||
@@ -309,7 +309,7 @@ class Context {
|
||||
UIView2D.inst.hwnd.redraws = 2;
|
||||
}
|
||||
|
||||
public static function setSwatch(s: TSwatch) {
|
||||
public static function setSwatch(s: TSwatchColor) {
|
||||
swatch = s;
|
||||
App.notifyOnNextFrame(function() {
|
||||
MakeMaterial.parsePaintMaterial();
|
||||
|
||||
@@ -472,7 +472,7 @@ class Project {
|
||||
});
|
||||
}
|
||||
|
||||
public static function makeSwatch(base = 0xffffffff): TSwatch {
|
||||
public static function makeSwatch(base = 0xffffffff): TSwatchColor {
|
||||
return { base: base, opacity: 1.0, occlusion: 1.0, roughness: 0.0, metallic: 0.0, normal: 0xff8080ff, emission: 0.0, height: 0.0, subsurface: 0.0 };
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef TProjectFormat = {
|
||||
@:optional public var mesh_assets: Array<String>;
|
||||
@:optional public var atlas_objects: Array<Int>;
|
||||
@:optional public var atlas_names: Array<String>;
|
||||
@:optional public var swatches: Array<TSwatch>;
|
||||
@:optional public var swatches: Array<TSwatchColor>;
|
||||
@:optional public var is_bgra: Null<Bool>; // Swapped red and blue channels for layer textures
|
||||
@:optional public var packed_assets: Array<TPackedAsset>;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ typedef TPackedAsset = {
|
||||
public var bytes: haxe.io.Bytes;
|
||||
}
|
||||
|
||||
typedef TSwatch = {
|
||||
typedef TSwatchColor = {
|
||||
public var base: kha.Color;
|
||||
public var opacity: Float;
|
||||
public var occlusion: Float;
|
||||
|
||||
@@ -115,7 +115,11 @@ class TabSwatches {
|
||||
}
|
||||
}, 1 + add);
|
||||
}
|
||||
if (ui.isHovered) ui.tooltip(tr("Swatch"));
|
||||
if (ui.isHovered) {
|
||||
var val = untyped Project.raw.swatches[i].base;
|
||||
if (val < 0) val += untyped 4294967296;
|
||||
ui.tooltip("#" + untyped val.toString(16));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user