Paste #BJ9 -- näytä pelkkänä tekstinä -- uusi tämän pohjalta
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | tableoptions[<opt 1>;<opt 2>;...] ^ Options: ^ color=#RRGGBB ^^ default text color (hex), defaults to #FFFFFF ^ background=#RRGGBB ^^ table background color (hex), defaults to #000000 ^ background_alpha=#AA ^^ table background alpha (hex), defaults to #FF ^ rowheight=<H> ^^ height of each row, default depends on font size tablecolumns[<type 1>,<opt 1a>,<opt 1b>,...;<type 2>,<opt 2a>,<opt 2b>;...] ^ Types: text, icon, color, tree ^^ text: show cell contents as visible text ^^ icon: cell contents are an icon index, use column options to define icons ^^ color: cell contents are #RRGGBB and define color of following cell ^^ tree: cell contents are a number and define tree depth of following cell ^ Column options that work with every column type: ^^ width=<W> sets minimum column width, default W=0 ^^ padding=<L>,<R> sets left (L) and right (R) padding, default L=R=0 ^^ tooltip=<text> sets tooltip text ^ "text" column options: ^^ align=left Left aligned text (default) ^^ align=center Centered text ^^ align=right Right aligned text ^^ color=#RRGGBB sets default color, overridable by preceding color column ^^ if not set, color from tableoptions is used ^ "icon" column options: ^^ 0=<imagename> sets icon for iconindex 0 ^^ 1=<imagename> sets icon for iconindex 1 ^^ 2=<imagename> sets icon for iconindex 2 ^^ and so on; note that you can start with index 0 or index 1 ^ "color" column options: ^^ span=<N> color is valid for the N following columns (default N = 1) ^ "indent" column options: ^^ scale=<W> width of a single indent (default W = ???) ^^ opendepth=<N> all subtrees up to depth < N are open (default N = 0) table[<X>,<Y>;<W>,<H>;<name>;<cell 1>,<cell 2>,...,<cell n>;<selected idx>] ^Scrollable table using options defined by the last tableoptions[] ^Displays cells as defined by the last tablecolumns[] ^ x and y position the itemlist relative to the top left of the menu ^ w and h are the size of the itemlist ^ name fieldname sent to server on row select or doubleclick ^ cell 1...n cell contents given in row-major order ^ selected idx: index of row to be selected within table (first row = 1) ^ Use minetest.explode_table_event (engine.explode_table_event in mainmenu) ^ to parse a table event gotten through on_receive_fields or similar means minetest.explode_table_event(evt) -> table ^ Parses a table event gotten through on_receive_fields or similar means ^ Note that all row and column indices are 1 based; 0 indicates an error ^ Input: INV ^^ Output: {type="INV", row=0, column=0} ^^ Indicates that no row is selected ^ Input: CHG:<R>:<C> ^^ Output: {type="CHG", row=<R>, column=<C>} ^^ Indicates that row <R> got selected in the table ^^ <C> is the column that was clicked (0 if not available, e.g. ^^ if the row was selected by using the keyboard) ^ Input: DCL:<R>:<C> ^^ Output: {type="DCL", row=<R>, column=<C>} ^^ Indicates that row <R>, column <C> was double-clicked. ^^ Also sent when Enter is pressed, in this case <C> is 0. EXAMPLE 1: Credits tab (newlines are just for readability) tableoptions[background_alpha=#FF] tablecolumns[color;text] table[3.5,-0.25;8.5,5.8;list_credits; #FFFF00,Core Developers, ,Perttu Ahola (celeron55), ,..., ,, #FFFF00,Active Contributors, ,sapier, ,..., ,, #FFFF00,Previous Contributors, ,Guiseppe Bilotta (Oblomov), ,..., ,;0] EXAMPLE 2: Configure world dialog tablecolumns[icon,0=checkbox_off.png,1=checkbox_on.png;indent;color;text] table[5.5,0.5;5.5,5.75;world_config_modlist; 1,0,#00DD00,ambience, 1,0,#003300,minetest-mod-mesecons (32), 1,1,#00DD00,mesecons, 1,1,#00DD00,mesecons_alias, 1,1,#00DD00,mesecons_blinkyplant, 1,1,#00DD00,..., 1,1,#00DD00,mesecons_walllever, 0,0,#AAAAAA,modpack (2), 0,1,#AAAAAA,nested_modpack (2), 0,2,,nested_mod_1, 0,2,,nested_mod_2, 0,0,,moreores, 0,0,,sandjoy, ,0,#0000DD,Game mods (16), ,1,#0000DD,bones, ,1,#0000DD,bucket, ,1,#0000DD,creative, ,1,#0000DD,default, ,1,#0000DD,..., ,1,#0000DD,wool, ,0,#0000DD,World mods (0);0] EXAMPLE 3: Serverlist tablecolumns[ icon,1=creative.png,tooltip=Creative Mode; icon,1=heart.png,tooltip=Damage enabled; icon,1=pvp.png;tooltip=PvP allowed; text,align=right,tooltip=Current players / Maximum players; text] table[5.5,0.5;5.5,5.75;world_config_modlist; 1,1,1,12/30,LandRush Server, 0,1,1,3/100,86.149.73.243:30000, 1,1,0,2/32,LinuxGaming.us, 0,1,1,1/20,sfan5's Survival Server, 0,1,1,1/100,LotsFun Test server, 0,1,1,1/100,0gb.us's simple server, 0,1,0,1/12,Clip Minetest server, 1,0,0,0/20,creative;0] |