MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / fromPack

Method fromPack

source/src/macro.cpp:142–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 pack.set("actions", acRun.toPack());
141 pack.set("actionsEnding", acEnd.toPack());
142 pack.set("actionsEntry", acEnt.toPack());
143 return pack;
144}
145void Macro::fromPack(const typepack::object& pack)
146{
147 if (name.isEmpty()) name = QString::fromStdString(pack.get("name").toString());
148
149 wndState = pack.get("wndState").toBool();
150 wndInfo.child = pack.get("wndChild").toBool();
151 wndInfo.name = QString::fromStdString(pack.get("wndName").toString());
152 wndInfo.clas = QString::fromStdString(pack.get("wndClass").toString());
153 wndInfo.proc = QString::fromStdString(pack.get("wndProc").toString());
154
155 matchState = pack.get("wndMatch").toBool();
156 wndMatch.name = QString::fromStdString(pack.get("wndMatchName").toString());
157 wndMatch.clas = QString::fromStdString(pack.get("wndMatchClass").toString());
158 wndMatch.proc = QString::fromStdString(pack.get("wndMatchProc").toString());
159
160 script = QString::fromStdString(pack.get("script").toString());
161
162 state = pack.get("state").toBool();
163 keyBlock = pack.get("keyBlock").toBool();
164 curBlock = pack.get("curBlock").toBool();
165
166 key1 = pack.get("key1").toInt();
167 key2 = pack.get("key2").toInt();
168
169 mode = QiRange::Restricted(static_cast<int>(pack.get("mode").toInt()), Macro::range_mode);
170 count = QiRange::Restricted(static_cast<int>(pack.get("count").toInt()), Macro::range_count);
171
172 timer = pack.get("timer").toBool();
173
174 timerStart = QiRange::Restricted((int)pack.get("timerStart").toInt(), Macro::range_timer);
175 timerEnd = QiRange::Restricted((int)pack.get("timerEnd").toInt(), Macro::range_timer);
176
177 speed = pack.get("speed").toFloat64();
178 if (speed == 0) speed = 1.0f;
179 else speed = QiRange::Restricted(speed, Macro::range_speed);
180
181 moveScaleX = pack.get("moveScaleX").toFloat64();
182 if (moveScaleX == 0) moveScaleX = 1.0f;
183 else moveScaleX = QiRange::Restricted(moveScaleX, Macro::range_moveScale);
184
185 moveScaleY = pack.get("moveScaleY").toFloat64();
186 if (moveScaleY == 0) moveScaleY = 1.0f;
187 else moveScaleY = QiRange::Restricted(moveScaleY, Macro::range_moveScale);
188
189 posScaleX = QiRange::Restricted(pack.get("posScaleX").toFloat64(), Macro::range_posScale);
190 posScaleY = QiRange::Restricted(pack.get("posScaleY").toFloat64(), Macro::range_posScale);
191
192 acRun.fromPack(pack.get("actions").toArray());
193 acEnd.fromPack(pack.get("actionsEnding").toArray());
194 acEnt.fromPack(pack.get("actionsEntry").toArray());

Callers 1

LoadQimMacroFunction · 0.45

Calls 7

RestrictedFunction · 0.85
toIntMethod · 0.80
toArrayMethod · 0.80
toStringMethod · 0.45
getMethod · 0.45
toBoolMethod · 0.45
toNumberMethod · 0.45

Tested by

no test coverage detected