Update submodules, sort 'ls' output.

develop
Petr Mrázek 2012-02-21 15:21:50 +01:00
parent f8d0b83b0a
commit 0b9e849096
3 changed files with 24 additions and 6 deletions

@ -62,6 +62,7 @@ using namespace DFHack;
#include <stdlib.h> #include <stdlib.h>
#include <fstream> #include <fstream>
#include "tinythread.h" #include "tinythread.h"
#include <llex.h>
using namespace tthread; using namespace tthread;
using namespace df::enums; using namespace df::enums;
@ -363,6 +364,19 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue
"\n" "\n"
"plugins:\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 <sortable> out;
for(size_t i = 0; i < plug_mgr->size();i++) for(size_t i = 0; i < plug_mgr->size();i++)
{ {
const Plugin * plug = (plug_mgr->operator[](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++) for (size_t j = 0; j < plug->size();j++)
{ {
const PluginCommand & pcmd = (plug->operator[](j)); const PluginCommand & pcmd = (plug->operator[](j));
if (pcmd.isHotkeyCommand()) out.insert({pcmd.isHotkeyCommand(),pcmd.name,pcmd.description});
con.color(Console::COLOR_CYAN);
con.print(" %-22s- %s\n",pcmd.name.c_str(), pcmd.description.c_str());
con.reset_color();
} }
} }
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") else if(first == "plug")

@ -1 +1 @@
Subproject commit 2262aac5158e0ee8e940d19fc6620e571f064a1d Subproject commit 37844f572bb738606672e14c537949418e683aef

@ -1 +1 @@
Subproject commit b37199937ee7684da08ff36e6486ae2987d3bbb6 Subproject commit 852f0452d13578dccd9971518a3627cc29e8abf6