diff --git a/data/fonts/sans-11px.png b/data/fonts/sans-11px.png new file mode 100644 index 00000000..3eb2285c Binary files /dev/null and b/data/fonts/sans-11px.png differ diff --git a/data/fonts/sans-11px.yml b/data/fonts/sans-11px.yml new file mode 100644 index 00000000..fdd3e311 --- /dev/null +++ b/data/fonts/sans-11px.yml @@ -0,0 +1,9 @@ +glyph height: 14 +glyph spacing: [0, 1] +top margin: 0 +image: sans-11px.png +image glyph size: [16, 16] +first glyph: 0 + +glyph widths: + 32: 4 diff --git a/data/fonts/tibia-10px-antialised.yml b/data/fonts/tibia-10px-antialised.yml index ba2c0db9..214a1763 100644 --- a/data/fonts/tibia-10px-antialised.yml +++ b/data/fonts/tibia-10px-antialised.yml @@ -3,6 +3,7 @@ glyph spacing: [1, 4] top margin: 3 image: tibia-10px-antialised.png image glyph size: [8, 16] +first glyph: 32 glyph widths: 32: 2 diff --git a/data/fonts/tibia-10px-monochrome.yml b/data/fonts/tibia-10px-monochrome.yml index 633bd429..6350825f 100644 --- a/data/fonts/tibia-10px-monochrome.yml +++ b/data/fonts/tibia-10px-monochrome.yml @@ -3,6 +3,7 @@ glyph spacing: [1, 1] top margin: 3 image: tibia-10px-monochrome.png image glyph size: [8, 16] +first glyph: 32 glyph widths: 32: 2 diff --git a/data/fonts/tibia-12px-rounded.yml b/data/fonts/tibia-12px-rounded.yml index 946050f6..1e974fd7 100644 --- a/data/fonts/tibia-12px-rounded.yml +++ b/data/fonts/tibia-12px-rounded.yml @@ -3,6 +3,7 @@ glyph spacing: [0, 1] top margin: 3 image: tibia-12px-rounded.png image glyph size: [16, 16] +first glyph: 32 glyph widths: 32: 4 diff --git a/data/fonts/tibia-8px-antialised.yml b/data/fonts/tibia-8px-antialised.yml index eada5645..d88a8a7d 100644 --- a/data/fonts/tibia-8px-antialised.yml +++ b/data/fonts/tibia-8px-antialised.yml @@ -3,6 +3,7 @@ glyph spacing: [0, 1] top margin: 1 image: tibia-8px-antialised.png image glyph size: [8, 8] +first glyph: 32 glyph widths: - 32: 2 \ No newline at end of file + 32: 2 diff --git a/data/modules/mainmenu/mainmenu.yml b/data/modules/mainmenu/mainmenu.yml index 970e1cba..c9474efe 100644 --- a/data/modules/mainmenu/mainmenu.yml +++ b/data/modules/mainmenu/mainmenu.yml @@ -1,8 +1,5 @@ panel#background: - skin: - image: background.png - antialised: true - size: [500, 500] + skin: mainMenuBackground anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top diff --git a/data/modules/mainmenu/optionswindow.yml b/data/modules/mainmenu/optionswindow.yml index 411cb564..3ef3f96c 100644 --- a/data/modules/mainmenu/optionswindow.yml +++ b/data/modules/mainmenu/optionswindow.yml @@ -1,5 +1,5 @@ window#optionsWindow: - title: Info + title: Options size: [286, 262] anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter diff --git a/data/modules/messagebox/messagebox.yml b/data/modules/messagebox/messagebox.yml index 81a04e47..dc8473c0 100644 --- a/data/modules/messagebox/messagebox.yml +++ b/data/modules/messagebox/messagebox.yml @@ -1,5 +1,5 @@ window#messageBoxWindow: - size: [236, 78] + size: [192, 78] anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter diff --git a/data/skins/lightness.yml b/data/skins/lightness.yml new file mode 100644 index 00000000..8186d8ef --- /dev/null +++ b/data/skins/lightness.yml @@ -0,0 +1,135 @@ +default font: sans-11px +default font color: [0, 115, 234, 255] + +buttons: + default: + default size: [96, 22] + font color: [0, 115, 234, 255] + + bordered image: + source: lightness/button-up.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] + + hover state: + font color: [255, 255, 255, 255] + bordered image: + source: lightness/button-hover.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] + + down state: + font color: [255, 0, 132, 255] + bordered image: + source: lightness/button-down.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] +panels: + default: + # the default panel is empty + + mainMenuBackground: + image: lightness/background.png + antialised: true + + roundedGridPanel: + bordered image: + source: lightness/menupanel.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] + + flatPanel: + bordered image: + source: lightness/panel.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] + +labels: + default: + font color: [0, 115, 234, 255] + +windows: + default: + font color: [80, 80, 80, 255] + head: + text align: left + margin: 8 + height: 26 + bordered image: + source: lightness/window.png + left border: [0,5,5,22] + right border: [251,5,5,22] + top border: [5,0,246,5] + bottom border: [5,27,246,5] + top left corner: [0,0,5,5] + top right corner: [251,0,5,5] + bottom left corner: [0,27,5,5] + bottom right corner: [251,27,5,5] + center: [5,5,246,22] + body: + bordered image: + source: lightness/window.png + left border: [0,32,2,222] + right border: [254,32,2,222] + bottom border: [2,254,252,2] + bottom left corner: [0,254,2,2] + bottom right corner: [254,254,2,2] + center: [2, 32, 92, 92] + +text edits: + default: + default size: [86, 20] + font color: [80, 80, 80, 255] + text margin: 3 + bordered image: + source: lightness/button-down.png + left border: [0,2,2,6] + right border: [22,2,2,6] + top border: [2,0,20,2] + bottom border: [2,8,20,2] + top left corner: [0,0,2,2] + top right corner: [22,0,2,2] + bottom left corner: [0,8,2,2] + bottom right corner: [22,8,2,2] + center: [2,2,20,6] + +line decorations: + default: + bordered image: + source: lightness/window.png + top border: [2,254,252,2] diff --git a/data/skins/lightness/background.png b/data/skins/lightness/background.png new file mode 100644 index 00000000..8ffebc34 Binary files /dev/null and b/data/skins/lightness/background.png differ diff --git a/data/skins/lightness/button-down.png b/data/skins/lightness/button-down.png new file mode 100644 index 00000000..78034074 Binary files /dev/null and b/data/skins/lightness/button-down.png differ diff --git a/data/skins/lightness/button-hover.png b/data/skins/lightness/button-hover.png new file mode 100644 index 00000000..f286f595 Binary files /dev/null and b/data/skins/lightness/button-hover.png differ diff --git a/data/skins/lightness/button-up.png b/data/skins/lightness/button-up.png new file mode 100644 index 00000000..0f82c2be Binary files /dev/null and b/data/skins/lightness/button-up.png differ diff --git a/data/skins/lightness/menupanel.png b/data/skins/lightness/menupanel.png new file mode 100644 index 00000000..a8138d43 Binary files /dev/null and b/data/skins/lightness/menupanel.png differ diff --git a/data/skins/lightness/panel.png b/data/skins/lightness/panel.png new file mode 100644 index 00000000..44f80777 Binary files /dev/null and b/data/skins/lightness/panel.png differ diff --git a/data/skins/lightness/window.png b/data/skins/lightness/window.png new file mode 100644 index 00000000..d9160cb0 Binary files /dev/null and b/data/skins/lightness/window.png differ diff --git a/data/skins/tibiaskin.yml b/data/skins/tibiaskin.yml index fae37292..99943c21 100644 --- a/data/skins/tibiaskin.yml +++ b/data/skins/tibiaskin.yml @@ -1,9 +1,11 @@ -default skin image: tibiaskin.png +default font: tibia-10px-antialised +default font color: [191, 191, 191, 255] +default texture: tibiaskin/skin.png buttons: default: font: tibia-8px-antialised - text color: [238, 238, 238, 255] + font color: [238, 238, 238, 255] default size: [86, 20] bordered image: @@ -33,6 +35,10 @@ panels: default: # the default panel is empty + mainMenuBackground: + image: tibiaskin/background.png + antialised: true + roundedGridPanel: bordered image: left border: [0,214,5,32] @@ -59,15 +65,12 @@ panels: labels: default: - font: tibia-10px-antialised - text color: [191, 191, 191, 255] windows: default: + font color: [143, 143, 143, 255] head: - text color: [143, 143, 143, 255] height: 17 - font: tibia-10px-antialised bordered image: left border: [106,187,4,9] right border: [110,187,4,9] @@ -90,7 +93,6 @@ windows: text edits: default: default size: [86, 16] - font: tibia-10px-antialised text margin: 3 bordered image: left border: [308,97,1,1] diff --git a/data/background.png b/data/skins/tibiaskin/background.png similarity index 100% rename from data/background.png rename to data/skins/tibiaskin/background.png diff --git a/data/skins/tibiaskin.png b/data/skins/tibiaskin/skin.png similarity index 100% rename from data/skins/tibiaskin.png rename to data/skins/tibiaskin/skin.png diff --git a/src/framework/constants.h b/src/framework/constants.h new file mode 100644 index 00000000..77b46f37 --- /dev/null +++ b/src/framework/constants.h @@ -0,0 +1,46 @@ +/* The MIT License + * + * Copyright (c) 2010 OTClient, https://github.com/edubart/otclient + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#ifndef CONSTANTS_H +#define CONSTANTS_H + +enum AlignmentFlag { + AlignLeft = 1, + AlignRight = 2, + AlignTop = 4, + AlignBottom = 8, + AlignHorizontalCenter = 16, + AlignVerticalCenter = 32, + AlignTopLeft = AlignTop | AlignLeft, + AlignTopRight = AlignTop | AlignRight, + AlignBottomLeft = AlignBottom | AlignLeft, + AlignBottomRight = AlignBottom | AlignRight, + AlignLeftCenter = AlignLeft | AlignVerticalCenter, + AlignRightCenter = AlignRight | AlignVerticalCenter, + AlignTopCenter = AlignTop | AlignHorizontalCenter, + AlignBottomCenter = AlignBottom | AlignHorizontalCenter, + AlignCenter = AlignVerticalCenter | AlignHorizontalCenter +}; + +#endif // CONSTANTS_H diff --git a/src/framework/core/configs.cpp b/src/framework/core/configs.cpp index f595fcae..64d59779 100644 --- a/src/framework/core/configs.cpp +++ b/src/framework/core/configs.cpp @@ -82,12 +82,12 @@ void Configs::setValue(const std::string &key, const char *value) void Configs::setValue(const std::string &key, int value) { - setValue(key, convertType(value)); + setValue(key, convert_cast(value)); } void Configs::setValue(const std::string &key, float value) { - setValue(key, convertType(value)); + setValue(key, convert_cast(value)); } void Configs::setValue(const std::string &key, bool value) @@ -116,7 +116,7 @@ float Configs::getFloat(const std::string &key) const flogWarning("WARNING: Config value %s not found", key.c_str()); return 0; } - return convertType(it->second); + return convert_cast(it->second); } bool Configs::getBoolean(const std::string &key) const @@ -136,5 +136,5 @@ int Configs::getInteger(const std::string &key) const flogWarning("WARNING: Config value %s not found", key.c_str()); return 0; } - return convertType(it->second); + return convert_cast(it->second); } diff --git a/src/framework/core/engine.cpp b/src/framework/core/engine.cpp index 618aad58..bbfce991 100644 --- a/src/framework/core/engine.cpp +++ b/src/framework/core/engine.cpp @@ -31,6 +31,7 @@ #include #include #include