Skip to content

Commit

Permalink
added setting to disable robot label rendering, in case it annoys people
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke committed Mar 9, 2014
1 parent cbdb4f1 commit 09342e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/resources/assets/opencomputers/robot.names
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# explicitly named using an anvil.
# If your name is on this list and you'd rather it not be, or you'd like a
# different alias, sorry! Please make a pull request with the changed list.
asie
crafteverywhere
LordFokas
Michiyo
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ opencomputers {
# attached to it). For valid key names, please see the following list:
# https://github.com/LWJGL/lwjgl/blob/master/src/java/org/lwjgl/input/Keyboard.java#L73
pasteShortcut: [LSHIFT, INSERT]

# Render robots' names as a label above them when near them
robotLabels: true
}

# Computer related settings, concerns server performance and security.
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/li/cil/oc/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Settings(config: Config) {
val textLinearFiltering = config.getBoolean("client.textLinearFiltering")
val textAntiAlias = config.getBoolean("client.textAntiAlias")
val pasteShortcut = config.getStringList("client.pasteShortcut").toSet
val robotLabels = config.getBoolean("client.robotLabels")
val rTreeDebugRenderer = false // *Not* to be configurable via config file.

// ----------------------------------------------------------------------- //
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package li.cil.oc.client.renderer.tileentity

import java.util.logging.Level
import li.cil.oc.OpenComputers
import li.cil.oc.{Settings, OpenComputers}
import li.cil.oc.client.TexturePreloader
import li.cil.oc.common.tileentity
import li.cil.oc.util.RenderState
Expand Down Expand Up @@ -176,7 +176,7 @@ object RobotRenderer extends TileEntitySpecialRenderer {
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5)

val name = robot.name
if (name != null && x * x + y * y + z * z < RendererLivingEntity.NAME_TAG_RANGE) {
if (Settings.get.robotLabels && name != null && x * x + y * y + z * z < RendererLivingEntity.NAME_TAG_RANGE) {
GL11.glPushMatrix()

// This is pretty much copy-pasta from the entity's label renderer.
Expand Down

0 comments on commit 09342e9

Please sign in to comment.