Should correctly create faction

master
Solebull 2020-03-10 13:34:05 +01:00
parent 74dbd903e3
commit d3df36d7db
3 changed files with 19 additions and 3 deletions

View File

@ -254,6 +254,7 @@ It's really fast. May be used on a website, to show the actual map.
Maybe used with https://github.com/octacian/spawnpoint
**** TODO [feature_FactionUI] Try to add a factions UI
:LOGBOOK:
CLOCK: [2020-03-10 mar. 13:15]--[2020-03-10 mar. 13:33] => 0:18
CLOCK: [2020-02-07 ven. 08:59]--[2020-02-07 ven. 09:12] => 0:13
CLOCK: [2019-12-03 mar. 12:04]--[2019-12-03 mar. 12:42] => 0:38
CLOCK: [2019-11-19 mar. 09:06]--[2019-11-19 mar. 09:51] => 0:45
@ -295,7 +296,8 @@ It's really fast. May be used on a website, to show the actual map.
- [X] Must get the faction name from lineedit
- [-] Finally create the faction
- [X] We first need player name
- [ ] then copy from factions
- [ ] then copy faction creation from factions
- [ ] Then, close the dialog
- [ ] Add this to the news text file
**** DONE Trying to install mintest on the raspberry
CLOCK: [2019-06-25 mar. 23:07]--[2019-06-25 mar. 23:53] => 0:46

3
TODO
View File

@ -11,7 +11,8 @@ minetest-solebull - LGPL-2.1 - A PVP/faction game for minetest based on Cobalt.
* v0.0.2-7 (10 Aug. 2019 - ???) CLOC ???,???
- (7) factions_ui got new faction leader name
- (8) Should correctly create faction
- factions_ui got new faction leader name
- Correctly place factions_ui 'Create' button
- Got faction name in button event
- Add new faction elements to factions_ui

View File

@ -107,7 +107,20 @@ sfinv.register_page("sfinv:factions_ui", {
print("Creating new faction " .. factionName ..
" by player " .. pn)
send_error(pn, "Not yet implemented!.")
if factions.can_create_faction(factionName) then
new_faction = factions.new_faction(factionName, nil)
new_faction:add_player(pn, new_faction.default_leader_rank)
-- Manual fix ?
new_faction.leader = pn
new_faction.players[pn] = pn
factions.save()
return true
else
send_error(pn, "Faction cannot be created.")
return false
end
end
end