Skip to content

Commit bd7aea8

Browse files
committed
Allow trailing spaces in names and leading spaces in values
1 parent f834ebd commit bd7aea8

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

resources/graphics.conf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Font settings
2-
font.path=resources/ComicNeue-Bold.ttf
3-
font.size=50
2+
font.path = resources/ComicNeue-Bold.ttf
3+
font.size = 50
44

55
# General window settings
6-
screen.width=1280
7-
screen.height=720
6+
screen.width = 1280
7+
screen.height = 720
88

99
# Trading view screen coordinates
10-
screen.tradingView.bottomLeft=(0.1,0.1)
11-
screen.tradingView.topRight=(0.9,0.9)
10+
screen.tradingView.bottomLeft = (0.1,0.1)
11+
screen.tradingView.topRight = (0.9,0.9)
1212

13-
screen.tradingView.tradeButton.bottomLeft=(0.7,0.1)
14-
screen.tradingView.tradeButton.topRight=(0.9,0.2)
13+
screen.tradingView.tradeButton.bottomLeft = (0.7,0.1)
14+
screen.tradingView.tradeButton.topRight = (0.9,0.2)
1515

16-
screen.tradingView.cancelButton.bottomLeft=(0.1,0.1)
17-
screen.tradingView.cancelButton.topRight=(0.3,0.2)
16+
screen.tradingView.cancelButton.bottomLeft = (0.1,0.1)
17+
screen.tradingView.cancelButton.topRight = (0.3,0.2)
1818

19-
screen.tradingView.resources.height=0.13
20-
screen.tradingView.resources.leftX=0.3
21-
screen.tradingView.resources.rightX=0.6
22-
screen.tradingView.resources.bottomY=0.2
19+
screen.tradingView.resources.height = 0.13
20+
screen.tradingView.resources.leftX = 0.3
21+
screen.tradingView.resources.rightX = 0.6
22+
screen.tradingView.resources.bottomY = 0.2
2323

24-
screen.tradingView.players.bottomLeft=(0.1,0.8)
25-
screen.tradingView.players.topRight=(0.9,0.9)
24+
screen.tradingView.players.bottomLeft = (0.1,0.8)
25+
screen.tradingView.players.topRight = (0.9,0.9)

src/Config.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ void Config::init(istream& source) {
114114
continue;
115115
}
116116
string name = line.substr(0, line.find('='));
117+
while(name[name.size()-1] == ' ' || name[name.size()-1] == '\t') {
118+
name = name.substr(0, name.size()-1);
119+
}
117120
string value = line.substr(line.find('=') + 1);
121+
while(value[0] == ' ' || value[0] == '\t') {
122+
value = value.substr(1);
123+
}
118124
values.insert(std::make_pair(name, ConfigValue(value)));
119125
}
120126
}

0 commit comments

Comments
 (0)