From 0b9e849096c95d68c6235c266560a2fb58908151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 21 Feb 2012 15:21:50 +0100 Subject: [PATCH] Update submodules, sort 'ls' output. --- library/Core.cpp | 26 ++++++++++++++++++++++---- library/xml | 2 +- plugins/stonesense | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index 7576a2c7d..f8aed53af 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -62,6 +62,7 @@ using namespace DFHack; #include #include #include "tinythread.h" +#include using namespace tthread; using namespace df::enums; @@ -363,6 +364,19 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue "\n" "plugins:\n" ); + struct sortable + { + bool recolor; + string name; + string description; + bool operator <(const sortable & rhs) const + { + if( name < rhs.name ) + return true; + return false; + }; + }; + set out; for(size_t i = 0; i < plug_mgr->size();i++) { const Plugin * plug = (plug_mgr->operator[](i)); @@ -371,12 +385,16 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue for (size_t j = 0; j < plug->size();j++) { const PluginCommand & pcmd = (plug->operator[](j)); - if (pcmd.isHotkeyCommand()) - con.color(Console::COLOR_CYAN); - con.print(" %-22s- %s\n",pcmd.name.c_str(), pcmd.description.c_str()); - con.reset_color(); + out.insert({pcmd.isHotkeyCommand(),pcmd.name,pcmd.description}); } } + for(auto iter = out.begin();iter != out.end();iter++) + { + if ((*iter).recolor) + con.color(Console::COLOR_CYAN); + con.print(" %-22s- %s\n",(*iter).name.c_str(), (*iter).description.c_str()); + con.reset_color(); + } } } else if(first == "plug") diff --git a/library/xml b/library/xml index 2262aac51..37844f572 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 2262aac5158e0ee8e940d19fc6620e571f064a1d +Subproject commit 37844f572bb738606672e14c537949418e683aef diff --git a/plugins/stonesense b/plugins/stonesense index b37199937..852f0452d 160000 --- a/plugins/stonesense +++ b/plugins/stonesense @@ -1 +1 @@ -Subproject commit b37199937ee7684da08ff36e6486ae2987d3bbb6 +Subproject commit 852f0452d13578dccd9971518a3627cc29e8abf6