Skip to content

Commit

Permalink
V6 Added franch traanslation
Browse files Browse the repository at this point in the history
  • Loading branch information
helloyanis committed Oct 25, 2023
1 parent 380a608 commit d0b4c15
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ captures/
.cxx/
*.apk
output.json
src/app/release/*

# IntelliJ
*.iml
Expand Down
4 changes: 2 additions & 2 deletions src/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "com.helloyanis.rucoycalculator"
minSdk = 24
targetSdk = 34
versionCode = 10
versionName = "5.1"
versionCode = 11
versionName = "6.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,47 +107,47 @@ class SkullFragment : Fragment() {
binding.root.findViewById<TextView>(R.id.mainstat).text = "❤️ "+String.format(
"%,.0f",
100+double*15
) + " HP\n🪄" + String.format(
) + " ${getString(R.string.hp)}\n🪄" + String.format(
"%,.0f",
100+double*20
)+ " MP\n💪 Level " + String.format("%,.0f", double) + " is at " + String.format("%,.0f", Formulas.exp_Calc(double)) + " exp!\n" +
"✨ You need " + String.format("%,.0f", (Formulas.exp_Calc(double + 1) - Formulas.exp_Calc(double))) + " experience to reach level " + String.format("%,.0f", double + 1) + "!"
)+ " ${getString(R.string.hp)}\n${getString(R.string.levelexp1)}" + String.format("%,.0f", double) + getString(R.string.levelexp2) + String.format("%,.0f", Formulas.exp_Calc(double)) + getString(R.string.levelexp3) +
getString(R.string.nextlevel1) + String.format("%,.0f", (Formulas.exp_Calc(double + 1) - Formulas.exp_Calc(double))) + getString(R.string.nextlevel2) + String.format("%,.0f", double + 1) + "!"

binding.root.findViewById<TextView>(R.id.whiteskullvalue).text = String.format(
"%,.0f",
double*150
) + "G needed\n" + String.format(
) + "${getString(R.string.skullGneeded)}\n" + String.format(
"%,.0f",
double*50
)+ "G lost from death by player."
)+ "${getString(R.string.skullGlost)}."
binding.root.findViewById<TextView>(R.id.yellowskullvalue).text = String.format(
"%,.0f",
double*150
) + "G needed\n" + String.format(
) + "${getString(R.string.skullGneeded)}\n" + String.format(
"%,.0f",
double*150
)+ "G lost from death by player."
)+ "${getString(R.string.skullGlost)}."
binding.root.findViewById<TextView>(R.id.orangeskullvalue).text = String.format(
"%,.0f",
double*600
) + "G needed\n" + String.format(
) + "${getString(R.string.skullGneeded)}\n" + String.format(
"%,.0f",
double*450
)+ "G lost from death by player."
)+ "${getString(R.string.skullGlost)}."
binding.root.findViewById<TextView>(R.id.redskullvalue).text = String.format(
"%,.0f",
double*1950
) + "G needed\n" + String.format(
) + "${getString(R.string.skullGneeded)}\n" + String.format(
"%,.0f",
double*1350
)+ "G lost from death by player."
)+ "${getString(R.string.skullGlost)}."
binding.root.findViewById<TextView>(R.id.blackskullvalue).text = String.format(
"%,.0f",
double*6000
) + "G needed\n" + String.format(
) + "${getString(R.string.skullGneeded)}\n" + String.format(
"%,.0f",
double*4050
)+ "G lost from death by player."
)+ "${getString(R.string.skullGlost)}."

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TrainFragment : Fragment() {


binding.tickhelp.setOnClickListener{
Toast.makeText(context,"It's how many mobs you can hit with 1 power attack!", Toast.LENGTH_LONG).show()
Toast.makeText(context,getString(R.string.tickrate_tooltip), Toast.LENGTH_LONG).show()
}
val trainstylespinner = binding.root.findViewById<Spinner>(R.id.trainstylespinner)
trainstylespinner.setOnItemSelectedListener(object : AdapterView.OnItemSelectedListener {
Expand Down Expand Up @@ -389,7 +389,7 @@ class TrainFragment : Fragment() {
val time: Double = time_to_kill_Calc(avgdmg, pos)
str0 = """
${
"👾 You can train effectively on " + mobs.get(pos).mob_name /*+ mobs.get(pos)
getString(R.string.traineffec) + mobs.get(pos).mob_name /*+ mobs.get(pos)
.getEmoji_code()*/
}!
Expand All @@ -398,15 +398,15 @@ class TrainFragment : Fragment() {
val time2: Double = time_to_kill_Calc(avgdmg, pos + 1)
str0 = """
${
"👾 You can train effectively on " + mobs.get(pos).mob_name /*+ mobs.get(pos)
getString(R.string.traineffec) + mobs.get(pos).mob_name /*+ mobs.get(pos)
.getEmoji_code()*/ + " & " + mobs.get(pos + 1).mob_name /*+ mobs.get(pos + 1)
.getEmoji_code()*/
}!
""".trimIndent()
str0+= """
${
"⏱️ Average time to kill " + mobs.get(pos + 1).mob_name /*+ mobs.get(pos + 1)
getString(R.string.averagetime) + mobs.get(pos + 1).mob_name /*+ mobs.get(pos + 1)
.getEmoji_code()*/
}: ${time2.toInt() / 60} min. ${time2.toInt() % 60} sec.
Expand Down Expand Up @@ -439,46 +439,46 @@ class TrainFragment : Fragment() {
)
if (new_max_damage >= 1 && !checked) { //if you can already deal damage to the next mob
str0+=
"💥 You can deal " + new_max_damage.toInt() + " max damage to " + mobs.get(
getString(R.string.youcandeal) + new_max_damage.toInt() + getString(R.string.maxdmg1) + mobs.get(
newpos
).mob_name /*+ mobs.get(newpos).getEmoji_code()*/ + "!\n" //part of output
alrdealdamage = true
} else if (new_max_damage > 1 && !alrdealdamage && !dealdamage) { //if you cant deal damage to the next mob yet, you can deal damage in a certain amount of stats!
str0 +=
"💥 You can deal " + new_max_damage.toInt() + " max damage to " + mobs.get(
getString(R.string.youcandeal) + new_max_damage.toInt() + getString(R.string.maxdmg2) + mobs.get(
newpos
).mob_name /*+ mobs.get(newpos)
.getEmoji_code()*/ + " in " + statadd + " stats!\n" //part of output
.getEmoji_code()*/ + getString(R.string.inXstats1) + statadd + getString(R.string.inXstats2) //part of output
dealdamage = true
}
checked = true
statadd++
}
if (checknextmob) {
str0+=
"""${"🔥 Max. Damage: " + max_damage.toInt() + " " /*+ */} Tickrate: ${tickrate.toInt()} / 3600
"""${getString(R.string.maxdmg1) + max_damage.toInt() + " " /*+ */} Tickrate: ${tickrate.toInt()} / 3600
"""
str0 += """
${
"⏱️ Average time to kill " + mobs.get(pos).mob_name /*+ mobs.get(pos)
getString(R.string.averagetime) + mobs.get(pos).mob_name /*+ mobs.get(pos)
.getEmoji_code()*/
}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
""".trimIndent()
str0 += """
${
"💪 You need $statadd stats to train effectively on " + mobs.get(newpos)
getString(R.string.youneednext1) + statadd +getString(R.string.youneednext2train) + mobs.get(newpos)
.mob_name /*+ mobs.get(newpos).getEmoji_code()*/
}!
""".trimIndent()
} else {
str0 +=
"""${"⏬ Min. Damage (Auto): " + min_damage.toInt() + " " /*+ slime_lord_emoji*/} ⏫ Max. Damage (Auto): ${max_damage.toInt()}
"""${getString(R.string.mindmgauto) + min_damage.toInt() + " " /*+ slime_lord_emoji*/}${getString(R.string.maxdmgauto)}${max_damage.toInt()}
"""
str0 += """
${
"⏱️ Average time to kill " + mobs.get(pos).mob_name /*+ mobs.get(pos)
getString(R.string.averagetime) + mobs.get(pos).mob_name /*+ mobs.get(pos)
.getEmoji_code()*/
}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
Expand All @@ -505,14 +505,14 @@ class TrainFragment : Fragment() {
if (classtype === 2) {
min_raw_damage = special_magic_min_raw_damage_Calc(stat1.toDouble(), weaponatk, base)
max_raw_damage = special_magic_max_raw_damage_Calc(stat1.toDouble(), weaponatk, base)
classEmoji = "Magic 🔥"
classEmoji = getString(R.string.magic)
} else {
min_raw_damage = special_meldist_min_raw_damage_Calc(stat1.toDouble(), weaponatk, base)
max_raw_damage = special_meldist_max_raw_damage_Calc(stat1.toDouble(), weaponatk, base)
classEmoji = if (classtype === 0) {
"Melee ⚔️"
getString(R.string.melee)
} else {
"Distance 🏹"
getString(R.string.distance)
}
}

Expand Down Expand Up @@ -549,7 +549,7 @@ class TrainFragment : Fragment() {

str0 =
"""
${"💪 You can power train " + classEmoji + " on " + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}!
${getString(R.string.ptraineffec1) + classEmoji + getString(R.string.ptraineffec2) + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}!
""".trimIndent()

Expand Down Expand Up @@ -601,11 +601,11 @@ class TrainFragment : Fragment() {
)
if (new_max_damage >= 1 && !checked) { //if you can already deal damage to the next mob
str0 +=
"💥 You can deal " + new_max_damage.toInt() + " max damage to " + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/ + "!" //part of output
getString(R.string.youcandeal) + new_max_damage.toInt() + getString(R.string.maxdmg2) + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/ + "!" //part of output
alrdealdamage = true
} else if (new_max_damage > 1 && !alrdealdamage && !dealdamage) { //if you cant deal damage to the next mob yet, you can deal damage in a certain amount of stats!
str0 +=
"🔥 You can deal " + new_max_damage.toInt() + " max damage to " + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/ + " in " + statadd + " stats!\n" //part of output
getString(R.string.youcandeal) + new_max_damage.toInt() + getString(R.string.maxdmg2) + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/ + getString(R.string.inXstats1) + statadd + getString(R.string.inXstats2) //part of output
dealdamage = true
}
checked = true
Expand All @@ -617,25 +617,25 @@ class TrainFragment : Fragment() {
//Building remaining Strings
if (checknextmob) {
str0 +=
"""${"⏫Max. Damage: " + max_damage.toInt() + ""} 💫 Tickrate: ${powertickrate.toInt()} / ${maxtickrate.toInt()}
"""${getString(R.string.maxdmg1) + max_damage.toInt() + ""}${getString(R.string.tickrate)}${powertickrate.toInt()} / ${maxtickrate.toInt()}
"""
str0 +=
"""
${"⏱️ Average time to kill " + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
${getString(R.string.averagetime) + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
""".trimIndent()
str0 +=
"""
${"⏏️ You need " + statadd + " stats to power train effectively on " + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/}!
${getString(R.string.youneednext1) + statadd + getString(R.string.youneednext2ptrain) + mobs[newpos].mob_name /*+ mobs[newpos].getEmoji_code()*/}!
""".trimIndent()
} else {
str0 +=
"""${"⏬ Min. Damage (Auto): " + min_damage.toInt() + ""} ⏫ Max. Damage (Auto): ${max_damage.toInt()}
"""${getString(R.string.maxdmgauto) + max_damage.toInt() + ""} ${getString(R.string.mindmgauto)} ${min_damage.toInt()}
"""
str0 +=
"""
${"⏱️ Average time to kill " + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
${getString(R.string.averagetime) + mobs[pos].mob_name /*+ mobs[pos].getEmoji_code()*/}: ${time.toInt() / 60} min. ${time.toInt() % 60} sec.
""".trimIndent()
}
Expand All @@ -658,7 +658,7 @@ class TrainFragment : Fragment() {
}
if (stat2 > 0 && hours <= 0) {
if (stat1 > stat2) {
binding.root.findViewById<TextView>(R.id.str0).text="Stat goal must be greater than your current stat"
binding.root.findViewById<TextView>(R.id.str0).text=getString(R.string.statgoaltoolow)
}else {
val ticks1: Double
val ticks2: Double
Expand All @@ -674,20 +674,20 @@ class TrainFragment : Fragment() {
}
val totalticks = ticks2 - ticks1
binding.root.findViewById<TextView>(R.id.str0).text =
"💫 You need approximately " + String.format(
getString(R.string.offlineoutput1) + String.format(
"%,.0f",
totalticks
) + " ticks until you reach stat level " + java.lang.String.format(
) + getString(R.string.offlineoutput2) + java.lang.String.format(
"%,.1f",
stat2
) + "!\n" +
"⏱️ This is around " + String.format(
getString(R.string.offlineoutput3) + String.format(
"%,.1f",
totalticks * 60 / 600
) + " minutes, or " + String.format(
) + getString(R.string.offlineoutput4) + String.format(
"%,.1f",
totalticks / 600
) + " hours of offline training at 600 exp/hr"
) + getString(R.string.offlineoutput5)
}
} else if (hours > 0 && stat2 <= 0) {
val tickstrained: Double = 600 * hours
Expand All @@ -701,14 +701,14 @@ class TrainFragment : Fragment() {
ticks2 = tickstrained + ticks1
val newStat = Math.round(100.0 * findStatLevel_Calc(ticks2)) / 100.0
if (newStat < 5) {
binding.root.findViewById<TextView>(R.id.str0).text="❌ Something went wrong: Could not find new stat!"
binding.root.findViewById<TextView>(R.id.str0).text=getString(R.string.offlineerror)
}

binding.root.findViewById<TextView>(R.id.str0).text=
"⏱️ Your new stat will be approximately: ${newStat.toInt()} with ${hours.toInt()} hours of offline training"
"${getString(R.string.offlinenewstat1)}${newStat.toInt()}${getString(R.string.offlinenewstat2)}${hours.toInt()} ${getString(R.string.offlineoutput5)}"

} else {
binding.root.findViewById<TextView>(R.id.str0).text="❗Please enter either hours OR stat goal"
binding.root.findViewById<TextView>(R.id.str0).text=getString(R.string.offlineinvalidinput)
}

}
Expand Down
18 changes: 5 additions & 13 deletions src/app/src/main/res/layout/train.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
android:layout_width="100dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/tickrate"
android:hint="@string/tick"
android:imeActionLabel="Test"
android:inputType="number"
android:text="4"
Expand Down Expand Up @@ -183,28 +183,20 @@
android:id="@+id/ticklabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tickrate"
android:text="@string/tick"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/weaponatk"
tools:visibility="visible" />

<View
android:id="@+id/divider"
android:layout_width="409dp"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
app:layout_constraintBottom_toTopOf="@+id/baselevellabel"
app:layout_constraintTop_toBottomOf="@+id/trainstylespinner"
tools:layout_editor_absoluteX="1dp" />

<View
android:id="@+id/divider2"
android:layout_width="409dp"
android:layout_height="1dp"
android:layout_marginBottom="12dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="58dp" />
app:layout_constraintBottom_toTopOf="@+id/baselevellabel"
app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Loading

0 comments on commit d0b4c15

Please sign in to comment.