#4487 but properly implemented

This commit is contained in:
Anuken
2021-01-31 19:44:29 -05:00
parent 919012608a
commit 2b17dbe390
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,5 @@
package mindustry.entities.comp;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
@ -22,7 +21,7 @@ abstract class VelComp implements Posc{
@Override
public void update(){
move(vel.x * Time.delta, vel.y * Time.delta);
vel.scl(Mathf.clamp(1f - drag * Time.delta));
vel.scl(Math.max(1f - drag * Time.delta, 0));
}
/** @return function to use for check solid state. if null, no checking is done. */

View File

@ -60,9 +60,9 @@ public class DatabaseDialog extends BaseDialog{
list.add(image).size(8 * 4).pad(3);
ClickListener listener = new ClickListener();
image.addListener(listener);
if(!Vars.mobile && unlocked(unlock)){
if(!mobile && unlocked(unlock)){
image.addListener(new HandCursorListener());
image.update(() -> image.color.lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta));
image.update(() -> image.color.lerp(!listener.isOver() ? Color.lightGray : Color.white, Mathf.clamp(0.4f * Time.delta)));
}
if(unlocked(unlock)){
@ -71,7 +71,7 @@ public class DatabaseDialog extends BaseDialog{
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
ui.showInfoFade("@copied");
}else{
Vars.ui.content.show(unlock);
ui.content.show(unlock);
}
});
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName)));