Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
illuna-minetest
Commits
60add387
Commit
60add387
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Create main menu tab "Settings" for client settings
parent
ca0fd417
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/guiMainMenu.cpp
+60
-99
60 additions, 99 deletions
src/guiMainMenu.cpp
src/main.cpp
+5
-0
5 additions, 0 deletions
src/main.cpp
with
65 additions
and
99 deletions
src/guiMainMenu.cpp
+
60
−
99
View file @
60add387
...
...
@@ -93,6 +93,7 @@ enum
TAB_SINGLEPLAYER
=
0
,
TAB_MULTIPLAYER
,
TAB_ADVANCED
,
TAB_SETTINGS
,
TAB_CREDITS
};
...
...
@@ -212,6 +213,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
e
->
addTab
(
L"Singleplayer"
);
e
->
addTab
(
L"Multiplayer"
);
e
->
addTab
(
L"Advanced"
);
e
->
addTab
(
L"Settings"
);
e
->
addTab
(
L"Credits"
);
e
->
setActiveTab
(
m_data
->
selected_tab
);
}
...
...
@@ -305,49 +307,16 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
u32
option_w
=
150
;
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
);
Environment
->
addCheckBox
(
m_data
->
fancy_trees
,
rect
,
this
,
GUI_ID_FANCYTREE_CB
,
wgettext
(
"Fancy trees"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
);
Environment
->
addCheckBox
(
m_data
->
smooth_lighting
,
rect
,
this
,
GUI_ID_SMOOTH_LIGHTING_CB
,
wgettext
(
"Smooth Lighting"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
2
);
Environment
->
addCheckBox
(
m_data
->
clouds_3d
,
rect
,
this
,
GUI_ID_3D_CLOUDS_CB
,
wgettext
(
"3D Clouds"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
3
);
Environment
->
addCheckBox
(
m_data
->
opaque_water
,
rect
,
this
,
GUI_ID_OPAQUE_WATER_CB
,
wgettext
(
"Opaque water"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
4
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
0
);
Environment
->
addCheckBox
(
m_data
->
creative_mode
,
rect
,
this
,
GUI_ID_CREATIVE_CB
,
wgettext
(
"Creative Mode"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
5
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
1
);
Environment
->
addCheckBox
(
m_data
->
enable_damage
,
rect
,
this
,
GUI_ID_DAMAGE_CB
,
wgettext
(
"Enable Damage"
));
}
// Key change button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
120
,
30
);
/*rect += m_topleft_client + v2s32(m_size_client.X-120-30,
m_size_client.Y-30-20);*/
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
6
+
20
);
Environment
->
addButton
(
rect
,
this
,
GUI_ID_CHANGE_KEYS_BUTTON
,
wgettext
(
"Change keys"
));
}
changeCtype
(
"C"
);
}
else
if
(
m_data
->
selected_tab
==
TAB_MULTIPLAYER
)
...
...
@@ -413,38 +382,6 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
this
,
GUI_ID_PORT_INPUT
);
}
changeCtype
(
""
);
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
);
Environment
->
addCheckBox
(
m_data
->
fancy_trees
,
rect
,
this
,
GUI_ID_FANCYTREE_CB
,
wgettext
(
"Fancy trees"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
20
);
Environment
->
addCheckBox
(
m_data
->
smooth_lighting
,
rect
,
this
,
GUI_ID_SMOOTH_LIGHTING_CB
,
wgettext
(
"Smooth Lighting"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
40
);
Environment
->
addCheckBox
(
m_data
->
clouds_3d
,
rect
,
this
,
GUI_ID_3D_CLOUDS_CB
,
wgettext
(
"3D Clouds"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
60
);
Environment
->
addCheckBox
(
m_data
->
opaque_water
,
rect
,
this
,
GUI_ID_OPAQUE_WATER_CB
,
wgettext
(
"Opaque water"
));
}
// Key change button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
120
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
m_size_client
.
X
-
180
-
30
-
120
-
20
,
m_size_client
.
Y
-
30
-
20
);
Environment
->
addButton
(
rect
,
this
,
GUI_ID_CHANGE_KEYS_BUTTON
,
wgettext
(
"Change keys"
));
}
// Start game button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
180
,
30
);
...
...
@@ -524,38 +461,6 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
Environment
->
addStaticText
(
wgettext
(
"Leave address blank to start a local server."
),
rect
,
false
,
true
,
this
,
-
1
);
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
);
Environment
->
addCheckBox
(
m_data
->
fancy_trees
,
rect
,
this
,
GUI_ID_FANCYTREE_CB
,
wgettext
(
"Fancy trees"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
20
);
Environment
->
addCheckBox
(
m_data
->
smooth_lighting
,
rect
,
this
,
GUI_ID_SMOOTH_LIGHTING_CB
,
wgettext
(
"Smooth Lighting"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
40
);
Environment
->
addCheckBox
(
m_data
->
clouds_3d
,
rect
,
this
,
GUI_ID_3D_CLOUDS_CB
,
wgettext
(
"3D Clouds"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
250
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
35
+
30
,
150
+
60
);
Environment
->
addCheckBox
(
m_data
->
opaque_water
,
rect
,
this
,
GUI_ID_OPAQUE_WATER_CB
,
wgettext
(
"Opaque water"
));
}
// Key change button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
120
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
m_size_client
.
X
-
180
-
30
-
120
-
20
,
m_size_client
.
Y
-
30
-
20
);
Environment
->
addButton
(
rect
,
this
,
GUI_ID_CHANGE_KEYS_BUTTON
,
wgettext
(
"Change keys"
));
}
// Start game button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
180
,
30
);
...
...
@@ -618,6 +523,54 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
}
changeCtype
(
"C"
);
}
else
if
(
m_data
->
selected_tab
==
TAB_SETTINGS
)
{
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
20
,
300
);
rect
+=
m_topleft_client
+
v2s32
(
15
,
50
);
const
wchar_t
*
text
=
L"S
\n
E
\n
T
\n
T
\n
I
\n
N
\n
G
\n
S"
;
//gui::IGUIStaticText *t =
Environment
->
addStaticText
(
text
,
rect
,
false
,
true
,
this
,
-
1
);
//t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
}
s32
option_x
=
70
;
s32
option_y
=
50
;
u32
option_w
=
150
;
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
);
Environment
->
addCheckBox
(
m_data
->
fancy_trees
,
rect
,
this
,
GUI_ID_FANCYTREE_CB
,
wgettext
(
"Fancy trees"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
);
Environment
->
addCheckBox
(
m_data
->
smooth_lighting
,
rect
,
this
,
GUI_ID_SMOOTH_LIGHTING_CB
,
wgettext
(
"Smooth Lighting"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
2
);
Environment
->
addCheckBox
(
m_data
->
clouds_3d
,
rect
,
this
,
GUI_ID_3D_CLOUDS_CB
,
wgettext
(
"3D Clouds"
));
}
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
option_w
,
30
);
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
20
*
3
);
Environment
->
addCheckBox
(
m_data
->
opaque_water
,
rect
,
this
,
GUI_ID_OPAQUE_WATER_CB
,
wgettext
(
"Opaque water"
));
}
// Key change button
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
120
,
30
);
/*rect += m_topleft_client + v2s32(m_size_client.X-120-30,
m_size_client.Y-30-20);*/
rect
+=
m_topleft_client
+
v2s32
(
option_x
,
option_y
+
120
);
Environment
->
addButton
(
rect
,
this
,
GUI_ID_CHANGE_KEYS_BUTTON
,
wgettext
(
"Change keys"
));
}
changeCtype
(
"C"
);
}
else
if
(
m_data
->
selected_tab
==
TAB_CREDITS
)
{
// CREDITS
...
...
@@ -686,6 +639,14 @@ void GUIMainMenu::drawMenu()
driver
->
draw2DRectangle
(
bgcolor
,
rect
,
&
AbsoluteClippingRect
);
}
}
else
if
(
getTab
()
==
TAB_SETTINGS
)
{
{
core
::
rect
<
s32
>
rect
(
0
,
0
,
m_size_client
.
X
,
m_size_client
.
Y
);
rect
+=
AbsoluteRect
.
UpperLeftCorner
+
m_topleft_client
;
driver
->
draw2DRectangle
(
bgcolor
,
rect
,
&
AbsoluteClippingRect
);
}
}
else
if
(
getTab
()
==
TAB_CREDITS
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
5
−
0
View file @
60add387
...
...
@@ -1043,6 +1043,11 @@ int main(int argc, char *argv[])
}
}
if
(
world_path
==
""
){
errorstream
<<
"No world path specified or found."
<<
std
::
endl
;
return
1
;
}
// Gamespec
std
::
string
world_gameid
=
getWorldGameId
(
world_path
,
is_legacy_world
);
SubgameSpec
gamespec
=
findSubgame
(
world_gameid
);
...
...
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