Commit cafa1b5b authored by Aloshi's avatar Aloshi

Fixed dpad_all.svg.

Added "DebugText" setting that causes TextComponents to draw a background of their size + the area of their TextCache.
It can be toggled with Ctrl-T when running with --debug.
Added std::cout output when specifying overriding home path.
parent 9acfda6e
This diff is collapsed.
......@@ -2,25 +2,52 @@
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="_x30_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="37.061px" height="37.06px" viewBox="0 0 37.061 37.06" enable-background="new 0 0 37.061 37.06" xml:space="preserve">
width="37.061px" height="37.061px" viewBox="0 0 37.061 37.061" enable-background="new 0 0 37.061 37.061" xml:space="preserve">
<g>
<g>
<g>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-miterlimit="10" d="M33.939,12.604h-9.482V3.121
c0,0,0-2.371-2.371-2.371h-7.111c0,0-2.369,0-2.369,2.371v9.482H3.121c0,0-2.371,0-2.371,2.37v7.111c0,0,0,2.371,2.371,2.371
h9.484v9.482c0,0,0,2.371,2.369,2.371h7.111c0,0,2.371,0,2.371-2.371v-9.482h9.482c0,0,2.371,0,2.371-2.371v-7.111
C36.311,14.974,36.311,12.604,33.939,12.604z"/>
<g>
<path fill="#777777" d="M22.085,37.058h-7.111c-2.289,0-3.119-1.866-3.119-3.121v-8.732H3.121C0.831,25.205,0,23.339,0,22.084
v-7.11c0-2.289,1.867-3.12,3.121-3.12h8.734V3.121c0-2.29,1.865-3.121,3.119-3.121h7.111c2.29,0,3.121,1.867,3.121,3.121v8.733
h8.731c1.201,0,2.154,0.525,2.684,1.48c0.207,0.375,0.456,1.112,0.429,1.639h0.008v7.11c0,2.29-1.866,3.121-3.121,3.121h-8.731
v8.732C25.206,36.227,23.34,37.058,22.085,37.058z M3.121,13.353C2.745,13.359,1.5,13.492,1.5,14.973v7.11
c0.006,0.376,0.139,1.621,1.621,1.621h10.233v10.232c0.005,0.376,0.139,1.621,1.619,1.621h7.108
c0.384-0.006,1.624-0.142,1.624-1.621V23.705h10.231c0.376-0.006,1.621-0.14,1.621-1.621v-7.121
c-0.005-0.287-0.112-1.609-1.62-1.609H23.707V3.121C23.701,2.745,23.568,1.5,22.086,1.5h-7.111
c-0.376,0.006-1.619,0.139-1.619,1.621v10.232H3.121z"/>
</g>
</g>
</g>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-miterlimit="10" d="M18.531,21.431c1.602,0,2.9-1.299,2.9-2.901
c0-1.602-1.299-2.9-2.9-2.9c-1.604,0-2.9,1.299-2.9,2.9C15.631,20.132,16.928,21.431,18.531,21.431z"/>
<path fill="#777777" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M18.53,3.183
l-3.005,4.684h6.011L18.53,3.183z"/>
<path fill="#777777" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M3.125,18.53
l4.684,3.004v-6.01L3.125,18.53z"/>
<path fill="#777777" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M33.879,18.529
l-4.684-3.005v6.01L33.879,18.529z"/>
<path fill="#777777" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M18.53,33.876
l3.006-4.684h-6.011L18.53,33.876z"/>
<g>
<path fill="#777777" d="M18.531,22.181c-2.012,0-3.649-1.638-3.649-3.651c0-2.013,1.637-3.65,3.649-3.65
c2.013,0,3.65,1.638,3.65,3.65C22.181,20.544,20.543,22.181,18.531,22.181z M18.531,16.38c-1.185,0-2.149,0.965-2.149,2.15
c0,1.187,0.964,2.151,2.149,2.151c1.186,0,2.15-0.965,2.15-2.151C20.681,17.344,19.716,16.38,18.531,16.38z"/>
</g>
<g>
<path fill="#777777" d="M18.53,3.183l-3.005,4.684h6.012L18.53,3.183z"/>
<path fill="#777777" d="M21.536,8.617h-6.012c-0.274,0-0.526-0.15-0.658-0.39c-0.131-0.241-0.121-0.534,0.027-0.765l3.005-4.684
c0.276-0.431,0.987-0.43,1.262,0l3.007,4.684c0.148,0.231,0.159,0.524,0.027,0.765C22.063,8.467,21.811,8.617,21.536,8.617z
M16.897,7.117h3.267L18.53,4.572L16.897,7.117z"/>
</g>
<g>
<path fill="#777777" d="M3.125,18.53l4.684,3.004v-6.01L3.125,18.53z"/>
<path fill="#777777" d="M7.809,22.284c-0.141,0-0.282-0.04-0.405-0.119L2.72,19.161c-0.215-0.137-0.345-0.375-0.345-0.631
s0.13-0.493,0.345-0.631l4.684-3.006c0.23-0.147,0.524-0.159,0.765-0.027c0.24,0.131,0.39,0.384,0.39,0.658v6.01
c0,0.274-0.149,0.526-0.39,0.658C8.056,22.254,7.932,22.284,7.809,22.284z M4.514,18.53l2.545,1.632v-3.265L4.514,18.53z"/>
</g>
<g>
<path fill="#777777" d="M33.879,18.529l-4.685-3.005v6.01L33.879,18.529z"/>
<path fill="#777777" d="M29.195,22.284c-0.124,0-0.247-0.03-0.359-0.092c-0.241-0.132-0.391-0.384-0.391-0.658v-6.01
c0-0.274,0.149-0.526,0.391-0.658c0.239-0.132,0.532-0.123,0.765,0.027l4.685,3.005c0.215,0.138,0.345,0.376,0.345,0.631
s-0.13,0.493-0.345,0.631L29.6,22.165C29.477,22.244,29.335,22.284,29.195,22.284z M29.945,16.896v3.266l2.546-1.633
L29.945,16.896z"/>
</g>
<g>
<path fill="#777777" d="M18.53,33.876l3.007-4.684h-6.012L18.53,33.876z"/>
<path fill="#777777" d="M18.53,34.626L18.53,34.626c-0.255,0-0.493-0.13-0.631-0.345l-3.005-4.684
c-0.148-0.231-0.158-0.524-0.027-0.765c0.132-0.241,0.384-0.391,0.658-0.391h6.012c0.274,0,0.526,0.149,0.658,0.391
c0.132,0.24,0.121,0.534-0.027,0.765l-3.007,4.684C19.023,34.496,18.785,34.626,18.53,34.626z M16.897,29.942l1.633,2.545
l1.634-2.545H16.897z"/>
</g>
</g>
</svg>
......@@ -38,6 +38,7 @@ void Settings::setDefaults()
mBoolMap["Debug"] = false;
mBoolMap["DebugGrid"] = false;
mBoolMap["DebugText"] = false;
mIntMap["DimTime"] = 120*1000;
mIntMap["ScraperResizeWidth"] = 400;
......
......@@ -106,9 +106,15 @@ void Window::input(InputConfig* config, Input input)
{
if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_g && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
{
// toggle debug grid
// toggle debug grid with Ctrl-G
Settings::getInstance()->setBool("DebugGrid", !Settings::getInstance()->getBool("DebugGrid"));
}else if(config->isMappedTo("mastervolup", input))
}
else if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_t && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
{
// toggle TextComponent debug view with Ctrl-T
Settings::getInstance()->setBool("DebugText", !Settings::getInstance()->getBool("DebugText"));
}
else if(config->isMappedTo("mastervolup", input))
{
VolumeControl::getInstance()->setVolume(VolumeControl::getInstance()->getVolume() + 5);
}
......
......@@ -4,6 +4,7 @@
#include "../Window.h"
#include "../ThemeData.h"
#include "../Util.h"
#include "../Settings.h"
TextComponent::TextComponent(Window* window) : GuiComponent(window),
mFont(Font::get(FONT_SIZE_MEDIUM)), mColor(0x000000FF), mAutoCalcExtent(true, true), mAlignment(ALIGN_LEFT)
......@@ -91,9 +92,21 @@ void TextComponent::render(const Eigen::Affine3f& parentTrans)
break;
}
if(Settings::getInstance()->getBool("DebugText"))
{
// draw the "textbox" area, what we are aligned within
Renderer::setMatrix(trans);
Renderer::drawRect(0.f, 0.f, mSize.x(), mSize.y(), 0xFF000033);
}
trans.translate(off);
trans = roundMatrix(trans);
Renderer::setMatrix(trans);
// draw the text area, where the text actually is going
if(Settings::getInstance()->getBool("DebugText"))
Renderer::drawRect(0.0f, 0.0f, mTextCache->metrics.size.x(), mTextCache->metrics.size.y(), 0x00000033);
mFont->renderTextCache(mTextCache.get());
}
......@@ -179,7 +192,7 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, const st
setAlignment(ALIGN_LEFT);
else if(str == "center")
setAlignment(ALIGN_CENTER);
else if(str == "ALIGN_RIGHT")
else if(str == "right")
setAlignment(ALIGN_RIGHT);
else
LOG(LogError) << "Unknown text alignment string: " << str;
......
#include "platform.h"
#include <stdlib.h>
#include <boost/filesystem.hpp>
#include <iostream>
std::string sHomePathOverride;
......@@ -8,6 +9,8 @@ void setHomePathOverride(const std::string& path)
{
// make it use generic directory separators
sHomePathOverride = boost::filesystem::path(path).generic_string();
std::cout << "Using home path: " << sHomePathOverride;
}
std::string getHomePath()
......
......@@ -88,7 +88,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
for(unsigned int i = 0; i < labels.size(); i++)
{
labels[i]->applyTheme(theme, getName(), lblElements[i], ALL ^ ThemeFlags::TEXT);
labels[i]->applyTheme(theme, getName(), lblElements[i], ALL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment