Paste #zZD -- 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 139 140 141 142 143 144 145 146 147 148 149 150 151 | 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 ^ border=<true/false> ^^ should the table be drawn with a border? (default true) ^ highlight=#RRGGBB ^^ highlight background color (hex), defaults to #466432 ^ highlight_alpha=#AA ^^ highlight background alpha (hex), defaults to #FF ^ highlight_text=#RRGGBB ^^ highlight text color (hex), defaults to #FFFFFF ^ opendepth=<N> ^^ all subtrees up to depth < N are open (default N = 0) ^^ only useful when there is a column of type "tree" tablecolumns[<type 1>,<opt 1a>,<opt 1b>,...;<type 2>,<opt 2a>,<opt 2b>;...] ^ Types: text, image, color, indent, tree ^^ text: show cell contents as visible text ^^ image: cell contents are an image index, use column options to define images ^^ color: cell contents are #RRGGBB and define color of following cell ^^ indent: cell contents are a number and define indentation of following cell ^^ tree: same as indent, but user can open and close subtrees (treeview-like) ^ Column options: ^^ align=<align> for "text" and "image": content alignment within cells ^^ available alignments: left (default), center, right, inline ^^ width=<W> for "text" and "image": minimum width in em (default W=0) ^^ for "indent" and "tree": indent width in em (default W=1.5) ^^ padding=<W> padding left of the column, in em (default W=0.5) ^^ tooltip=<text> tooltip text (default empty) ^ "image" column options: ^^ 0=<imagename> sets image for image index 0 ^^ 1=<imagename> sets image for image index 1 ^^ 2=<imagename> sets image for image index 2 ^^ and so on; note that defined indices need not be contiguous ^^ empty or non-numeric cells are treated as 0 ^ "color" column options: ^^ span=<N> color is valid for the N following columns (default N = infinite) 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 ^^ If row got selected by clicking, <C> is the column that was clicked. ^^ Otherwise, <C> is 0. ^ Input: DCL:<R>:<C> ^^ Output: {type="DCL", row=<R>, column=<C>} ^^ Indicates that row <R>, column <C> was double-clicked. ^^ Also sent when Return or Space is pressed, in this case <C> is 0. EXAMPLE 1: Credits tab (newlines are just for readability) tableoptions[background_alpha=0,border=false] 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[ color; tree; image,align=inline, 0=checkbox_off.png, 1=checkbox_on.png, 2=checkbox_onoff.png, 3=empty.png; text] table[5.5,0.5;5.5,5.75;world_config_modlist; #00DD00,0,1,ambience, #003300,0,2,minetest-mod-mesecons (32), #00DD00,1,1,mesecons, #00DD00,1,1,mesecons_alias, #00DD00,1,0,mesecons_blinkyplant, #00DD00,1,1,..., #00DD00,1,1,mesecons_walllever, #AAAAAA,0,0,modpack (2), #AAAAAA,1,0,nested_modpack (2), ,2,0,nested_mod_1, ,2,0,nested_mod_2, ,0,0,moreores, ,0,0,sandjoy, #0000DD,0,3,Game mods (16), #0000DD,1,3,bones, #0000DD,1,3,bucket, #0000DD,1,3,creative, #0000DD,1,3,default, #0000DD,1,3,..., #0000DD,1,3,wool, #0000DD,0,3,World mods (0);0] EXAMPLE 3: Serverlist tablecolumns[ image,1=creative.png,tooltip=Creative mode?; image,1=heart.png,tooltip=Damage enabled?; image,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] |