FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnrealEnginePython/examples/custom_settings.py at develop · 20tab/UnrealEnginePython · GitHub
20tab
UnrealEnginePython
Repository navigation
Code
Issues
338
(338)
Pull requests
32
(32)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnrealEnginePython
/
examples
/
custom_settings.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (32 loc) · 1.31 KB
Breadcrumbs
UnrealEnginePython
/
examples
/
custom_settings.py
Copy path
File metadata and controls
42 lines (32 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
unreal_engine
as
ue
from
unreal_engine
.
classes
import
Object
,
StrProperty
,
IntProperty
from
unreal_engine
import
CLASS_CONFIG
,
CLASS_DEFAULT_CONFIG
,
CPF_CONFIG
def
config
(
arg
):
config_name
=
None
def
wrapper
(
u_class
):
cflags
=
u_class
.
class_get_flags
()
u_class
.
class_set_flags
(
cflags
|
CLASS_CONFIG
)
if
config_name
:
u_class
.
class_set_config_name
(
config_name
)
return
u_class
if
isinstance
(
arg
,
str
):
config_name
=
arg
return
wrapper
return
wrapper
(
arg
)
def
default_config
(
u_class
):
cflags
=
u_class
.
class_get_flags
()
u_class
.
class_set_flags
(
cflags
|
CLASS_DEFAULT_CONFIG
)
return
u_class
@
config
(
'DumbConfig'
)
@
default_config
class
FooSettings
(
Object
):
HelloWorld
=
StrProperty
FooWorld
=
[
IntProperty
]
def
__init__
(
self
):
self
.
add_property_flags
(
'HelloWorld'
,
CPF_CONFIG
)
self
.
get_uproperty
(
'HelloWorld'
).
set_metadata
(
'Category'
,
'CategoryTest001'
)
self
.
HelloWorld
=
'Hello World 001'
self
.
add_property_flags
(
'FooWorld'
,
CPF_CONFIG
)
self
.
get_uproperty
(
'FooWorld'
).
set_metadata
(
'Category'
,
'CategoryTest002'
)
self
.
FooWorld
=
[
17
,
22
,
30
]
ue
.
register_settings
(
'Project'
,
'FooBar'
,
'General'
,
'General DisplayName'
,
'General Description'
,
ue
.
get_mutable_default
(
FooSettings
))
Back
|
FazBrowse Home
|
New Git URL