diff --git a/src/com/reco1l/framework/net/FileRequest.kt b/src/com/reco1l/framework/net/FileRequest.kt index aac3307b6..54a5ea4d6 100644 --- a/src/com/reco1l/framework/net/FileRequest.kt +++ b/src/com/reco1l/framework/net/FileRequest.kt @@ -71,7 +71,7 @@ class FileRequest(val file: File, url: HttpUrl): WebRequest(url) { val elapsedMilliseconds = (System.currentTimeMillis() - startTime).toFloat() progress = totalBytes / length * 100 - speedKbps = (totalBytes / elapsedMilliseconds) / 1024f * 1000f + speedKbps = totalBytes / elapsedMilliseconds / 1024f * 1000f observer?.onDownloadUpdate(this) } diff --git a/src/com/reco1l/ibancho/data/RoomMods.kt b/src/com/reco1l/ibancho/data/RoomMods.kt index f50d4b82e..4d4d87b87 100644 --- a/src/com/reco1l/ibancho/data/RoomMods.kt +++ b/src/com/reco1l/ibancho/data/RoomMods.kt @@ -1,7 +1,7 @@ package com.reco1l.ibancho.data -import com.reco1l.osu.multiplayer.modsToReadable import com.reco1l.osu.multiplayer.Multiplayer +import com.reco1l.osu.multiplayer.modsToReadable import ru.nsu.ccfit.zuev.osu.game.mods.GameMod import ru.nsu.ccfit.zuev.osu.game.mods.GameMod.* import java.util.* @@ -73,9 +73,9 @@ data class RoomMods( // DoubleTime and NightCore, comparing them as one. && (MOD_DOUBLETIME in set || MOD_NIGHTCORE in set) == (MOD_DOUBLETIME in other.set || MOD_NIGHTCORE in other.set) // HalfTime - && (MOD_HALFTIME in set == MOD_HALFTIME in other.set) + && MOD_HALFTIME in set == MOD_HALFTIME in other.set // ScoreV2 - && (MOD_SCOREV2 in set == MOD_SCOREV2 in other.set) + && MOD_SCOREV2 in set == MOD_SCOREV2 in other.set || set == other.set diff --git a/src/com/reco1l/osu/multiplayer/RoomScene.kt b/src/com/reco1l/osu/multiplayer/RoomScene.kt index c4d2334a0..f4c623253 100644 --- a/src/com/reco1l/osu/multiplayer/RoomScene.kt +++ b/src/com/reco1l/osu/multiplayer/RoomScene.kt @@ -4,27 +4,13 @@ import android.app.AlertDialog import com.reco1l.ibancho.IPlayerEventListener import com.reco1l.ibancho.IRoomEventListener import com.reco1l.ibancho.RoomAPI -import com.reco1l.ibancho.data.PlayerStatus -import com.reco1l.ibancho.data.PlayerStatus.MISSING_BEATMAP -import com.reco1l.ibancho.data.PlayerStatus.NOT_READY -import com.reco1l.ibancho.data.PlayerStatus.PLAYING -import com.reco1l.ibancho.data.PlayerStatus.READY -import com.reco1l.ibancho.data.Room -import com.reco1l.ibancho.data.RoomBeatmap -import com.reco1l.ibancho.data.RoomGameplaySettings -import com.reco1l.ibancho.data.RoomMods -import com.reco1l.ibancho.data.RoomPlayer -import com.reco1l.ibancho.data.RoomTeam +import com.reco1l.ibancho.data.* +import com.reco1l.ibancho.data.PlayerStatus.* import com.reco1l.ibancho.data.RoomTeam.BLUE import com.reco1l.ibancho.data.RoomTeam.RED -import com.reco1l.ibancho.data.TeamMode import com.reco1l.ibancho.data.TeamMode.HEAD_TO_HEAD import com.reco1l.ibancho.data.TeamMode.TEAM_VS_TEAM -import com.reco1l.ibancho.data.WinCondition -import com.reco1l.ibancho.data.WinCondition.ACCURACY -import com.reco1l.ibancho.data.WinCondition.MAX_COMBO -import com.reco1l.ibancho.data.WinCondition.SCORE_V1 -import com.reco1l.ibancho.data.WinCondition.SCORE_V2 +import com.reco1l.ibancho.data.WinCondition.* import com.reco1l.osu.mainThread import com.reco1l.osu.multiplayer.Multiplayer.isConnected import com.reco1l.osu.multiplayer.Multiplayer.isRoomHost @@ -55,7 +41,7 @@ import ru.nsu.ccfit.zuev.osu.online.OnlinePanel import ru.nsu.ccfit.zuev.osu.scoring.Replay import ru.nsu.ccfit.zuev.skins.OsuSkin import java.text.SimpleDateFormat -import java.util.TimeZone +import java.util.* import ru.nsu.ccfit.zuev.osu.GlobalManager.getInstance as getGlobal import ru.nsu.ccfit.zuev.osu.LibraryManager.INSTANCE as library import ru.nsu.ccfit.zuev.osu.ResourceManager.getInstance as getResources @@ -423,7 +409,7 @@ object RoomScene : Scene(), IRoomEventListener, IPlayerEventListener layoutMods?.baseApply(it) it.setPosition(backButton!!.x + backButton!!.width, Config.getRES_HEIGHT() - it.heightScaled) } - else it.setPosition(backButton!!.x + backButton!!.width, (Config.getRES_HEIGHT() - 90f)) + else it.setPosition(backButton!!.x + backButton!!.width, Config.getRES_HEIGHT() - 90f) } // Difficulty switcher @@ -447,8 +433,8 @@ object RoomScene : Scene(), IRoomEventListener, IPlayerEventListener beatmapInfoRectangle?.isVisible = getGlobal().selectedTrack != null && !event.isActionUp && - event.x in it.x..(it.x + it.width) && - event.y in it.y..(it.y + it.height) + event.x in it.x..it.x + it.width && + event.y in it.y..it.y + it.height } return super.onSceneTouchEvent(event) @@ -468,7 +454,7 @@ object RoomScene : Scene(), IRoomEventListener, IPlayerEventListener val texture = if (path != null && !Config.isSafeBeatmapBg()) getResources().loadBackground(path) else getResources().getTexture("menu-background") - val height = texture.height * (Config.getRES_WIDTH() / texture.width.toFloat()) + val height = texture.height * Config.getRES_WIDTH() / texture.width.toFloat() val width = Config.getRES_WIDTH().toFloat() background = SpriteBackground(Sprite(0f, (Config.getRES_HEIGHT() - height) / 2f, width, height, texture)) diff --git a/src/com/reco1l/osu/ui/StatisticSelector.kt b/src/com/reco1l/osu/ui/StatisticSelector.kt index ed30e527a..89b462e4e 100644 --- a/src/com/reco1l/osu/ui/StatisticSelector.kt +++ b/src/com/reco1l/osu/ui/StatisticSelector.kt @@ -147,7 +147,7 @@ class StatisticSelector(stats: Array?) : ScrollableList(), ITouchAr } } - override fun contains(pX: Float, pY: Float): Boolean = pX in (570f .. 570f + 140f) + override fun contains(pX: Float, pY: Float): Boolean = pX in 570f .. 570f + 140f override fun onAreaTouched(event: TouchEvent?, x: Float, y: Float) = super.onSceneTouchEvent(event) }