Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ca5443e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MISSION UPDATE // FLAGS" into main

parents 085eef0f 642017c9
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ android_app {
    },

    static_libs: [
        "easter_egg_flags_lib",

        "androidx.core_core",
        "androidx.annotation_annotation",
        "androidx.recyclerview_recyclerview",
@@ -72,3 +74,16 @@ android_app {

    kotlincflags: ["-Xjvm-default=all"],
}

java_aconfig_library {
    name: "easter_egg_flags_lib",
    aconfig_declarations: "easter_egg_flags",
}

aconfig_declarations {
    name: "easter_egg_flags",
    package: "com.android.egg.flags",
    srcs: [
        "easter_egg_flags.aconfig",
    ],
}
+8 −0
Original line number Diff line number Diff line
package: "com.android.egg.flags"

flag {
    name: "flag_flag"
    namespace: "systemui"
    description: "Flags are planted on planets when you land. Yes, it's a flag for flags."
    bug: "320150798"
}
+3 −1
Original line number Diff line number Diff line
@@ -174,7 +174,9 @@ open class Universe(val namer: Namer, randomSeed: Long) : Simulator(randomSeed)

        ship = Spacecraft()

        ship.pos = star.pos + Vec2.makeWithAngleMag(PIf / 4, PLANET_ORBIT_RANGE.start)
        // in the test universe, start the ship near the outermost planet
        ship.pos = planets.last().pos + Vec2(planets.first().radius * 1.5f, 0f)

        ship.angle = 0f
        add(ship)

+19 −2
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import androidx.core.math.MathUtils.clamp
import java.lang.Float.max
import kotlin.math.sqrt

import com.android.egg.flags.Flags.flagFlag

const val DRAW_ORBITS = true
const val DRAW_GRAVITATIONAL_FIELDS = true
const val DRAW_STAR_GRAVITATIONAL_FIELDS = true
@@ -279,8 +281,23 @@ fun ZoomedDrawScope.drawSpacecraft(ship: Spacecraft) {

fun ZoomedDrawScope.drawLanding(landing: Landing) {
    val v = landing.planet.pos + Vec2.makeWithAngleMag(landing.angle, landing.planet.radius)
    drawLine(Color.Red, v + Vec2(-5f, -5f), v + Vec2(5f, 5f), strokeWidth = 1f / zoom)
    drawLine(Color.Red, v + Vec2(5f, -5f), v + Vec2(-5f, 5f), strokeWidth = 1f / zoom)

    if (flagFlag()) {
        val strokeWidth = 2f / zoom
        val height = 80f
        rotateRad(landing.angle, pivot = v) {
            translate(v.x, v.y) {
                drawPath(
                    Path().apply {
                        moveTo(0f, 0f)
                        lineTo(height, 0f)
                        lineTo(height * 0.875f, height * 0.25f)
                        lineTo(height * 0.75f, 0f)
                        close()
                    }, Color.Yellow, style = Stroke(width = strokeWidth))
            }
        }
    }
}

fun ZoomedDrawScope.drawSpark(spark: Spark) {