Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
2f6d0bf2
Commit
2f6d0bf2
authored
5 years ago
by
Andrey2470T
Committed by
Paramat
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add 4th item row to creative inventory. Align search, trash, page navigation
parent
d9f8c6cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mods/creative/inventory.lua
+15
-15
15 additions, 15 deletions
mods/creative/inventory.lua
mods/sfinv/api.lua
+11
-11
11 additions, 11 deletions
mods/sfinv/api.lua
with
26 additions
and
26 deletions
mods/creative/inventory.lua
+
15
−
15
View file @
2f6d0bf2
...
...
@@ -120,20 +120,20 @@ function creative.register_tab(name, title, items)
creative
.
update_creative_inventory
(
player_name
,
items
)
local
inv
=
player_inventory
[
player_name
]
local
start_i
=
inv
.
start_i
or
0
local
pagenum
=
math.floor
(
start_i
/
(
3
*
8
)
+
1
)
local
pagemax
=
math.ceil
(
inv
.
size
/
(
3
*
8
))
local
pagenum
=
math.floor
(
start_i
/
(
4
*
8
)
+
1
)
local
pagemax
=
math.ceil
(
inv
.
size
/
(
4
*
8
))
local
esc
=
minetest
.
formspec_escape
return
sfinv
.
make_formspec
(
player
,
context
,
"label[
6.2,3.3
5;"
..
minetest
.
colorize
(
"#FFFF00"
,
tostring
(
pagenum
))
..
" / "
..
tostring
(
pagemax
)
..
"]"
..
"label[
5.8,4.1
5;"
..
minetest
.
colorize
(
"#FFFF00"
,
tostring
(
pagenum
))
..
" / "
..
tostring
(
pagemax
)
..
"]"
..
[[
image[4.0
6,3.4
;0.8,0.8;creative_trash_icon.png]
image[4.0
8,4.2
;0.8,0.8;creative_trash_icon.png]
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
list[detached:creative_trash;main;4
,3.3
;1,1;]
list[detached:creative_trash;main;4
.02,4.1
;1,1;]
listring[]
image_button[5
.4,3.2
5;0.8,0.8;creative_prev_icon.png;creative_prev;]
image_button[7.2,
3.2
5;0.8,0.8;creative_next_icon.png;creative_next;]
image_button[2.
1,3.2
5;0.8,0.8;creative_search_icon.png;creative_search;]
image_button[
2.75,3.2
5;0.8,0.8;creative_clear_icon.png;creative_clear;]
image_button[5
,4.0
5;0.8,0.8;creative_prev_icon.png;creative_prev;]
image_button[7.2,
4.0
5;0.8,0.8;creative_next_icon.png;creative_next;]
image_button[2.
63,4.0
5;0.8,0.8;creative_search_icon.png;creative_search;]
image_button[
3.25,4.0
5;0.8,0.8;creative_clear_icon.png;creative_clear;]
]]
..
"tooltip[creative_search;"
..
esc
(
S
(
"Search"
))
..
"]"
..
"tooltip[creative_clear;"
..
esc
(
S
(
"Reset"
))
..
"]"
..
...
...
@@ -141,9 +141,9 @@ function creative.register_tab(name, title, items)
"tooltip[creative_next;"
..
esc
(
S
(
"Next page"
))
..
"]"
..
"listring[current_player;main]"
..
"field_close_on_enter[creative_filter;false]"
..
"field[0.3,
3.5
;2.
2
,1;creative_filter;;"
..
esc
(
inv
.
filter
)
..
"]"
..
"field[0.3,
4.2
;2.
8
,1
.2
;creative_filter;;"
..
esc
(
inv
.
filter
)
..
"]"
..
"listring[detached:creative_"
..
player_name
..
";main]"
..
"list[detached:creative_"
..
player_name
..
";main;0,0;8,
3
;"
..
tostring
(
start_i
)
..
"]"
..
"list[detached:creative_"
..
player_name
..
";main;0,0;8,
4
;"
..
tostring
(
start_i
)
..
"]"
..
creative
.
formspec_add
,
true
)
end
,
on_enter
=
function
(
self
,
player
,
context
)
...
...
@@ -173,15 +173,15 @@ function creative.register_tab(name, title, items)
local
start_i
=
inv
.
start_i
or
0
if
fields
.
creative_prev
then
start_i
=
start_i
-
3
*
8
start_i
=
start_i
-
4
*
8
if
start_i
<
0
then
start_i
=
inv
.
size
-
(
inv
.
size
%
(
3
*
8
))
start_i
=
inv
.
size
-
(
inv
.
size
%
(
4
*
8
))
if
inv
.
size
==
start_i
then
start_i
=
math.max
(
0
,
inv
.
size
-
(
3
*
8
))
start_i
=
math.max
(
0
,
inv
.
size
-
(
4
*
8
))
end
end
elseif
fields
.
creative_next
then
start_i
=
start_i
+
3
*
8
start_i
=
start_i
+
4
*
8
if
start_i
>=
inv
.
size
then
start_i
=
0
end
...
...
This diff is collapsed.
Click to expand it.
mods/sfinv/api.lua
+
11
−
11
View file @
2f6d0bf2
...
...
@@ -37,21 +37,21 @@ function sfinv.get_nav_fs(player, context, nav, current_idx)
end
local
theme_inv
=
[[
image[0,
4.7
;1,1;gui_hb_bg.png]
image[1,
4.7
;1,1;gui_hb_bg.png]
image[2,
4.7
;1,1;gui_hb_bg.png]
image[3,
4.7
;1,1;gui_hb_bg.png]
image[4,
4.7
;1,1;gui_hb_bg.png]
image[5,
4.7
;1,1;gui_hb_bg.png]
image[6,
4.7
;1,1;gui_hb_bg.png]
image[7,
4.7
;1,1;gui_hb_bg.png]
list[current_player;main;0,
4.7
;8,1;]
list[current_player;main;0,
5.8
5;8,3;8]
image[0,
5.2
;1,1;gui_hb_bg.png]
image[1,
5.2
;1,1;gui_hb_bg.png]
image[2,
5.2
;1,1;gui_hb_bg.png]
image[3,
5.2
;1,1;gui_hb_bg.png]
image[4,
5.2
;1,1;gui_hb_bg.png]
image[5,
5.2
;1,1;gui_hb_bg.png]
image[6,
5.2
;1,1;gui_hb_bg.png]
image[7,
5.2
;1,1;gui_hb_bg.png]
list[current_player;main;0,
5.2
;8,1;]
list[current_player;main;0,
6.3
5;8,3;8]
]]
function
sfinv
.
make_formspec
(
player
,
context
,
content
,
show_inv
,
size
)
local
tmp
=
{
size
or
"size[8,
8.6
]"
,
size
or
"size[8,
9.1
]"
,
sfinv
.
get_nav_fs
(
player
,
context
,
context
.
nav_titles
,
context
.
nav_idx
),
show_inv
and
theme_inv
or
""
,
content
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment