More work on docs
This commit is contained in:
parent
c4aa8bb491
commit
2c1ca37a50
@ -1,16 +0,0 @@
|
|||||||
MCEdit2 class and module reference
|
|
||||||
==================================
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 5
|
|
||||||
|
|
||||||
apidoc/mcedit2
|
|
||||||
apidoc/mceditlib
|
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
* :ref:`modindex`
|
|
||||||
* :ref:`search`
|
|
||||||
|
|
40
doc/editorsession.rst
Normal file
40
doc/editorsession.rst
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
EditorSession
|
||||||
|
=============
|
||||||
|
|
||||||
|
An EditorSession contains the entire state and behavior of the world editor for a single
|
||||||
|
world. It contains references to the current selection, undo history, the UI widgets,
|
||||||
|
and the WorldEditor instance underlying the session.
|
||||||
|
|
||||||
|
.. attribute:: currentDimension
|
||||||
|
:type: WorldEditorDimension
|
||||||
|
|
||||||
|
The dimension currently displayed in the editor window.
|
||||||
|
|
||||||
|
.. attribute:: currentSelection
|
||||||
|
:type: SelectionBox | None
|
||||||
|
|
||||||
|
The current selection made by the user with the Select tool. Unlike MCEdit 1.0,
|
||||||
|
a selection is not always a rectangular box. Shaped and disjoint selections are
|
||||||
|
possible now.
|
||||||
|
|
||||||
|
.. _session-undo-history:
|
||||||
|
|
||||||
|
Undo History
|
||||||
|
============
|
||||||
|
|
||||||
|
The session's undo history is managed as a stack of QUndoCommands. The revision system
|
||||||
|
provided by :ref:`worldeditor` is used to manage changes to the world's data. Simple
|
||||||
|
access to the revision system is provided by the `beginSimpleCommand` method of the
|
||||||
|
`EditorSession`
|
||||||
|
|
||||||
|
.. automethod:: mcedit2.editorsession.EditorSession.beginSimpleCommand
|
||||||
|
|
||||||
|
This method returns an object to be used in a `with` statement. Any changes to the
|
||||||
|
WorldEditor within the `with` statement's block are captured by a new revision in the
|
||||||
|
revision system, and a new entry is added to the session's undo history. For example::
|
||||||
|
|
||||||
|
def changeOneBlock():
|
||||||
|
with editorSession.beginSimpleCommand("Change One Block"):
|
||||||
|
editorSession.currentDimension.setBlock(1, 2, 3, "minecraft:dirt")
|
||||||
|
|
@ -8,6 +8,9 @@ MCEdit 2 Documentation
|
|||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
plugins
|
plugins
|
||||||
|
editorsession
|
||||||
|
selection
|
||||||
|
worldeditor
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
|
@ -33,7 +33,7 @@ A basic command plugin::
|
|||||||
|
|
||||||
You can do nearly anything you want in the `perform()` function. To operate on the world
|
You can do nearly anything you want in the `perform()` function. To operate on the world
|
||||||
and dimension being edited and the current selection, use `self.editorSession`. See
|
and dimension being edited and the current selection, use `self.editorSession`. See
|
||||||
:ref:`EditorSession`, :ref:`WorldEditor`, and :ref:`WorldEditorDimension` for details
|
:doc:`editorsession`, :doc:`worldeditor`, and :ref:`world-editor-dimension` for details
|
||||||
about what can be edited and how.
|
about what can be edited and how.
|
||||||
|
|
||||||
Simple Commands
|
Simple Commands
|
||||||
@ -41,7 +41,7 @@ Simple Commands
|
|||||||
|
|
||||||
MCEdit 1.0's "filter" plugins all follow the same pattern: They prompt the user for some
|
MCEdit 1.0's "filter" plugins all follow the same pattern: They prompt the user for some
|
||||||
inputs, and then call a `perform()` function which is given the current world, the current
|
inputs, and then call a `perform()` function which is given the current world, the current
|
||||||
selection, and the inputs provided by the user. :ref:`SimpleCommandPlugin` fills the same
|
selection, and the inputs provided by the user. `SimpleCommandPlugin` fills the same
|
||||||
role in MCEdit 2.0.
|
role in MCEdit 2.0.
|
||||||
|
|
||||||
This class automatically adds a menu item to the Plugins menu. When the item is chosen,
|
This class automatically adds a menu item to the Plugins menu. When the item is chosen,
|
||||||
@ -94,6 +94,7 @@ Further keys are available depending on the type of input:
|
|||||||
- `int`: A numeric input for integer values, within the range +/- two billion or so. If
|
- `int`: A numeric input for integer values, within the range +/- two billion or so. If
|
||||||
both the `min` and `max` keys are given, also creates a slider for selecting
|
both the `min` and `max` keys are given, also creates a slider for selecting
|
||||||
a value from within this range
|
a value from within this range
|
||||||
|
|
||||||
- `min`: Minimum allowed value. Optional.
|
- `min`: Minimum allowed value. Optional.
|
||||||
- `max`: Maximum allowed value. Optional.
|
- `max`: Maximum allowed value. Optional.
|
||||||
|
|
||||||
@ -101,18 +102,21 @@ Further keys are available depending on the type of input:
|
|||||||
range allowed by double-precision floating point). If
|
range allowed by double-precision floating point). If
|
||||||
both the `min` and `max` keys are given, also creates a slider for selecting
|
both the `min` and `max` keys are given, also creates a slider for selecting
|
||||||
a value from within this range
|
a value from within this range
|
||||||
|
|
||||||
- `min`: Minimum allowed value. Optional.
|
- `min`: Minimum allowed value. Optional.
|
||||||
- `max`: Maximum allowed value. Optional.
|
- `max`: Maximum allowed value. Optional.
|
||||||
|
|
||||||
- `bool`: A checkbox that can be either on or off.
|
- `bool`: A checkbox that can be either on or off.
|
||||||
|
|
||||||
- `text`: A text field that can input a single line of text.
|
- `text`: A text field that can input a single line of text.
|
||||||
|
|
||||||
- `placeholder`: Displays this text in a light grey color if the text field is empty. Optional.
|
- `placeholder`: Displays this text in a light grey color if the text field is empty. Optional.
|
||||||
|
|
||||||
- `choice`: A pop-up menu that offers multiple choices for the user to select from.
|
- `choice`: A pop-up menu that offers multiple choices for the user to select from.
|
||||||
Each choice is associated with a value that you define in the element's `choices`
|
Each choice is associated with a value that you define in the element's `choices`
|
||||||
list. This is the value you will receive as this option's value in
|
list. This is the value you will receive as this option's value in
|
||||||
the `perform()` function.
|
the `perform()` function.
|
||||||
|
|
||||||
- `choices`: A list of tuples of the form `(text, value)`.
|
- `choices`: A list of tuples of the form `(text, value)`.
|
||||||
|
|
||||||
For examples of all possible simple command inputs, see the `simple_options.py` file in
|
For examples of all possible simple command inputs, see the `simple_options.py` file in
|
||||||
|
2
doc/selection.rst
Normal file
2
doc/selection.rst
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Selections
|
||||||
|
==========
|
25
doc/worldeditor.rst
Normal file
25
doc/worldeditor.rst
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
WorldEditor
|
||||||
|
===========
|
||||||
|
|
||||||
|
A `WorldEditor` object is used to edit all parts of a Minecraft world. It contains a
|
||||||
|
:ref:`WorldEditorMetadata` object containing info about the world's name, seed, and other
|
||||||
|
data found in the `level.dat` file, and a collection of :ref:`WorldEditorDimension`s
|
||||||
|
which provides access to the chunks, blocks, and entities in each dimension.
|
||||||
|
|
||||||
|
`WorldEditor` also provides a revisioning system used to implement MCEdit's undo history.
|
||||||
|
When editing a world opened in MCEdit, you should use the :ref:`session-undo-history`
|
||||||
|
|
||||||
|
|
||||||
|
.. method:: mceditlib.worldeditor.getDimension
|
||||||
|
|
||||||
|
.. _world-editor-dimension
|
||||||
|
|
||||||
|
WorldEditorDimension
|
||||||
|
====================
|
||||||
|
|
||||||
|
All blocks, chunks, and entities in a world are contained in a `WorldEditorDimension`.
|
||||||
|
A world may have one or more dimensions. One of these dimensions is always the
|
||||||
|
"overworld" or default dimension and may be obtained by calling `WorldEditor.getDimension()`
|
||||||
|
with no arguments.
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user