MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / renameLayer

Method renameLayer

radiantcore/layers/LayerModule.cpp:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void renameLayer(const cmd::ArgumentList& args)
125 {
126 if (args.size() != 2)
127 {
128 rError() << "Usage: " << COMMAND_RENAMELAYER << " <LayerID> <NewLayerName>" << std::endl;
129 return;
130 }
131
132 DoWithMapLayerManager([&](ILayerManager& manager)
133 {
134 auto layerName = manager.getLayerName(args[0].getInt());
135
136 if (args[1].getString().empty())
137 {
138 throw cmd::ExecutionFailure(_("Cannot use an empty string as new layer name"));
139 }
140
141 manager.renameLayer(args[0].getInt(), args[1].getString());
142 GlobalMapModule().setModified(true);
143 });
144 }
145
146 void deleteLayer(const cmd::ArgumentList& args)
147 {

Callers

nothing calls this directly

Calls 10

rErrorFunction · 0.85
DoWithMapLayerManagerFunction · 0.85
ExecutionFailureClass · 0.85
getIntMethod · 0.80
setModifiedMethod · 0.80
_Function · 0.50
sizeMethod · 0.45
getLayerNameMethod · 0.45
emptyMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected