win.align added
This commit is contained in:
parent
6d802759d2
commit
97ff78b954
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ instead (1.4.5) unstable; urgency=low
|
||||||
* bug fix in rnd() w/o parameter;
|
* bug fix in rnd() w/o parameter;
|
||||||
* callpush/callpop/cctx/strip moved to stead;
|
* callpush/callpop/cctx/strip moved to stead;
|
||||||
* bug fix in for_each;
|
* bug fix in for_each;
|
||||||
|
* win.align added to theme;
|
||||||
|
* theme_name added;
|
||||||
|
|
||||||
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jul 2011 16:18:00 +0400
|
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jul 2011 16:18:00 +0400
|
||||||
|
|
||||||
|
|
|
@ -551,7 +551,7 @@ int game_apply_theme(void)
|
||||||
if (!DIRECT_MODE)
|
if (!DIRECT_MODE)
|
||||||
game_clear(0, 0, game_theme.w, game_theme.h);
|
game_clear(0, 0, game_theme.w, game_theme.h);
|
||||||
gfx_flip();
|
gfx_flip();
|
||||||
lay = txt_layout(game_theme.font, ALIGN_JUSTIFY, game_theme.win_w, game_theme.win_h);
|
lay = txt_layout(game_theme.font, game_theme.win_align, game_theme.win_w, game_theme.win_h);
|
||||||
if (!lay)
|
if (!lay)
|
||||||
return -1;
|
return -1;
|
||||||
box = txt_box(game_theme.win_w, game_theme.win_h);
|
box = txt_box(game_theme.win_w, game_theme.win_h);
|
||||||
|
|
|
@ -580,7 +580,8 @@ static int luaB_theme_var(lua_State *L) {
|
||||||
|
|
||||||
static int luaB_theme_name(lua_State *L) {
|
static int luaB_theme_name(lua_State *L) {
|
||||||
if (game_own_theme && opt_owntheme)
|
if (game_own_theme && opt_owntheme)
|
||||||
return 0;
|
lua_pushstring(L, ".");
|
||||||
|
else
|
||||||
lua_pushstring(L, curtheme_dir);
|
lua_pushstring(L, curtheme_dir);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include "externals.h"
|
#include "externals.h"
|
||||||
#include "internals.h"
|
#include "internals.h"
|
||||||
|
|
||||||
|
@ -6,6 +5,22 @@ int theme_relative = 0;
|
||||||
|
|
||||||
char *curtheme_dir = NULL;
|
char *curtheme_dir = NULL;
|
||||||
|
|
||||||
|
static int parse_win_align(const char *v, void *data)
|
||||||
|
{
|
||||||
|
int *i = (int *)data;
|
||||||
|
if (!strcmp(v, "left"))
|
||||||
|
*i = ALIGN_LEFT;
|
||||||
|
else if (!strcmp(v, "justify"))
|
||||||
|
*i = ALIGN_JUSTIFY;
|
||||||
|
else if (!strcmp(v, "center"))
|
||||||
|
*i = ALIGN_CENTER;
|
||||||
|
else if (!strcmp(v, "right"))
|
||||||
|
*i = ALIGN_RIGHT;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int parse_gfx_mode(const char *v, void *data)
|
static int parse_gfx_mode(const char *v, void *data)
|
||||||
{
|
{
|
||||||
int *i = (int *)data;
|
int *i = (int *)data;
|
||||||
|
@ -149,6 +164,7 @@ struct parser cmd_parser[] = {
|
||||||
{ "scr.gfx.h", parse_int, &game_theme.max_scene_h },
|
{ "scr.gfx.h", parse_int, &game_theme.max_scene_h },
|
||||||
{ "scr.gfx.mode", parse_gfx_mode, &game_theme.gfx_mode },
|
{ "scr.gfx.mode", parse_gfx_mode, &game_theme.gfx_mode },
|
||||||
|
|
||||||
|
{ "win.align", parse_win_align, &game_theme.win_align },
|
||||||
{ "win.x", parse_int, &game_theme.win_x },
|
{ "win.x", parse_int, &game_theme.win_x },
|
||||||
{ "win.y", parse_int, &game_theme.win_y },
|
{ "win.y", parse_int, &game_theme.win_y },
|
||||||
{ "win.w", parse_int, &game_theme.win_w },
|
{ "win.w", parse_int, &game_theme.win_w },
|
||||||
|
@ -296,6 +312,7 @@ struct game_theme game_theme = {
|
||||||
.menu_font = NULL,
|
.menu_font = NULL,
|
||||||
.menu_button_name = NULL,
|
.menu_button_name = NULL,
|
||||||
.menu_button = NULL,
|
.menu_button = NULL,
|
||||||
|
.win_align = ALIGN_JUSTIFY,
|
||||||
.gfx_mode = GFX_MODE_EMBEDDED,
|
.gfx_mode = GFX_MODE_EMBEDDED,
|
||||||
.inv_mode = INV_MODE_VERT | INV_ALIGN_SET(ALIGN_LEFT),
|
.inv_mode = INV_MODE_VERT | INV_ALIGN_SET(ALIGN_LEFT),
|
||||||
.click_name = NULL,
|
.click_name = NULL,
|
||||||
|
|
|
@ -27,6 +27,7 @@ struct game_theme {
|
||||||
img_t cursor;
|
img_t cursor;
|
||||||
int pad;
|
int pad;
|
||||||
|
|
||||||
|
int win_align;
|
||||||
int win_x;
|
int win_x;
|
||||||
int win_y;
|
int win_y;
|
||||||
int win_w;
|
int win_w;
|
||||||
|
|
|
@ -19,6 +19,7 @@ scr.gfx.cursor.use = cursor-use.png
|
||||||
scr.gfx.pad = 16
|
scr.gfx.pad = 16
|
||||||
scr.gfx.mode = embedded
|
scr.gfx.mode = embedded
|
||||||
|
|
||||||
|
win.align = justify
|
||||||
win.x = 48
|
win.x = 48
|
||||||
win.y = 8
|
win.y = 8
|
||||||
win.w = 500
|
win.w = 500
|
||||||
|
@ -50,7 +51,7 @@ inv.gfx.down = adown.png
|
||||||
inv.col.fg = #CCCCCC
|
inv.col.fg = #CCCCCC
|
||||||
inv.col.link = #CCCCCC
|
inv.col.link = #CCCCCC
|
||||||
inv.col.alink = goldenrod
|
inv.col.alink = goldenrod
|
||||||
inv.mode = vertical
|
inv.mode = vertical-left
|
||||||
inv.up.x = -1
|
inv.up.x = -1
|
||||||
inv.up.y = -1
|
inv.up.y = -1
|
||||||
inv.down.x = -1
|
inv.down.x = -1
|
||||||
|
|
Reference in a new issue