|
5 | 5 | #include <stdexcept> |
6 | 6 | #include <cmath> |
7 | 7 |
|
| 8 | +#include "Config.h" |
8 | 9 | #include "GameBoard.h" |
9 | 10 | #include "GameController.h" |
10 | 11 | #include "Renderer.h" |
@@ -135,9 +136,9 @@ void GameView::render() { |
135 | 136 | highlightPoint(it); |
136 | 137 | } |
137 | 138 |
|
138 | | - auto font = "resources/ComicNeue-Bold.ttf"; |
139 | | - auto fontSize = 50; |
140 | | - |
| 139 | + auto font = getGraphicsConfig()["font.path"]; |
| 140 | + auto fontSize = getGraphicsConfig()["font.size"]; |
| 141 | + |
141 | 142 | glColor3d(1, 1, 1); |
142 | 143 | renderText(font, fontSize, {.2, .9}, {.8, 1}, "Settlers of Catan"); |
143 | 144 |
|
@@ -660,8 +661,8 @@ void DrawingGameVisitor::visit(DevelopmentCard& card) { |
660 | 661 | */ |
661 | 662 | TradingView::TradingView(Player& initiating, Player& receiving, std::function<bool(std::array<int, 5>, ScreenCoordinate)> trade, std::function<bool(ScreenCoordinate)> cancel, std::array<int, 5> initialOffer) : |
662 | 663 | ViewElement({{0.1, 0.1},{0.9, 0.9}}), initiating(initiating), receiving(receiving), |
663 | | - trade(std::bind(trade, std::ref(offer), std::placeholders::_1), {{0.7, 0.1}, {0.9, 0.2}}, "resources/ComicNeue-Bold.ttf", 50, "Trade"), |
664 | | - cancel(cancel, {{0.1, 0.1}, {0.3, 0.2}}, "resources/ComicNeue-Bold.ttf", 50, "Cancel"), |
| 664 | + trade(std::bind(trade, std::ref(offer), std::placeholders::_1), {{0.7, 0.1}, {0.9, 0.2}}, getGraphicsConfig()["font.path"], getGraphicsConfig()["font.size"], "Trade"), |
| 665 | + cancel(cancel, {{0.1, 0.1}, {0.3, 0.2}}, getGraphicsConfig()["font.path"], getGraphicsConfig()["font.size"], "Cancel"), |
665 | 666 | offer(initialOffer) { |
666 | 667 |
|
667 | 668 | } |
@@ -706,8 +707,8 @@ void TradingView::render() { |
706 | 707 | glVertex2f(topLeft.first, bottomRight.second); |
707 | 708 | glEnd(); |
708 | 709 |
|
709 | | - auto font = "resources/ComicNeue-Bold.ttf"; |
710 | | - auto fontSize = 50; |
| 710 | + auto font = getGraphicsConfig()["font.path"]; |
| 711 | + auto fontSize = getGraphicsConfig()["font.size"]; |
711 | 712 |
|
712 | 713 | std::string resources[] = {"Wood", "Brick", "Ore", "Wheat", "Wool"}; |
713 | 714 | for(int i = 0; i < 5; i++) { |
@@ -760,9 +761,10 @@ void ConfirmationDialogue::render(){ |
760 | 761 | glVertex2f(bottomRight.first, bottomRight.second); |
761 | 762 | glVertex2f(topLeft.first, bottomRight.second); |
762 | 763 | glEnd(); |
763 | | - |
764 | | - auto font = "resources/ComicNeue-Bold.ttf"; |
765 | | - auto fontSize = 50; |
| 764 | + |
| 765 | + auto font = getGraphicsConfig()["font.path"]; |
| 766 | + auto fontSize = getGraphicsConfig()["font.size"]; |
| 767 | + |
766 | 768 | float width = bottomRight.first - topLeft.first; |
767 | 769 | float height = bottomRight.second - topLeft.second; |
768 | 770 |
|
|
0 commit comments