review changes
This commit is contained in:
parent
adf01db4bf
commit
bddad86674
@ -30,8 +30,7 @@ class SliderNode :SKNode {
|
||||
sliderLine.fillColor = SKColor.white
|
||||
sliderLine.zPosition = 4
|
||||
|
||||
|
||||
hiddenKnob = SliderKnob(circleOfRadius: 60)
|
||||
hiddenKnob = SliderKnob(circleOfRadius: 58 )
|
||||
hiddenKnob.min = position.x - width / 2
|
||||
hiddenKnob.max = position.x + width / 2
|
||||
hiddenKnob.fillColor = SKColor.red
|
||||
@ -52,7 +51,6 @@ class SliderNode :SKNode {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class SliderKnob: SKShapeNode {
|
||||
|
@ -53,11 +53,11 @@ class Modal: GKEntity{
|
||||
switch modaltype {
|
||||
case .BaseAttack:
|
||||
header = SKLabelNode(text: "Angriff")
|
||||
body = SKLabelNode(text: "Schicke \(unitCount / 2)\nEinheiten")
|
||||
body = SKLabelNode(text: "\(unitCount / 2) Einheiten")
|
||||
footer = SKLabelNode()
|
||||
case .BaseMoveOwnUnits:
|
||||
header = SKLabelNode(text: "Formation")
|
||||
body = SKLabelNode(text: "Sende \(unitCount / 2)\nEinheiten")
|
||||
body = SKLabelNode(text: "\(unitCount / 2) Einheiten")
|
||||
footer = SKLabelNode()
|
||||
case .PauseGame:
|
||||
header = SKLabelNode(text: "Pause")
|
||||
@ -71,7 +71,7 @@ class Modal: GKEntity{
|
||||
self.header.fontSize = 40
|
||||
self.header.zPosition = 5
|
||||
|
||||
self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 20)
|
||||
self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y + 15)
|
||||
self.body.numberOfLines = 2
|
||||
self.body.preferredMaxLayoutWidth = 390
|
||||
self.body.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.center
|
||||
@ -86,17 +86,14 @@ class Modal: GKEntity{
|
||||
|
||||
super.init()
|
||||
|
||||
switch modaltype{
|
||||
case .BaseAttack, .BaseMoveOwnUnits:
|
||||
let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden"
|
||||
addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 50)))
|
||||
addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 105), isEnabled: true, onButtonPress: {
|
||||
self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation!, gameScene: gameScene, collisionBase: collisionBase)
|
||||
EntityManager.gameEMInstance.removeModal()
|
||||
}))
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden"
|
||||
addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 15)))
|
||||
addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 95), isEnabled: true, onButtonPress: {
|
||||
self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation!, gameScene: gameScene, collisionBase: collisionBase)
|
||||
EntityManager.gameEMInstance.removeModal()
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
|
@ -120,7 +120,7 @@ class GameScene: SKScene{
|
||||
} else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount {
|
||||
GameScene.sendUnits -= 1
|
||||
}
|
||||
modal.body.text = "Schicke \(GameScene.sendUnits) Einheiten "
|
||||
modal.body.text = "\(GameScene.sendUnits) Einheiten "
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user