|
3.
|
|
|
All data reachable through fields on ``persistent`` is saved when Ren'Py terminates, or when :func:`renpy.save_persistent` is called. Persistent data is loaded when Ren'Py starts, and when Ren'Py detects that the persistent data has been updated on disk.
|
|
|
|
"persistent"의 필드를 통해 도달 할 수 있는 모든 데이터는 Ren'Py가 종료되거나 : func :'renpy.save_persistent'가 호출 될 때 저장됩니다. 영구 데이터는 Ren'Py가 시작될 때와 Ren'Py가 영구 데이터가 디스크에서 업데이트되었음을 감지하면로드됩니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:12
|
|
4.
|
|
|
The persistent object is special in that an access to an undefined field will have a None value, rather than causing an exception.
|
|
|
|
영속 객체는 정의되지 않은 필드에 대한 액세스가 예외를 발생시키는 것이 아니라 None값을 가지기 때문에 특별합니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:17
|
|
5.
|
|
|
An example use of persistent is the creation of an unlockable image gallery. This is done by storing a flag in persistent that determines if the gallery has been unlocked, as in ::
|
|
|
|
퍼시 스턴트 사용의예는 잠금 해제 가능한 이미지 갤러리를 만드는 것입니다. ;;와 같이 갤러리가 잠금 해제되었는지 여부를 판별하는 플래그를 지속적으로 저장하여 수행됩니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:20
|
|
6.
|
|
|
When the user gets an ending that causes the gallery to be unlocked, the flag must be set to True. ::
|
|
|
|
사용자가 갤러리를 잠금 해제하는 엔딩을 받으며 플래그를 True로 설정해야합니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:33
|
|
7.
|
|
|
As persistent data is loaded before the init code is run, persistent data should only contain types that are native to python or Ren'Py. Alternatively, classes that are defined in ``python early`` blocks can be used, provided those classes can be pickled and implement equality.
|
|
|
|
init코드가 실행되기 전에 영속 데이터가 로드 될 때 영속 데이터는 python또는 Ren'Py 고유의 유형만 포함해야합니다. 또는 "python early" 블록에 정의 된 클래스를 사용할 수 있습니다(클래스를 선택하고 동일성을 구현할 수 있는 경우)
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:38
|
|
8.
|
|
|
Merging Persistent Data
|
|
|
|
영구 데이터병합
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:44
|
|
9.
|
|
|
There are cases where Ren'Py has to merge persistent data from two sources. For example, Ren'Py may need to merge persistent data stored on a USB drive with persistent data from the local machine.
|
|
|
|
렌파이가 두 가지 소스를 영구 데이터를 병합해야하는 경우가 있습니다. 예를 들어 Ren;Py는 USB드라이브에 저장된 영구 데이터를 로컬 컴퓨터읭 영구 데이터와 병합해야 할 수 있습니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:46
|
|
10.
|
|
|
Ren'Py does this merging on a field-by-field basis, taking the value of the field that was updated more recently. In some cases, this is not the desired behavior. In that case, the :func:`renpy.register_persistent` function can be used.
|
|
|
|
렌파이는 필드 단위로 변합을 수행하며, 최근에 업데이트 된 필드의 가치를 고려합니다. 경우에 따라 원하는 동작이 아닙니다. 이경우 : func:'renpy.register_persistent'함수를 사용할 수 있습니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:50
|
|
11.
|
|
|
For example, if we have a set of seen endings, we'd like to take the union of that set when merging data. ::
|
|
|
|
예를 들어, 엔딩 세트가 있는 경우 데이터를 병합 할 때 해당 세트를 합치려고합니다.
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:55
|
|
12.
|
|
|
Persistent Functions
|
|
|
|
지속 기능
|
|
Translated and reviewed by
구현주
|
|
|
|
Located in
../../source/persistent.rst:69
|