Original GSoC'08 keymapper now works.

Plans:
  - Make remap dialog less ugly
  - Port dialog to other resolutions and classic theme
  - Stop polluting config namespaces with keymap
  - Improve automapper
  - Add support to the engines and backends

svn-id: r40404
This commit is contained in:
Eugene Sandulenko 2009-05-09 22:36:57 +00:00
parent 8b813f02b8
commit 87fdc5d544
2 changed files with 18 additions and 8 deletions

View File

@ -80,6 +80,8 @@ void RemapDialog::open() {
keymapCount += _gameKeymaps->size();
}
debug(3, "keymaps: %d", keymapCount);
_keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount);
Keymapper::Domain::iterator it;
@ -125,14 +127,15 @@ void RemapDialog::reflowLayout() {
int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
int scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
int areaX = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.x");
int areaY = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.y");
int areaW = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.w");
int areaH = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.h");
int spacing = 10; //g_gui.xmlEval()->getVar("remap_spacing");
int labelWidth = 100; //g_gui.xmlEval()->getVar("remap_label_width");
int buttonWidth = 80; //g_gui.xmlEval()->getVar("remap_button_width");
int16 areaX, areaY;
uint16 areaW, areaH;
int spacing = g_gui.xmlEval()->getVar("Globals.KeyRemapper.Spacing");
int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.LabelWidth");
int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.ButtonWidth");
int colWidth = labelWidth + buttonWidth + spacing;
g_gui.xmlEval()->getWidgetData((const String&)String("KeyRemapper.KeymapArea"), areaX, areaY, areaW, areaH);
_colCount = (areaW - scrollbarWidth) / colWidth;
_rowCount = (areaH + spacing) / (buttonHeight + spacing);
if (_colCount <= 0 || _rowCount <= 0)

View File

@ -45,6 +45,10 @@
<def var = 'ScummSaveLoad.ExtInfo.Visible' value = '1'/>
<def var = 'KeyRemapper.Spacing' value = '10'/>
<def var = 'KeyRemapper.LabelWidth' value = '100'/>
<def var = 'KeyRemapper.ButtonWidth' value = '80'/>
<widget name = 'OptionsLabel'
size = '110, Globals.Line.Height'
/>
@ -712,8 +716,11 @@
<layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'>
<widget name = 'Popup'
type = 'PopUp'
width = '600'
/>
<widget name = 'KeymapArea'
<widget name = 'KeymapArea'
width = '600'
height = '378'
/>
<widget name = 'Close'
type = 'Button'