Добавлена команда hide для сокрытия спрайта
This commit is contained in:
parent
550aa83f17
commit
15309af6d8
@ -61,6 +61,11 @@ public final class Parser {
|
|||||||
if (match(token, TokenType.STOP)) return stop();
|
if (match(token, TokenType.STOP)) return stop();
|
||||||
if (match(token, TokenType.SHOW)) return show();
|
if (match(token, TokenType.SHOW)) return show();
|
||||||
|
|
||||||
|
if (match(token, TokenType.HIDE)) {
|
||||||
|
ViewActivity.getInstance().hideSprite(consume(TokenType.WORD).getText());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Текст с именем автора реплики.
|
// Текст с именем автора реплики.
|
||||||
if (lookMatch(1, TokenType.TEXT) && match(token, TokenType.WORD)) {
|
if (lookMatch(1, TokenType.TEXT) && match(token, TokenType.WORD)) {
|
||||||
final String whoid = token.getText();
|
final String whoid = token.getText();
|
||||||
|
@ -162,6 +162,13 @@ public final class ViewActivity extends Activity {
|
|||||||
} catch (Exception ioe) {}
|
} catch (Exception ioe) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void hideSprite(String whoid) {
|
||||||
|
if (!spriteInContainer.containsKey(whoid)) return;
|
||||||
|
final ImageView img = spriteInContainer.get(whoid);
|
||||||
|
spriteInContainer.remove(img);
|
||||||
|
container.removeView(img);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("RtlHardcoded")
|
@SuppressLint("RtlHardcoded")
|
||||||
private void setSpritePosition(ImageView img, FrameLayout.LayoutParams params, String position) {
|
private void setSpritePosition(ImageView img, FrameLayout.LayoutParams params, String position) {
|
||||||
// Позиционирование спрайта. fleft, left, cleft, center, cright, right, fright
|
// Позиционирование спрайта. fleft, left, cleft, center, cright, right, fright
|
||||||
|
Loading…
Reference in New Issue
Block a user