mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-07 00:38:26 +07:00
#4487 but properly implemented
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
package mindustry.entities.comp;
|
package mindustry.entities.comp;
|
||||||
|
|
||||||
import arc.math.*;
|
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
@ -22,7 +21,7 @@ abstract class VelComp implements Posc{
|
|||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
move(vel.x * Time.delta, vel.y * Time.delta);
|
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. */
|
/** @return function to use for check solid state. if null, no checking is done. */
|
||||||
|
@ -60,9 +60,9 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
list.add(image).size(8 * 4).pad(3);
|
list.add(image).size(8 * 4).pad(3);
|
||||||
ClickListener listener = new ClickListener();
|
ClickListener listener = new ClickListener();
|
||||||
image.addListener(listener);
|
image.addListener(listener);
|
||||||
if(!Vars.mobile && unlocked(unlock)){
|
if(!mobile && unlocked(unlock)){
|
||||||
image.addListener(new HandCursorListener());
|
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)){
|
if(unlocked(unlock)){
|
||||||
@ -71,7 +71,7 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
|
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
|
||||||
ui.showInfoFade("@copied");
|
ui.showInfoFade("@copied");
|
||||||
}else{
|
}else{
|
||||||
Vars.ui.content.show(unlock);
|
ui.content.show(unlock);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName)));
|
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName)));
|
||||||
|
Reference in New Issue
Block a user