| 203 | } |
| 204 | |
| 205 | void SkillBarSetItem(OsiArgumentDesc const & args) |
| 206 | { |
| 207 | auto characterGuid = args[0].String; |
| 208 | auto slot = args[1].Int32; |
| 209 | auto itemGuid = args[2].String; |
| 210 | |
| 211 | auto item = FindItemByNameGuid(itemGuid); |
| 212 | if (item == nullptr) { |
| 213 | OsiError("Item '" << itemGuid << "' does not exist!"); |
| 214 | return; |
| 215 | } |
| 216 | |
| 217 | auto skillBarItem = SkillBarGetSlot(characterGuid, slot); |
| 218 | if (skillBarItem == nullptr) return; |
| 219 | |
| 220 | ObjectHandle handle; |
| 221 | item->GetObjectHandle(&handle); |
| 222 | // FIXME - check if item is in the players' inventory? |
| 223 | |
| 224 | skillBarItem->Type = esv::SkillBarItem::kItem; |
| 225 | skillBarItem->SkillOrStatId = item->StatsId; |
| 226 | skillBarItem->ItemHandle = handle; |
| 227 | |
| 228 | auto character = FindCharacterByNameGuid(characterGuid); |
| 229 | character->PlayerData->Dirty = true; |
| 230 | } |
| 231 | |
| 232 | void SkillBarClear(OsiArgumentDesc const & args) |
| 233 | { |
nothing calls this directly
no test coverage detected