@@ -14,36 +14,63 @@ static var DEFAULT_SETTINGS: Dictionary = {
1414 ParleyConstants .CHARACTER_STORE_PATH : "res://characters/character_store.tres" ,
1515 ParleyConstants .ACTION_STORE_PATH : "res://actions/action_store.tres" ,
1616 ParleyConstants .FACT_STORE_PATH : "res://facts/fact_store.tres" ,
17+ # Internationalisation
18+ ParleyConstants .TRANSLATION_MODE : TranslationMode .keys ()[TranslationMode .PO ],
1719 # Test Dialogue Sequence
1820 # We can't preload this because of circular deps so let's
1921 # hardcode it for now but allow people to edit it in settings
2022 ParleyConstants .TEST_DIALOGUE_SEQUENCE_TEST_SCENE_PATH : "res://addons/parley/views/test_dialogue_sequence_scene.tscn" ,
2123}
2224
2325
26+ enum TranslationMode {
27+ PO ,
28+ # TODO: add CSV
29+ # CSV,
30+ # TODO: add None
31+ # None,
32+ }
33+
34+
2435static var TYPES : Dictionary = {
36+ # Dialogue
2537 ParleyConstants .DIALOGUE_BALLOON_PATH : {
2638 "name" : ParleyConstants .DIALOGUE_BALLOON_PATH ,
39+ "description" : "Defines the path to the default Dialogue balloon that is used to render the dialogue when testing and running Dialogue Sequences." ,
2740 "type" : TYPE_STRING ,
2841 "hint" : PROPERTY_HINT_FILE ,
2942 },
43+ # Stores
3044 ParleyConstants .ACTION_STORE_PATH : {
3145 "name" : ParleyConstants .ACTION_STORE_PATH ,
46+ "description" : "Defines the path to the Action Store resource that is used to store actions." ,
3247 "type" : TYPE_STRING ,
3348 "hint" : PROPERTY_HINT_FILE ,
3449 },
3550 ParleyConstants .CHARACTER_STORE_PATH : {
3651 "name" : ParleyConstants .CHARACTER_STORE_PATH ,
52+ "description" : "Defines the path to the Character Store resource that is used to store characters." ,
3753 "type" : TYPE_STRING ,
3854 "hint" : PROPERTY_HINT_FILE ,
3955 },
4056 ParleyConstants .FACT_STORE_PATH : {
4157 "name" : ParleyConstants .FACT_STORE_PATH ,
58+ "description" : "Defines the path to the Fact Store resource that is used to store facts." ,
4259 "type" : TYPE_STRING ,
4360 "hint" : PROPERTY_HINT_FILE ,
4461 },
62+ # Internationalisation
63+ ParleyConstants .TRANSLATION_MODE : {
64+ "name" : ParleyConstants .TRANSLATION_MODE ,
65+ "description" : "Defines the translation mode to determine how to find and interpret translations." ,
66+ "type" : TYPE_STRING ,
67+ "hint" : PROPERTY_HINT_ENUM ,
68+ "hint_string" : "," .join (TranslationMode .keys ())
69+ },
70+ # Testing
4571 ParleyConstants .TEST_DIALOGUE_SEQUENCE_TEST_SCENE_PATH : {
4672 "name" : ParleyConstants .TEST_DIALOGUE_SEQUENCE_TEST_SCENE_PATH ,
73+ "description" : "Defines the path to the default test scene that is rendered when testing Dialogue Sequences." ,
4774 "type" : TYPE_STRING ,
4875 "hint" : PROPERTY_HINT_FILE ,
4976 }
@@ -58,9 +85,9 @@ static func prepare(save: bool = true) -> void:
5885 if not ProjectSettings .has_setting (setting_name ):
5986 set_setting (setting_name , DEFAULT_SETTINGS [setting_name ])
6087 ProjectSettings .set_initial_value (setting_name , DEFAULT_SETTINGS [setting_name ])
61- var _info : Variant = TYPES .get (setting_name )
62- if is_instance_of (_info , TYPE_DICTIONARY ):
63- var info : Dictionary = _info
88+ var info_variant : Variant = TYPES .get (setting_name )
89+ if is_instance_of (info_variant , TYPE_DICTIONARY ):
90+ var info : Dictionary = info_variant
6491 ProjectSettings .add_property_info (info )
6592
6693 # Reset some user values upon load that might cause weirdness:
0 commit comments