mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-23 13:10:04 +07:00
Added support for blend mode color
This commit is contained in:
parent
bc33e691a0
commit
597835ab08
@ -280,6 +280,9 @@ public class MpqViewer extends Tool {
|
||||
VisSlider slFrameDuration;
|
||||
VisCheckBox cbDebugMode;
|
||||
VisSelectBox<BlendModes> sbBlendMode;
|
||||
VisImageButton btnBlendColor;
|
||||
final Color blendColor = Color.WHITE.cpy();
|
||||
Texture blendColorTexture;
|
||||
|
||||
// Page tab controls
|
||||
VisLabel lbPage;
|
||||
@ -815,6 +818,59 @@ public class MpqViewer extends Tool {
|
||||
setSelectedIndex(0);
|
||||
setDisabled(true); // disabled -- applied through animation
|
||||
}}).row();
|
||||
add(i18n("blendColor")).space(labelSpacing).growX();
|
||||
final int buttonSize = 22;
|
||||
if (blendColorTexture != null) blendColorTexture.dispose();
|
||||
Pixmap p = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
|
||||
try {
|
||||
p.drawPixel(0, 0, Color.rgba8888(blendColor));
|
||||
blendColorTexture = new Texture(p);
|
||||
} finally {
|
||||
p.dispose();
|
||||
}
|
||||
add(btnBlendColor = new VisImageButton(new VisImageButton.VisImageButtonStyle() {{
|
||||
imageUp =
|
||||
imageDown =
|
||||
imageOver =
|
||||
imageChecked =
|
||||
imageCheckedOver =
|
||||
imageDisabled = new TextureRegionDrawable(blendColorTexture) {{
|
||||
setMinSize(buttonSize, buttonSize);
|
||||
}};
|
||||
}}) {{
|
||||
addListener(new ClickListener(Input.Buttons.LEFT) {
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
ColorPicker cp = new ColorPicker(
|
||||
i18n("blendColor"),
|
||||
new ColorPickerAdapter() {
|
||||
@Override
|
||||
public void finished(Color newColor) {
|
||||
blendColor.set(newColor);
|
||||
if (blendColorTexture != null) blendColorTexture.dispose();
|
||||
Pixmap p = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
|
||||
try {
|
||||
p.drawPixel(0, 0, Color.rgba8888(blendColor));
|
||||
blendColorTexture = new Texture(p);
|
||||
getStyle().imageUp =
|
||||
getStyle().imageDown =
|
||||
getStyle().imageOver =
|
||||
getStyle().imageChecked =
|
||||
getStyle().imageCheckedOver =
|
||||
getStyle().imageDisabled = new TextureRegionDrawable(blendColorTexture) {{
|
||||
setMinSize(buttonSize, buttonSize);
|
||||
}};
|
||||
} finally {
|
||||
p.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
cp.setColor(blendColor);
|
||||
stage.addActor(cp.fadeIn());
|
||||
}
|
||||
});
|
||||
}}).left().row();
|
||||
}}).growX().row();
|
||||
add(new VisTable() {{
|
||||
align(topLeft);
|
||||
@ -1220,6 +1276,7 @@ public class MpqViewer extends Tool {
|
||||
|
||||
log.debug("disposing stage...");
|
||||
stage.dispose();
|
||||
blendColorTexture.dispose();
|
||||
|
||||
log.debug("disposing VisUI...");
|
||||
VisUI.dispose();
|
||||
@ -1882,8 +1939,8 @@ public class MpqViewer extends Tool {
|
||||
String palette = paletteList.getSelected();
|
||||
Riiablo.batch.setPalette(palettes.get(palette));
|
||||
log.debug("palette -> {}", palette);
|
||||
} else if (actor == sbBlendMode) {
|
||||
anim.getLayer(0).setBlendMode(sbBlendMode.getSelectedIndex());
|
||||
} else if (actor == sbBlendMode || actor == btnBlendColor) {
|
||||
anim.getLayer(0).setBlendMode(sbBlendMode.getSelectedIndex(), blendColor);
|
||||
/*} else if (actor == sbBlendMode) {
|
||||
int frame = delegate.getFrame();
|
||||
//if (pages != null) {
|
||||
|
@ -0,0 +1,48 @@
|
||||
mpq-viewer=MPQ Viewer
|
||||
mpq-viewer-with-file=MPQ Viewer - {0}
|
||||
menu-file=File
|
||||
menu-options=Options
|
||||
menu-open=Open
|
||||
menu-exit=Exit
|
||||
menu-check-files=Existing Files Only
|
||||
menu-custom-listfile=Use External Listfile
|
||||
address-hint=path...
|
||||
copy=Copy
|
||||
copy_as_path=Copy as Path
|
||||
paste=Paste
|
||||
filter-hint=filter...
|
||||
renderer-change-background=Background
|
||||
renderer-change-background-title=Background Color
|
||||
renderer-fullscreen=Toggle full screen
|
||||
renderer-center=Center Camera
|
||||
animation=Animation
|
||||
pages=Pages
|
||||
play-pause=Play/Pause
|
||||
first-frame=First Frame
|
||||
prev-frame=Previous Frame
|
||||
next-frame=Next Frame
|
||||
last-frame=Last Frame
|
||||
direction=Direction
|
||||
direction-label={0,number} / {1,number}
|
||||
frame=Frame
|
||||
frame-label={0,number} / {1,number}
|
||||
speed=Speed
|
||||
speed-label={0,number} delta
|
||||
blend=Blend
|
||||
blendColor=Blend Color
|
||||
debug-bounds=Debug Bounds
|
||||
page=Page
|
||||
page-label={0,number} / {1,number}
|
||||
palette=Palette
|
||||
cof=COF
|
||||
dcc=DCC
|
||||
dc6=DC6
|
||||
cof-name=Comp
|
||||
cof-component=Component
|
||||
cof-shadow=Shadow
|
||||
cof-selectable=Selectable
|
||||
cof-overrideTransLvl=Override Transparency
|
||||
cof-newTransLvl=New Transparency
|
||||
cof-weaponClass=Weapon Class
|
||||
triggers=Triggers
|
||||
layers=Layers
|
Loading…
Reference in New Issue
Block a user