浏览代码

fix timer and background

Laserlicht 3 月之前
父节点
当前提交
2189b8a8b6
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 6 6
      client/battle/BattleWindow.cpp
  2. 6 0
      config/widgets/battleWindow2.json

+ 6 - 6
client/battle/BattleWindow.cpp

@@ -245,8 +245,8 @@ void BattleWindow::createTimerInfoWindows()
 {
 	OBJECT_CONSTRUCTION;
 
-	int xOffsetAttacker = quickSpellWindow->isDisabled() ? 0 : -53;
-	int xOffsetDefender = unitActionWindow->isDisabled() ? 0 : 53;
+	int xOffsetAttacker = quickSpellWindow->isDisabled() ? 0 : -51;
+	int xOffsetDefender = unitActionWindow->isDisabled() ? 0 : 51;
 
 	if(GAME->interface()->cb->getStartInfo()->turnTimerInfo.battleTimer != 0 || GAME->interface()->cb->getStartInfo()->turnTimerInfo.unitTimer != 0)
 	{
@@ -255,16 +255,16 @@ void BattleWindow::createTimerInfoWindows()
 
 		if (attacker.isValidPlayer())
 		{
-			if (ENGINE->screenDimensions().x >= 1000)
-				attackerTimerWidget = std::make_shared<TurnTimerWidget>(Point(-80 + xOffsetAttacker, 0), attacker);
+			if (ENGINE->screenDimensions().x >= 960)
+				attackerTimerWidget = std::make_shared<TurnTimerWidget>(Point(-76 + xOffsetAttacker, 0), attacker);
 			else
 				attackerTimerWidget = std::make_shared<TurnTimerWidget>(Point(1, 135), attacker);
 		}
 
 		if (defender.isValidPlayer())
 		{
-			if (ENGINE->screenDimensions().x >= 1000)
-				defenderTimerWidget = std::make_shared<TurnTimerWidget>(Point(pos.w + 4 + xOffsetDefender, 0), defender);
+			if (ENGINE->screenDimensions().x >= 960)
+				defenderTimerWidget = std::make_shared<TurnTimerWidget>(Point(pos.w + xOffsetDefender, 0), defender);
 			else
 				defenderTimerWidget = std::make_shared<TurnTimerWidget>(Point(pos.w - 78, 135), defender);
 		}

+ 6 - 0
config/widgets/battleWindow2.json

@@ -8,6 +8,12 @@
 			"position": {"x": 0, "y": 556},
 			"image": "COPLACBR.bmp"
 		},
+		{
+			// fix transparent gap between content and border
+			"type": "transparentFilledRectangle",
+			"rect": {"x": 0, "y": 555, "w": 801, "h": 46},
+			"color": [0, 0, 0, 255]
+		},
 		{
 			"type": "picture",
 			"name": "menuBattle",