demo:
Infomanii - Din pasiune pentru jocuri !
uiscript/exchangedialog.py
Infomanii - Din pasiune pentru jocuri !
Cod:
CommonDefines / service.h GAME SOURCE
//adauga
#define _EXTENDED_EXCHANGE_PLAYERS
exchange.cpp
//cauta
m_pGrid = M2_NEW CGrid(4,3);
//modifica
#ifdef _EXTENDED_EXCHANGE_PLAYERS
m_pGrid = M2_NEW CGrid(10,10);
#else
m_pGrid = M2_NEW CGrid(4,3);
#endif
exchange.h
//cauta
EXCHANGE_ITEM_MAX_NUM = 12,
//modifica
#ifdef _EXTENDED_EXCHANGE_PLAYERS
EXCHANGE_ITEM_MAX_NUM = 100,
#else
EXCHANGE_ITEM_MAX_NUM = 12,
#endif
locale_inc.h CLIENT SOURCE
//adauga
#define _EXTENDED_EXCHANGE_PLAYERS
PythonApplicationModule.cpp'de
//inainte de ultimul '}'adauga
#ifdef _EXTENDED_EXCHANGE_PLAYERS
PyModule_AddIntConstant(poModule, "_EXTENDED_EXCHANGE_PLAYERS", 1);
#else
PyModule_AddIntConstant(poModule, "_EXTENDED_EXCHANGE_PLAYERS", 0);
#endif
PythonExchange.h
//cauta
EXCHANGE_ITEM_MAX_NUM = 12,
//modifica
#ifdef _EXTENDED_EXCHANGE_PLAYERS
EXCHANGE_ITEM_MAX_NUM = 100,
#else
EXCHANGE_ITEM_MAX_NUM = 12,
#endif
Cod:
import uiScriptLocale
ROOT = "d:/ymir work/ui/game/"
window = {
"name" : "ExchangeDialog",
"x" : 0,
"y" : 0,
"style" : ("movable", "float",),
"width" : 687,
"height" : 410,
"children" :
(
{
"name" : "board",
"type" : "board",
"style" : ("attach",),
"x" : 0,
"y" : 0,
"width" : 687,
"height" : 410,
"children" :
(
## Title
{
"name" : "TitleBar",
"type" : "titlebar",
"style" : ("attach",),
"x" : 8,
"y" : 8,
"width" : 665,
"color" : "gray",
"children" :
(
{ "name":"TitleName", "type":"text", "x":333, "y":3, "text":uiScriptLocale.EXCHANGE_TITLE, "text_horizontal_align":"center" },
),
},
## MiddleBar
{
"name" : "Middle_Bar",
"type" : "image",
"x" : 350,
"y" : 78,
"image" : ROOT + "windows/middlebar.sub",
},
## Owner
{
"name" : "Owner",
"type" : "window",
"x" : 350,
"y" : 33,
"width" : 350, # ANCHURA DEFAULT 200
"height" : 375, # ALTURA DEFAULT 150
"children" :
(
{
"name" : "Owner_Slot",
"type" : "grid_table",
"start_index" : 0,
"x" : 0,
"y" : 0,
"x_count" : 10,
"y_count" : 10,
"x_step" : 32,
"y_step" : 32,
"x_blank" : 0,
"y_blank" : 0,
"image" : "d:/ymir work/ui/public/slot_base.sub",
},
{
"name" : "Owner_Money",
"type" : "button",
"x" : 0,
"y" : 340,
#"image" : "d:/ymir work/ui/public/parameter_slot_02.sub",
"default_image" : "d:/ymir work/ui/public/parameter_slot_02.sub",
"over_image" : "d:/ymir work/ui/public/parameter_slot_02.sub",
"down_image" : "d:/ymir work/ui/public/parameter_slot_02.sub",
"children" :
(
{
"name" : "Owner_Money_Value",
"type" : "text",
"x" : 59,
"y" : 2,
"text" : "1234567",
"text_horizontal_align" : "right",
},
),
},
{
"name" : "Owner_Accept_Light",
"type" : "button",
"x" : 62, # default 62
"y" : 341, # default 135
"default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub",
"over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub",
"down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub",
},
{
"name" : "Owner_Accept_Button",
"type" : "toggle_button",
"x" : 85, # default 85
"y" : 341, # default 135
"text" : uiScriptLocale.EXCHANGE_ACCEPT,
"default_image" : "d:/ymir work/ui/public/small_button_01.sub",
"over_image" : "d:/ymir work/ui/public/small_button_02.sub",
"down_image" : "d:/ymir work/ui/public/small_button_03.sub",
},
),
},
## Target
{
"name" : "Target",
"type" : "window",
"x" : 18,
"y" : 33,
"width" : 350, # ANCHURA DEFAULT 200
"height" : 375, # ALTURA DEFAULT 150
"children" :
(
{
"name" : "Target_Slot",
"type" : "grid_table",
"start_index" : 0,
"x" : 0,
"y" : 0,
"x_count" : 10, # ANCHURA
"y_count" : 10, # ALTURA
"x_step" : 32,
"y_step" : 32,
"x_blank" : 0,
"y_blank" : 0,
"image" : "d:/ymir work/ui/public/slot_base.sub",
},
{
"name" : "Target_Money",
"type" : "image",
"x" : 0,
"y" : 340, # default 135
"image" : "d:/ymir work/ui/public/parameter_slot_02.sub",
"children" :
(
{
"name" : "Target_Money_Value",
"type" : "text",
"x" : 59,
"y" : 2,
"text" : "1234567",
"text_horizontal_align" : "right",
},
),
},
{
"name" : "Target_Accept_Light",
"type" : "button",
"x" : 62, # default 62
"y" : 341, # default 135
"default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub",
"over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub",
"down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub",
},
),
},
),
},
),
}