File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
java/cz/muni/fi/rpg/ui/characterCreation Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,13 @@ class CharacterCreationFragment(
138138 points : Points
139139 ) {
140140 launch {
141+ val characterId = CharacterId (args.partyId, authentication.getUserId())
141142 Timber .d(" Creating character" )
142143 characters.save(
143- args .partyId,
144+ characterId .partyId,
144145 Character (
145146 name = info.name,
146- userId = authentication.getUserId() ,
147+ userId = characterId.userId ,
147148 career = info.career,
148149 socialClass = info.socialClass,
149150 race = info.race,
@@ -157,7 +158,11 @@ class CharacterCreationFragment(
157158 )
158159 toast(" Your character has been created" )
159160
160- withContext(Dispatchers .Main ) { findNavController().popBackStack() }
161+ withContext(Dispatchers .Main ) {
162+ findNavController().navigate(
163+ CharacterCreationFragmentDirections .openCharacter(characterId)
164+ )
165+ }
161166 }
162167
163168 }
Original file line number Diff line number Diff line change 6161 <argument
6262 android : name =" partyId"
6363 app : argType =" java.util.UUID" />
64+
65+ <action
66+ android : id =" @+id/openCharacter"
67+ app : destination =" @id/nav_character"
68+ app : popUpTo =" @id/nav_party_list" />
6469 </fragment >
6570
6671 <fragment
You can’t perform that action at this time.
0 commit comments