aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-07-03 19:27:05 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-07-03 19:27:05 -0400
commit791ebed6017b8846f8bd63c323c12a5c56fe14b9 (patch)
treefc67a26d4466187e9622215a5de98c5d7f00030e
parent71849171e90dc5c25e41e53c55569494a952678e (diff)
control save/load, tracking default config
-rw-r--r--brice.dat8
-rw-r--r--config/controls.dat6
-rw-r--r--src/ui_menu.cpp19
-rw-r--r--xml/!town.xml4
4 files changed, 19 insertions, 18 deletions
diff --git a/brice.dat b/brice.dat
index 2653f9c..3b090ad 100644
--- a/brice.dat
+++ b/brice.dat
@@ -1,7 +1,7 @@
3
-Slow
-1
-canJump
-0
canSprint
0
+canJump
+0
+Slow
+1
diff --git a/config/controls.dat b/config/controls.dat
new file mode 100644
index 0000000..679c014
--- /dev/null
+++ b/config/controls.dat
@@ -0,0 +1,6 @@
+119
+97
+100
+1073742049
+1073742048
+101
diff --git a/src/ui_menu.cpp b/src/ui_menu.cpp
index 2419ed2..ca830d8 100644
--- a/src/ui_menu.cpp
+++ b/src/ui_menu.cpp
@@ -63,12 +63,7 @@ void initControls(Menu *m)
for (const auto &l : cfg) {
z = static_cast<SDL_Keycode>(std::stoi(l));
setControl(i, z);
- std::cout<<"1\n";
- auto fs = sym2str(z);
- std::cout<<"2 " << i << "\n";
- std::cout<<m->items[i].button.text<<'\n';
- m->items[i++].button.text += fs;
- std::cout<<"3\n";
+ m->items[i++].button.text += sym2str(z);
}
}
@@ -175,12 +170,12 @@ namespace ui {
optionsMenu.parent = &pauseMenu;
// Create the controls menu
- controlsMenu.items.push_back(ui::menu::createButton({-450,300}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Left: ", nullptr));
- controlsMenu.items.back().button.func = [](){ setControlF(1, controlsMenu.items[0]); };
- controlsMenu.items.push_back(ui::menu::createButton({-450,200}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Right: ", nullptr));
- controlsMenu.items.back().button.func = [](){ setControlF(2, controlsMenu.items[1]); };
- controlsMenu.items.push_back(ui::menu::createButton({-450,100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Up: ", nullptr));
- controlsMenu.items.back().button.func = [](){ setControlF(0, controlsMenu.items[2]); };
+ controlsMenu.items.push_back(ui::menu::createButton({-450,300}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Up: ", nullptr));
+ controlsMenu.items.back().button.func = [](){ setControlF(0, controlsMenu.items[0]); };
+ controlsMenu.items.push_back(ui::menu::createButton({-450,200}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Left: ", nullptr));
+ controlsMenu.items.back().button.func = [](){ setControlF(1, controlsMenu.items[1]); };
+ controlsMenu.items.push_back(ui::menu::createButton({-450,100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Right: ", nullptr));
+ controlsMenu.items.back().button.func = [](){ setControlF(2, controlsMenu.items[2]); };
controlsMenu.items.push_back(ui::menu::createButton({-450,0}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Sprint: ", nullptr));
controlsMenu.items.back().button.func = [](){ setControlF(3, controlsMenu.items[3]); };
controlsMenu.items.push_back(ui::menu::createButton({-450,-100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Creep: ", nullptr));
diff --git a/xml/!town.xml b/xml/!town.xml
index e3a6a20..d9bed58 100644
--- a/xml/!town.xml
+++ b/xml/!town.xml
@@ -4,8 +4,8 @@
<generation type="Random" width="1600"/>
<time>6000</time>
<spawnx>-300</spawnx>
- <npc name="Sanc" hasDialog="true" health="1" x="34.877903" y="70.59893" dindex="0"/>
- <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-134.12997" y="69.999039" dindex="0"/>
+ <npc name="Sanc" hasDialog="true" health="1" x="647.35724" y="63.59906" dindex="0"/>
+ <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-228.03703" y="65.798965" dindex="0"/>
<structure type="1" spawnx="300" alive="1"/>
<structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
<chest alive="1"/>