Guest User

createcharacterwindow.py

a guest
Mar 29th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.27 KB | None | 0 0
  1. import uiScriptLocale
  2. import app
  3.  
  4. ROOT_PATH = "d:/ymir work/ui/public/"
  5. LOCALE_PATH = "locale/en/ui/select/"
  6. BOARD_X = SCREEN_WIDTH * (65) / 800
  7. BOARD_Y = SCREEN_HEIGHT * (215) / 600
  8.  
  9. PLUS_BUTTON_WIDTH = 20
  10. TEMPORARY_HEIGHT = 24 + 5
  11.  
  12. window = {
  13.     "name" : "CreateCharacterWindow",
  14.  
  15.     "x" : 0,
  16.     "y" : 0,
  17.  
  18.     "width" : SCREEN_WIDTH,
  19.     "height" : SCREEN_HEIGHT,
  20.  
  21.     "children" :
  22.     (
  23.         ## Board
  24.         {
  25.             "name" : "BackGround", "type" : "expanded_image", "x" : 0, "y" : 0,
  26.             "x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0,
  27.             "image" : "locale/en/ui/select.sub",
  28.         },
  29.         ## Name
  30.         {
  31.             "name" : "name_warrior",
  32.             "type" : "image",
  33.  
  34.             "x" : BOARD_X - 27,
  35.             "y" : BOARD_Y - 174 + 25,
  36.  
  37.             "image" : LOCALE_PATH+"name_warrior.sub",
  38.         },
  39.         {
  40.             "name" : "name_assassin",
  41.             "type" : "image",
  42.  
  43.             "x" : BOARD_X - 27,
  44.             "y" : BOARD_Y - 174 + 25,
  45.  
  46.             "image" : LOCALE_PATH+"name_assassin.sub",
  47.         },
  48.         {
  49.             "name" : "name_sura",
  50.             "type" : "image",
  51.  
  52.             "x" : BOARD_X - 27,
  53.             "y" : BOARD_Y - 174 + 25,
  54.  
  55.             "image" : LOCALE_PATH+"name_sura.sub",
  56.         },
  57.         {
  58.             "name" : "name_shaman",
  59.             "type" : "image",
  60.  
  61.             "x" : BOARD_X - 27,
  62.             "y" : BOARD_Y - 174 + 25,
  63.  
  64.             "image" : LOCALE_PATH+"name_shaman.sub",
  65.         },
  66.         {
  67.             "name" : "name_wolfman",
  68.             "type" : "image",
  69.  
  70.             "x" : BOARD_X - 27,
  71.             "y" : BOARD_Y - 174 + 25,
  72.  
  73.             "image" : LOCALE_PATH+"name_wolfman.sub",
  74.         },
  75.  
  76.         ## Character Board
  77.         {
  78.             "name" : "character_board",
  79.             "type" : "thinboard",
  80.  
  81.             "x" : BOARD_X,
  82.             "y" : BOARD_Y,
  83.  
  84.             "width" : 208,
  85.             "height" : 300 + TEMPORARY_HEIGHT,
  86.  
  87.             "children" :
  88.             (
  89.                 {
  90.                     "name" : "text_board",
  91.                     "type" : "bar",
  92.  
  93.                     "x" : 8,
  94.                     "y" : 10,
  95.  
  96.                     "width" : 189,
  97.                     "height" : 122,
  98.  
  99.                     "children" :
  100.                     (
  101.                         {
  102.                             "name" : "prev_button",
  103.                             "type" : "button",
  104.  
  105.                             "x" : 95,
  106.                             "y" : 95,
  107.  
  108.                             "text" : uiScriptLocale.CREATE_PREV,
  109.  
  110.                             "default_image" : ROOT_PATH + "Small_Button_01.sub",
  111.                             "over_image" : ROOT_PATH + "Small_Button_02.sub",
  112.                             "down_image" : ROOT_PATH + "Small_Button_03.sub",
  113.                         },
  114.                         {
  115.                             "name" : "next_button",
  116.                             "type" : "button",
  117.  
  118.                             "x" : 140,
  119.                             "y" : 95,
  120.  
  121.                             "text" : uiScriptLocale.CREATE_NEXT,
  122.  
  123.                             "default_image" : ROOT_PATH + "Small_Button_01.sub",
  124.                             "over_image" : ROOT_PATH + "Small_Button_02.sub",
  125.                             "down_image" : ROOT_PATH + "Small_Button_03.sub",
  126.                         },
  127.                         {
  128.                             "name" : "right_line",
  129.                             "type" : "line",
  130.  
  131.                             "x" : 189-1,
  132.                             "y" : -1,
  133.  
  134.                             "width" : 0,
  135.                             "height" : 122,
  136.  
  137.                             "color" : 0xffAAA6A1,
  138.                         },
  139.                         {
  140.                             "name" : "bottom_line",
  141.                             "type" : "line",
  142.  
  143.                             "x" : 0,
  144.                             "y" : 122-1,
  145.  
  146.                             "width" : 189,
  147.                             "height" : 0,
  148.  
  149.                             "color" : 0xffAAA6A1,
  150.                         },
  151.                         {
  152.                             "name" : "left_line",
  153.                             "type" : "line",
  154.  
  155.                             "x" : 0,
  156.                             "y" : 0,
  157.  
  158.                             "width" : 0,
  159.                             "height" : 122-1,
  160.  
  161.                             "color" : 0xff2A2521,
  162.                         },
  163.                         {
  164.                             "name" : "top_line",
  165.                             "type" : "line",
  166.  
  167.                             "x" : 0,
  168.                             "y" : 0,
  169.  
  170.                             "width" : 189,
  171.                             "height" : 0,
  172.  
  173.                             "color" : 0xff2A2521,
  174.                         },
  175.                     ),
  176.                 },
  177.                 {
  178.                     "name" : "hth",
  179.                     "type" : "text",
  180.  
  181.                     "x" : 15,
  182.                     "y" : 138,
  183.  
  184.                     "text" : uiScriptLocale.CREATE_HP,
  185.  
  186.                     "children" :
  187.                     (
  188.                         {
  189.                             "name" : "hth_gauge",
  190.                             "type" : "gauge",
  191.  
  192.                             "x" : 30,
  193.                             "y" : 4,
  194.  
  195.                             "width" : 100 + PLUS_BUTTON_WIDTH,
  196.                             "color" : "red",
  197.                         },
  198.                         {
  199.                             "name" : "hth_slot",
  200.                             "type" : "slotbar",
  201.  
  202.                             "x" : 137 + PLUS_BUTTON_WIDTH,
  203.                             "y" : -1,
  204.                             "width" : 24,
  205.                             "height" : 16,
  206.  
  207.                             "children" :
  208.                             (
  209.                                 {
  210.                                     "name" : "hth_value",
  211.                                     "type" : "text",
  212.  
  213.                                     "x" : 0,
  214.                                     "y" : 1,
  215.                                     "all_align" : "center",
  216.  
  217.                                     "text" : "99",
  218.                                 },
  219.                             ),
  220.                         },
  221.                     ),
  222.                 },
  223.                 {
  224.                     "name" : "int",
  225.                     "type" : "text",
  226.  
  227.                     "x" : 15,
  228.                     "y" : 157,
  229.  
  230.                     "text" : uiScriptLocale.CREATE_SP,
  231.  
  232.                     "children" :
  233.                     (
  234.                         {
  235.                             "name" : "int_gauge",
  236.                             "type" : "gauge",
  237.  
  238.                             "x" : 30,
  239.                             "y" : 4,
  240.  
  241.                             "width" : 100 + PLUS_BUTTON_WIDTH,
  242.                             "color" : "pink",
  243.                         },
  244.                         {
  245.                             "name" : "int_slot",
  246.                             "type" : "slotbar",
  247.  
  248.                             "x" : 137 + PLUS_BUTTON_WIDTH,
  249.                             "y" : -1,
  250.                             "width" : 24,
  251.                             "height" : 16,
  252.  
  253.                             "children" :
  254.                             (
  255.                                 {
  256.                                     "name" : "int_value",
  257.                                     "type" : "text",
  258.  
  259.                                     "x" : 0,
  260.                                     "y" : 1,
  261.                                     "all_align" : "center",
  262.  
  263.                                     "text" : "99",
  264.                                 },
  265.                             ),
  266.                         },
  267.                     ),
  268.                 },
  269.                 {
  270.                     "name" : "str",
  271.                     "type" : "text",
  272.  
  273.                     "x" : 15,
  274.                     "y" : 176,
  275.  
  276.                     "text" : uiScriptLocale.CREATE_ATT_GRADE,
  277.  
  278.                     "children" :
  279.                     (
  280.                         {
  281.                             "name" : "str_gauge",
  282.                             "type" : "gauge",
  283.  
  284.                             "x" : 30,
  285.                             "y" : 4,
  286.  
  287.                             "width" : 100 + PLUS_BUTTON_WIDTH,
  288.                             "color" : "purple",
  289.                         },
  290.                         {
  291.                             "name" : "str_slot",
  292.                             "type" : "slotbar",
  293.  
  294.                             "x" : 137 + PLUS_BUTTON_WIDTH,
  295.                             "y" : -1,
  296.                             "width" : 24,
  297.                             "height" : 16,
  298.  
  299.                             "children" :
  300.                             (
  301.                                 {
  302.                                     "name" : "str_value",
  303.                                     "type" : "text",
  304.  
  305.                                     "x" : 0,
  306.                                     "y" : 1,
  307.                                     "all_align" : "center",
  308.  
  309.                                     "text" : "99",
  310.                                 },
  311.                             ),
  312.                             },
  313.                     ),
  314.                 },
  315.                 {
  316.                     "name" : "dex",
  317.                     "type" : "text",
  318.  
  319.                     "x" : 15,
  320.                     "y" : 195,
  321.  
  322.                     "text" : uiScriptLocale.CREATE_DEX_GRADE,
  323.  
  324.                     "children" :
  325.                     (
  326.                         {
  327.                             "name" : "dex_gauge",
  328.                             "type" : "gauge",
  329.  
  330.                             "x" : 30,
  331.                             "y" : 4,
  332.  
  333.                             "width" : 100 + PLUS_BUTTON_WIDTH,
  334.                             "color" : "blue",
  335.                         },
  336.                         {
  337.                             "name" : "dex_slot",
  338.                             "type" : "slotbar",
  339.  
  340.                             "x" : 137 + PLUS_BUTTON_WIDTH,
  341.                             "y" : -1,
  342.                             "width" : 24,
  343.                             "height" : 16,
  344.  
  345.                             "children" :
  346.                             (
  347.                                 {
  348.                                     "name" : "dex_value",
  349.                                     "type" : "text",
  350.  
  351.                                     "x" : 0,
  352.                                     "y" : 1,
  353.                                     "all_align" : "center",
  354.  
  355.                                     "text" : "99",
  356.                                 },
  357.                             ),
  358.                         },
  359.                     ),
  360.                 },
  361.  
  362.                 {
  363.                     "name" : "hth_button",
  364.                     "type" : "button",
  365.  
  366.                     "x" : 184,
  367.                     "y" : 139,
  368.  
  369.                     "default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
  370.                     "over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
  371.                     "down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
  372.                 },
  373.                 {
  374.                     "name" : "int_button",
  375.                     "type" : "button",
  376.  
  377.                     "x" : 184,
  378.                     "y" : 158,
  379.  
  380.                     "default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
  381.                     "over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
  382.                     "down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
  383.                 },
  384.                 {
  385.                     "name" : "str_button",
  386.                     "type" : "button",
  387.  
  388.                     "x" : 184,
  389.                     "y" : 177,
  390.  
  391.                     "default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
  392.                     "over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
  393.                     "down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
  394.                 },
  395.                 {
  396.                     "name" : "dex_button",
  397.                     "type" : "button",
  398.  
  399.                     "x" : 184,
  400.                     "y" : 196,
  401.  
  402.                     "default_image" : "d:/ymir work/ui/game/windows/btn_plus_up.sub",
  403.                     "over_image" : "d:/ymir work/ui/game/windows/btn_plus_over.sub",
  404.                     "down_image" : "d:/ymir work/ui/game/windows/btn_plus_down.sub",
  405.                 },
  406.  
  407.  
  408.                 {
  409.                     "name" : "character_name",
  410.                     "type" : "text",
  411.  
  412.                     "x" : 43,
  413.                     "y" : 218,
  414.  
  415.                     "text" : uiScriptLocale.CREATE_NAME,
  416.  
  417.                     "text_horizontal_align" : "center",
  418.  
  419.                     "children" :
  420.                     (
  421.                         {
  422.                             "name" : "character_name_slot",
  423.                             "type" : "image",
  424.  
  425.                             "x" : 40 - 1,
  426.                             "y" : -2,
  427.  
  428.                             "image" : "d:/ymir work/ui/public/parameter_slot_04.sub",
  429.                         },
  430.                         {
  431.                             "name" : "character_name_value",
  432.                             "type" : "editline",
  433.  
  434.                             "x" : 40 - 1 + 3,
  435.                             "y" : 0,
  436.  
  437.                             "input_limit" : 12,
  438.  
  439.                             "width" : 90,
  440.                             "height" : 20,
  441.                         },
  442.                     ),
  443.                 },
  444.  
  445.                 {
  446.                     "name" : "character_gender",
  447.                     "type" : "text",
  448.  
  449.                     "x" : 43,
  450.                     "y" : 247,
  451.  
  452.                     "text" : uiScriptLocale.CREATE_SEX,
  453.  
  454.                     "text_horizontal_align" : "center",
  455.                 },
  456.                 {
  457.                     "name" : "gender_button_01",
  458.                     "type" : "radio_button",
  459.  
  460.                     "x" : 79,
  461.                     "y" : 247,
  462.  
  463.                     "text" : uiScriptLocale.CREATE_MAN,
  464.  
  465.                     "default_image" : ROOT_PATH + "Middle_Button_01.sub",
  466.                     "over_image"    : ROOT_PATH + "Middle_Button_02.sub",
  467.                     "down_image"    : ROOT_PATH + "Middle_Button_03.sub",
  468.                 },
  469.                 {
  470.                     "name" : "gender_button_02",
  471.                     "type" : "radio_button",
  472.  
  473.                     "x" : 139,
  474.                     "y" : 247,
  475.  
  476.                     "text" : uiScriptLocale.CREATE_WOMAN,
  477.  
  478.                     "default_image" : ROOT_PATH + "Middle_Button_01.sub",
  479.                     "over_image"    : ROOT_PATH + "Middle_Button_02.sub",
  480.                     "down_image"    : ROOT_PATH + "Middle_Button_03.sub",
  481.                 },
  482.  
  483.                 {
  484.                     "name" : "character_shape",
  485.                     "type" : "text",
  486.  
  487.                     "x" : 43,
  488.                     "y" : 270,
  489.  
  490.                     "text" : uiScriptLocale.CREATE_SHAPE,
  491.  
  492.                     "text_horizontal_align" : "center",
  493.                 },
  494.                 {
  495.                     "name" : "shape_button_01",
  496.                     "type" : "radio_button",
  497.  
  498.                     "x" : 79,
  499.                     "y" : 239 + TEMPORARY_HEIGHT,
  500.  
  501.                     "text" : "1",
  502.  
  503.                     "default_image" : ROOT_PATH + "Middle_Button_01.sub",
  504.                     "over_image" : ROOT_PATH + "Middle_Button_02.sub",
  505.                     "down_image" : ROOT_PATH + "Middle_Button_03.sub",
  506.                 },
  507.                 {
  508.                     "name" : "shape_button_02",
  509.                     "type" : "radio_button",
  510.  
  511.                     "x" : 139,
  512.                     "y" : 239 + TEMPORARY_HEIGHT,
  513.  
  514.                     "text" : "2",
  515.  
  516.                     "default_image" : ROOT_PATH + "Middle_Button_01.sub",
  517.                     "over_image" : ROOT_PATH + "Middle_Button_02.sub",
  518.                     "down_image" : ROOT_PATH + "Middle_Button_03.sub",
  519.                 },
  520.  
  521.                 {
  522.                     "name" : "create_button",
  523.                     "type" : "button",
  524.  
  525.                     "x" : 11,
  526.                     "y" : 265 + TEMPORARY_HEIGHT,
  527.  
  528.                     "text" : uiScriptLocale.CREATE_CREATE,
  529.  
  530.                     "default_image" : ROOT_PATH + "Large_Button_01.sub",
  531.                     "over_image" : ROOT_PATH + "Large_Button_02.sub",
  532.                     "down_image" : ROOT_PATH + "Large_Button_03.sub",
  533.                 },
  534.                 {
  535.                     "name" : "cancel_button",
  536.                     "type" : "button",
  537.  
  538.                     "x" : 109,
  539.                     "y" : 265 + TEMPORARY_HEIGHT,
  540.  
  541.                     "text" : uiScriptLocale.CANCEL,
  542.  
  543.                     "default_image" : ROOT_PATH + "Large_Button_01.sub",
  544.                     "over_image" : ROOT_PATH + "Large_Button_02.sub",
  545.                     "down_image" : ROOT_PATH + "Large_Button_03.sub",
  546.                 },
  547.             ),
  548.         },
  549.  
  550.         ## Buttons
  551.         {
  552.             "name" : "left_button",
  553.             "type" : "button",
  554.  
  555.             "x" : SCREEN_WIDTH * (450 - 22*3) / 800,
  556.             "y" : SCREEN_HEIGHT * (505) / 600,
  557.  
  558.             "default_image" : "d:/ymir work/ui/intro/select/dragon_left_button_01.sub",
  559.             "over_image" : "d:/ymir work/ui/intro/select/dragon_left_button_02.sub",
  560.             "down_image" : "d:/ymir work/ui/intro/select/dragon_left_button_03.sub",
  561.         },
  562.         {
  563.             "name" : "right_button",
  564.             "type" : "button",
  565.  
  566.             "x" : SCREEN_WIDTH * (580 - 22) / 800,
  567.             "y" : SCREEN_HEIGHT * (505) / 600,
  568.  
  569.             "default_image" : "d:/ymir work/ui/intro/select/dragon_right_button_01.sub",
  570.             "over_image" : "d:/ymir work/ui/intro/select/dragon_right_button_02.sub",
  571.             "down_image" : "d:/ymir work/ui/intro/select/dragon_right_button_03.sub",
  572.         },
  573.  
  574.  
  575.     ),
  576. }
Advertisement
Add Comment
Please, Sign In to add comment