showing number of connected components vs maximum number of components when using analyzer on computers

This commit is contained in:
Florian Nücke 2014-02-03 02:10:01 +01:00
parent e3db6d06b9
commit d24cd9c6bc
6 changed files with 9 additions and 3 deletions

View File

@ -175,12 +175,14 @@ abstract class Computer(isRemote: Boolean) extends Environment with ComponentInv
// ----------------------------------------------------------------------- //
def onAnalyze(player: EntityPlayer, side: Int, hitX: Float, hitY: Float, hitZ: Float) = {
if (computer != null) computer.lastError match {
computer.lastError match {
case Some(value) =>
player.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(
Settings.namespace + "gui.Analyzer.LastError", ChatMessageComponent.createFromTranslationKey(value)))
case _ =>
}
player.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(
Settings.namespace + "gui.Analyzer.Components", computer.componentCount + "/" + maxComponents))
val list = users
if (list.size > 0) {
player.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(

View File

@ -117,6 +117,8 @@ class Rack extends Hub with PowerBalancer with Inventory with Rotatable with Bun
Settings.namespace + "gui.Analyzer.LastError", ChatMessageComponent.createFromTranslationKey(value)))
case _ =>
}
player.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(
Settings.namespace + "gui.Analyzer.Components", computer.componentCount + "/" + servers(slot).get.maxComponents))
val list = computer.users
if (list.size > 0) {
player.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(

View File

@ -120,7 +120,7 @@ class Robot(isRemote: Boolean) extends Computer(isRemote) with ISidedInventory w
}
}
def maxComponents = 12
def maxComponents = 8
// ----------------------------------------------------------------------- //

View File

@ -79,7 +79,7 @@ class Machine(val owner: Machine.Owner) extends ManagedComponent with Context wi
private val cost = (if (isRobot) Settings.get.robotCost else Settings.get.computerCost) * Settings.get.tickFrequency
private def componentCount = components.count {
def componentCount = components.count {
case (_, name) => name != "filesystem"
} + addedComponents.count(_.name != "filesystem")

View File

@ -74,6 +74,7 @@ oc:item.WirelessNetworkCard.name=Drahtlosnetzwerkkarte
oc:gui.Analyzer.Address=§6Adresse§f: %s
oc:gui.Analyzer.ChargerSpeed=§6Ladegeschwindigkeit§f: %s
oc:gui.Analyzer.ComponentName=§6Komponentenname§f: %s
oc:gui.Analyzer.Components=§6Anzahl verbundener Komponenten§f: %s
oc:gui.Analyzer.LastError=§6Letzter Fehler§f: %s
oc:gui.Analyzer.RobotName=§6Name§f: %s
oc:gui.Analyzer.RobotOwner=§6Besitzer§f: %s

View File

@ -74,6 +74,7 @@ oc:item.WirelessNetworkCard.name=Wireless Network Card
oc:gui.Analyzer.Address=§6Address§f: %s
oc:gui.Analyzer.ChargerSpeed=§6Charge speed§f: %s
oc:gui.Analyzer.ComponentName=§6Component name§f: %s
oc:gui.Analyzer.Components=§6Number of connected components§f: %s
oc:gui.Analyzer.LastError=§6Last error§f: %s
oc:gui.Analyzer.RobotName=§6Name§f: %s
oc:gui.Analyzer.RobotOwner=§6Owner§f: %s