mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
The Piña Colada Song.
This commit is contained in:
parent
2c34bca1c1
commit
af6a275542
@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringEscapeUtils
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
import scala.io.Codec
|
||||
import scala.io.Source
|
||||
import scala.util.matching.Regex
|
||||
|
||||
class Settings(config: Config) {
|
||||
// ----------------------------------------------------------------------- //
|
||||
@ -362,7 +363,7 @@ object Settings {
|
||||
val out = new PrintWriter(file)
|
||||
out.write(config.root.render(renderSettings).lines.
|
||||
// Indent two spaces instead of four.
|
||||
map(line => """^(\s*)""".r.replaceAllIn(line, m => m.group(1).replace(" ", " "))).
|
||||
map(line => """^(\s*)""".r.replaceAllIn(line, m => Regex.quoteReplacement(m.group(1).replace(" ", " ")))).
|
||||
// Finalize the string.
|
||||
filter(_ != "").mkString(nl).
|
||||
// Newline after values.
|
||||
|
@ -13,6 +13,8 @@ import li.cil.oc.api.prefab
|
||||
import li.cil.oc.util.PackedColor
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
|
||||
import scala.util.matching.Regex
|
||||
|
||||
abstract class GraphicsCard extends prefab.ManagedEnvironment {
|
||||
override val node = Network.newNode(this, Visibility.Neighbors).
|
||||
withComponent("gpu").
|
||||
@ -290,7 +292,7 @@ abstract class GraphicsCard extends prefab.ManagedEnvironment {
|
||||
s.fill(0, 0, w, h, ' ')
|
||||
try {
|
||||
val wrapRegEx = s"(.{1,${math.max(1, w - 2)}})\\s".r
|
||||
val lines = wrapRegEx.replaceAllIn(Localization.localizeImmediately(machine.lastError).replace("\t", " ") + "\n", m => m.group(1) + "\n").lines.toArray
|
||||
val lines = wrapRegEx.replaceAllIn(Localization.localizeImmediately(machine.lastError).replace("\t", " ") + "\n", m => Regex.quoteReplacement(m.group(1) + "\n")).lines.toArray
|
||||
val firstRow = ((h - lines.length) / 2) max 2
|
||||
|
||||
val message = "Unrecoverable Error"
|
||||
|
Loading…
x
Reference in New Issue
Block a user