76c9bb9517
This way the slots are all nice and crisp regardless of GUI scale or image size, and we only need the single slot and its bright version. This also makes the standard crafting grid into a style table entry that can be referenced to insert the crafting grid at its proper style-specific position in any formspec. And it also makes the craft grid arrow, its X position, and the crafting grid's result slot X position into style table entries. Includes a few public helper functions to do most of the work: `ui.single_slot(xpos, ypos, bright)` Does just what it sounds like: it returns a single slot image. `xpos` and `ypos` are normal coordinates in slots, as you'd use in `image[]` element. `bright` is a flag that switches to the brighter version of the slot image. `ui.make_trash_slot(xpos, ypos)` Creates a single slot, with a one-item `list[]` and a trash can icon overlay. `ui.make_inv_img_grid(xpos, ypos, width, height, bright)` Generates a `width` by `height` grid of slot images, using the single_slot function above, starting at (`xpos`,`ypos`) for the top-left. Position is as in any `image[]` element, and dimensions are in integer numbers of slots (so 8,4 would be a standard inventory). `bright` is as above. All three return a string that can be directly inserted into a formspec. |
||
---|---|---|
.. | ||
bags_large.png | ||
bags_medium.png | ||
bags_small.png | ||
ui_1_icon.png | ||
ui_2_icon.png | ||
ui_3_icon.png | ||
ui_4_icon.png | ||
ui_5_icon.png | ||
ui_bags_icon.png | ||
ui_blank_image.png | ||
ui_blue_icon_background.png | ||
ui_circular_arrows_icon.png | ||
ui_craft_icon.png | ||
ui_craftgrid_icon.png | ||
ui_craftguide_icon.png | ||
ui_crafting_arrow.png | ||
ui_doubleleft_icon.png | ||
ui_doubleright_icon.png | ||
ui_formbg_9_sliced.png | ||
ui_gohome_icon.png | ||
ui_green_icon_background.png | ||
ui_group.png | ||
ui_home_icon.png | ||
ui_left_icon.png | ||
ui_moon_icon.png | ||
ui_no.png | ||
ui_off_icon.png | ||
ui_ok_icon.png | ||
ui_on_icon.png | ||
ui_pencil_icon.png | ||
ui_red_icon_background.png | ||
ui_reset_icon.png | ||
ui_right_icon.png | ||
ui_search_icon.png | ||
ui_sethome_icon.png | ||
ui_single_slot_bright.png | ||
ui_single_slot.png | ||
ui_skip_backward_icon.png | ||
ui_skip_forward_icon.png | ||
ui_sun_icon.png | ||
ui_trash_icon.png | ||
ui_trash_slot_icon.png | ||
ui_waypoint_set_icon.png | ||
ui_waypoints_icon.png | ||
ui_xyz_icon.png | ||
ui_xyz_off_icon.png | ||
ui_xyz_on_icon.png |