J :
* Add support for key icons in the keybinding menu
This commit is contained in:
@@ -438,9 +438,13 @@ void OptionKey::Render(){
|
|||||||
JRenderer * renderer = JRenderer::GetInstance();
|
JRenderer * renderer = JRenderer::GetInstance();
|
||||||
|
|
||||||
const KeyRep& rep = translateKey(from);
|
const KeyRep& rep = translateKey(from);
|
||||||
if (NULL == rep.icon)
|
if (rep.icon)
|
||||||
|
renderer->RenderQuad(rep.icon, x + 2, y + 2);
|
||||||
|
else
|
||||||
mFont->DrawString(rep.text, x + 4, y + 2, JGETEXT_LEFT);
|
mFont->DrawString(rep.text, x + 4, y + 2, JGETEXT_LEFT);
|
||||||
const KeyRep& rep2 = translateKey(to);
|
const KeyRep& rep2 = translateKey(to);
|
||||||
if (NULL == rep2.icon)
|
if (rep2.icon)
|
||||||
|
renderer->RenderQuad(rep2.icon, x + 2, y + 2);
|
||||||
|
else
|
||||||
mFont->DrawString(rep2.text, width - 4, y + 2, JGETEXT_RIGHT);
|
mFont->DrawString(rep2.text, width - 4, y + 2, JGETEXT_RIGHT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include "../include/Translate.h"
|
#include "../include/Translate.h"
|
||||||
|
#include "../include/WResourceManager.h"
|
||||||
#include "../include/TranslateKeys.h"
|
#include "../include/TranslateKeys.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
@@ -34,6 +35,10 @@ const KeyRep& translateKey(LocalKeySym key) {
|
|||||||
if ((res = fattable.find(key)) != fattable.end())
|
if ((res = fattable.find(key)) != fattable.end())
|
||||||
return *(res->second);
|
return *(res->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Here goes PSP button-to-image code :
|
||||||
|
// k->icon = resources.RetrieveQuad("iconspsp.png", (float)4*32, 0, 32, 32, "", RETRIEVE_NORMAL);
|
||||||
|
|
||||||
char* str = new char[11];
|
char* str = new char[11];
|
||||||
sprintf(str, "%d", key);
|
sprintf(str, "%d", key);
|
||||||
KeyRep* k = new KeyRep(NULL, str);
|
KeyRep* k = new KeyRep(NULL, str);
|
||||||
|
|||||||
Reference in New Issue
Block a user