18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 23:17:56 +01:00
Files
maszyna/editor/editorIcons.hpp
T
maj00r 6828e52a45 feat(editor): the EU07M models as a field of work of their own, made for those who don't know the format
The window of an EU07M model becomes the field of work "Models" (F7) beside the surroundings, the tracks,
the roads, the terrain and the catenary. The node bank says what is edited and lists the vehicles, the tool
options hold the page of the tool chosen in the toolbar (Lights, Parts of the vehicle, All parts,
Animations), and the inspector the settings of the part picked, in plain words; the fields of the format
are kept under Advanced.

- A click on the model picks its part (the smallest box of geometry of a part shown holding the point);
  a light is added where the model is clicked, a spot shining towards the camera.
- A light which nothing else points at is taken out (eu07m::node_removable / remove_node, with
  TModel3d::UnlinkEditorSubmodel / LinkEditorSubmodel on the model the game has).
- Ctrl+Z / Ctrl+Y take the changes of the model back and make them again, a light added or taken out
  among them; another model asked for with changes not saved asks first.
- "Import to EU07M" writes <model>.eu07m beside the .e3d or .t3d of a model without one, made of the
  model as the game loaded it (eu07m::import_model), so a lamp post or a cab gets its lights here.
- "Put a model in the scenery" puts a model of the folder of the models in front of the camera, "Whole
  model" moves the scenery model with the gizmo of the editor, "Put a vehicle on a track..." opens the
  Trainset tool.
- The inspector of a scenery model with an .eu07m file offers "Edit this model (F7)"; the floating window
  is gone.
- Review: the model is written to its .tmp, closed and checked before it replaces the file, and a failed
  .tmp is removed; play_clip counts From only for a positive pace again, so a pace of 0 holds the clip
  and a negative one runs it backwards.

New icons at the end of editor_icons.png (the cells before them are unchanged), the strings in
lang/editor_pl.po, new self-test commands (modelmode, modeltool, modeladdlight, modelundo, modelredo,
modelremove, modelplace, modelimport) and unit tests of remove_node. No asset in the SVN is needed or
changed; the import writes an .eu07m file into the game data only when the user asks for it.
2026-11-29 22:17:14 +01:00

88 lines
1.7 KiB
C++

/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "imgui/imgui.h"
// icons of the scenery editor. they're drawn by editor/icons/editor_icons.py into editor_icons.png, which CMake writes out
// as the bytes of an array built into the executable, so they're there without any file of the simulator
namespace editor_icons
{
// in the order of the cells of editor_icons.png
enum class icon
{
select,
insert,
brush,
area_fill,
copy_to_bank,
translate,
rotate,
scale,
local_space,
ortho,
perspective,
sculpt,
smooth,
chunks,
orthophoto,
road,
place,
lanes,
lay_track,
turnout,
straight,
curve,
signal,
objects,
vehicle,
profile,
speed,
joints,
infra,
gauge,
turntable,
parallel,
station,
kilometrage,
more,
// the fields of work
work_surroundings,
work_tracks,
work_roads,
work_terrain,
// the tools of the signalling beside signal and station
station_signals,
line_block,
// the tools of the terrain added later, at the end so the other cells stay where they were
hole,
grass,
// the catenary, added after the terrain tools for the same reason
catenary,
work_catenary,
gantry,
wires,
// the models, after the catenary for the same reason
work_models,
light,
pantograph,
parts_tree,
animation,
count
};
// pixels of the side of an icon, at the scale of the user interface
float size();
// draws the icon in the colour given, centred on the point. returns: false if the renderer can't show images
bool draw(ImDrawList *List, icon const Icon, ImVec2 const &Center, ImU32 const Color);
} // namespace editor_icons