Unpin removes a skill from the pinned set. No-op (with a friendly notice) when the skill wasn't pinned to begin with.
(name string)
| 1237 | // Unpin removes a skill from the pinned set. No-op (with a friendly notice) |
| 1238 | // when the skill wasn't pinned to begin with. |
| 1239 | func (sh *SkillHandler) Unpin(name string) { |
| 1240 | sh.pinnedSkillsMu.Lock() |
| 1241 | _, was := sh.pinnedSkillNames[name] |
| 1242 | if was { |
| 1243 | delete(sh.pinnedSkillNames, name) |
| 1244 | } |
| 1245 | sh.pinnedSkillsMu.Unlock() |
| 1246 | |
| 1247 | if !was { |
| 1248 | fmt.Printf("\n %s %s\n\n", colorize(i18n.T("skill.unpin.not_pinned"), ColorGray), colorize(name, ColorCyan)) |
| 1249 | return |
| 1250 | } |
| 1251 | |
| 1252 | sh.logger.Info("skill unpinned", zap.String("skill", name)) |
| 1253 | fmt.Printf("\n %s %s\n\n", |
| 1254 | colorize(i18n.T("skill.unpin.success"), ColorGreen), |
| 1255 | colorize(name, ColorCyan)) |
| 1256 | } |
| 1257 | |
| 1258 | // ShowPinned lists all currently pinned skills for the session. |
| 1259 | func (sh *SkillHandler) ShowPinned() { |