mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
defaulting strength on wireless cards to max, because it's way too likely to forget setting the strength; also returning foreground and background color from gpu.get
This commit is contained in:
parent
53e96153f0
commit
1ec08922b4
@ -145,7 +145,14 @@ abstract class GraphicsCard extends ManagedComponent {
|
||||
def get(context: Context, args: Arguments): Array[AnyRef] = {
|
||||
val x = args.checkInteger(0) - 1
|
||||
val y = args.checkInteger(1) - 1
|
||||
screen(s => result(s.get(x, y)))
|
||||
screen(s => {
|
||||
val char = s.get(x, y)
|
||||
val color = s.color(y)(x)
|
||||
val depth = s.depth
|
||||
val foreground = PackedColor.unpackForeground(color, depth)
|
||||
val background = PackedColor.unpackBackground(color, depth)
|
||||
result(char, foreground, background)
|
||||
})
|
||||
}
|
||||
|
||||
def set(context: Context, args: Arguments): Array[AnyRef] = {
|
||||
|
@ -15,7 +15,7 @@ class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
|
||||
withConnector().
|
||||
create()
|
||||
|
||||
var strength = 0.0
|
||||
var strength = Settings.get.maxWirelessRange
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
@ -95,7 +95,9 @@ class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
|
||||
|
||||
override def load(nbt: NBTTagCompound) {
|
||||
super.load(nbt)
|
||||
strength = nbt.getDouble("strength") max 0 min Settings.get.maxWirelessRange
|
||||
if (nbt.hasKey("strength")) {
|
||||
strength = nbt.getDouble("strength") max 0 min Settings.get.maxWirelessRange
|
||||
}
|
||||
}
|
||||
|
||||
override def save(nbt: NBTTagCompound) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user