From 8b769255a0e4e3efc90d4e77893a9fdee28384bc Mon Sep 17 00:00:00 2001 From: skyjake Date: Sun, 12 May 2013 21:39:22 +0300 Subject: [PATCH] Client: Added the default UI style package Ultimately "defaultstyle.pack" will contain all the elements of the UI style, including images. --- doomsday/build/scripts/packres.py | 6 +++++ doomsday/client/data/defaultstyle.pack/Info | 4 ++++ .../client/data/defaultstyle.pack/fonts.dei | 23 +++++++++++++++++++ doomsday/client/src/ui/windowsystem.cpp | 8 ++++++- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 doomsday/client/data/defaultstyle.pack/Info create mode 100644 doomsday/client/data/defaultstyle.pack/fonts.dei diff --git a/doomsday/build/scripts/packres.py b/doomsday/build/scripts/packres.py index b9b0682ab2..b7489eec95 100755 --- a/doomsday/build/scripts/packres.py +++ b/doomsday/build/scripts/packres.py @@ -72,6 +72,12 @@ def process_dir(path, dest_path): ('client/data', 'data') ] ) p.create('doomsday.pk3') +# defaultstyle.pack +p = Pack() +p.add_files( + [ ('client/data/defaultstyle.pack', '') ] ) +p.create('defaultstyle.pack') + # libdoom.pk3 p = Pack() p.add_files( diff --git a/doomsday/client/data/defaultstyle.pack/Info b/doomsday/client/data/defaultstyle.pack/Info new file mode 100644 index 0000000000..f5b87897a1 --- /dev/null +++ b/doomsday/client/data/defaultstyle.pack/Info @@ -0,0 +1,4 @@ +# Default UI style for Doomsday. + +name: Doomsday Default UI Style +labels: style diff --git a/doomsday/client/data/defaultstyle.pack/fonts.dei b/doomsday/client/data/defaultstyle.pack/fonts.dei new file mode 100644 index 0000000000..897011ab9b --- /dev/null +++ b/doomsday/client/data/defaultstyle.pack/fonts.dei @@ -0,0 +1,23 @@ +# Fonts for the default UI style +# +# - size can be "pt" or "px", defaults to "pt" +# - weight: normal bold light +# - style: normal italic + +script { import Version, gui } + +group font { + condition: Version.OS == 'macx' + + font default { + family: Lucida Grande + size: 16pt + weight: normal + style: normal + } +} + +font "font.title" inherits font.default { + size $: gui.scale(__this__.size, 1.5) + weight: bold +} diff --git a/doomsday/client/src/ui/windowsystem.cpp b/doomsday/client/src/ui/windowsystem.cpp index a30440c626..e3bc0686fb 100644 --- a/doomsday/client/src/ui/windowsystem.cpp +++ b/doomsday/client/src/ui/windowsystem.cpp @@ -21,6 +21,8 @@ #include "ui/clientwindow.h" #include "clientapp.h" +#include + #include using namespace de; @@ -30,8 +32,12 @@ DENG2_PIMPL(WindowSystem) typedef QMap Windows; Windows windows; + FontBank fonts; + Instance(Public *i) : Base(i) - {} + { + fonts.readInfo(App::fileSystem().find("defaultstyle.pack/fonts.dei")); + } ~Instance() {