Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a clearAllMapData() function #630

Closed
vadi2 opened this issue Mar 31, 2017 · 6 comments · Fixed by #5627
Closed

Need a clearAllMapData() function #630

vadi2 opened this issue Mar 31, 2017 · 6 comments · Fixed by #5627

Comments

@vadi2
Copy link
Member

vadi2 commented Mar 31, 2017

Need a way to clear all of the map data so people can start with a blank map if they wish.

Launchpad Details: #LP782843 Vadim Peretokin - 2011-05-15 00:32:18 +0000

@vadi2 vadi2 added the wishlist label Mar 31, 2017
@SlySven
Copy link
Member

SlySven commented Apr 22, 2017

This can currently be accomplished with a lua command loadmap("X") where X = non-blank string that is NOT an existing file name, I tend to use "_"!

Note that an empty string is a special case that loads the most recent profile saved map so does not work here.

@vadi2
Copy link
Member Author

vadi2 commented Apr 22, 2017

That sounds like a dangerous bug in that function actually, that if you give it an invalid filename the sideeffect is unintended data destruction!

@SlySven
Copy link
Member

SlySven commented Apr 23, 2017

Well, the intended effect is to replace the current map with a new one and part of that process must be the removal of the old one - should that fail a repeated use with no/an empty string will reload the last saved one which does seem a reasonable recovery path even if that is not ideal behaviour. At present we can only hold one map in the system at a time!

{A multi-map capable Mudlet is somewhere on, but nowhere near the top of my wish-list with an ability to copy rooms and exits from one to the other - as sharing maps and importing modifications from collaborators does not currently seem easy...!}

@vadi2
Copy link
Member Author

vadi2 commented Apr 23, 2017

Even updating from IREs maps presents a challenge as that wipes all custom work.

@vadi2
Copy link
Member Author

vadi2 commented Apr 23, 2017

We don't have to use just last saved one - we can save right before loading into a temporary location. That way data loss would be minimised.

@Kebap Kebap added Hacktoberfest Code & win a T-shirt :) and removed Hacktoberfest Code & win a T-shirt :) labels Oct 1, 2018
@Kebap Kebap removed the Hacktoberfest Code & win a T-shirt :) label Nov 5, 2018
@oiuv
Copy link
Contributor

oiuv commented Nov 9, 2021

I think you can add an alias with this lua code :

for id,name in pairs(getAreaTableSwap()) do
  if id > 0 then
    display("now delete area "..name)
    deleteArea(id)
  end
end

no more function needed~

@SlySven SlySven self-assigned this Nov 10, 2021
SlySven added a commit to SlySven/Mudlet that referenced this issue Nov 10, 2021
This adds a `QPushButton` to allow the currently loaded/created map to be
completely removed. As a little protection against accident activation a
separate `QCheckBox` along side it must be checked first to enable it - a
bit like a guard over a physical toggle switch, a.k.a. a:
http://catb.org/~esr/jargon/html/M/molly-guard.html

It also adds a `deleteMap()` function (which takes no arguments) to the Lua
API - which returns `true` on success - or `nil` and an error message on
error.

This should close Mudlet#5436 and Mudlet#630, and thus:
https://bugs.launchpad.net/bugs/782843 from 2011.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven linked a pull request Nov 10, 2021 that will close this issue
SlySven added a commit that referenced this issue Nov 13, 2021
This adds a `QPushButton` to allow the currently loaded/created map to be
completely removed. As a little protection against accident activation a
separate `QCheckBox` along side it must be checked first to enable it - a
bit like a guard over a physical toggle switch, a.k.a. a:
http://catb.org/~esr/jargon/html/M/molly-guard.html

It also adds a `deleteMap()` function (which takes no arguments) to the Lua
API - which returns `true` on success - or `nil` and an error message on
error.

This should close #5436 and #630, and thus:
https://bugs.launchpad.net/bugs/782843 from 2011.

Originally using the Lua function was going to produce an "[  OK  ] - Xxx"
type message on the main console but this was removed following
peer-review.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2 pushed a commit to SlySven/Mudlet that referenced this issue Jan 17, 2022
This adds a `QPushButton` to allow the currently loaded/created map to be
completely removed. As a little protection against accident activation a
separate `QCheckBox` along side it must be checked first to enable it - a
bit like a guard over a physical toggle switch, a.k.a. a:
http://catb.org/~esr/jargon/html/M/molly-guard.html

It also adds a `deleteMap()` function (which takes no arguments) to the Lua
API - which returns `true` on success - or `nil` and an error message on
error.

This should close Mudlet#5436 and Mudlet#630, and thus:
https://bugs.launchpad.net/bugs/782843 from 2011.

Originally using the Lua function was going to produce an "[  OK  ] - Xxx"
type message on the main console but this was removed following
peer-review.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants