Example #1
0
  /** @param state0 int */
  private void refreshArcStateDisplay() {
    switch (arcState) {
      case 0:
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setToolTipText("Targeting arcs: Off");
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setIcon(FSkin.getIcon(FSkinProp.ICO_ARCSOFF));
        VDock.SINGLETON_INSTANCE.getBtnTargeting().repaintSelf();
        break;
      case 1:
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setToolTipText("Targeting arcs: Card mouseover");
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setIcon(FSkin.getIcon(FSkinProp.ICO_ARCSHOVER));
        VDock.SINGLETON_INSTANCE.getBtnTargeting().repaintSelf();
        break;
      default:
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setIcon(FSkin.getIcon(FSkinProp.ICO_ARCSON));
        VDock.SINGLETON_INSTANCE.getBtnTargeting().setToolTipText("Targeting arcs: Always on");
        VDock.SINGLETON_INSTANCE.getBtnTargeting().repaintSelf();
        break;
    }

    FModel.getPreferences().setPref(FPref.UI_TARGETING_OVERLAY, String.valueOf(arcState));
    // FModel.SINGLETON_INSTANCE.getPreferences().save();
  }
Example #2
0
  /* (non-Javadoc)
   * @see forge.gui.framework.ICDoc#initialize()
   */
  @SuppressWarnings("serial")
  @Override
  public void initialize() {
    final String temp = FModel.getPreferences().getPref(FPref.UI_TARGETING_OVERLAY);

    // Old preference used boolean; new preference needs 0-1-2
    // (none, mouseover, solid).  Can remove this conditional
    // statement after a while...Doublestrike 17-10-12
    if (temp.equals("0") || temp.equals("1")) {
      arcState = Integer.valueOf(temp);
    } else {
      arcState = 2;
    }

    refreshArcStateDisplay();

    VDock.SINGLETON_INSTANCE
        .getBtnConcede()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                MatchUtil.concede();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnSettings()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                SOverlayUtils.showOverlay();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnEndTurn()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                endTurn();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnViewDeckList()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                viewDeckList();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnRevertLayout()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                revertLayout();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnOpenLayout()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                openLayout();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnSaveLayout()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                saveLayout();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnAlphaStrike()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                MatchUtil.getHumanController().alphaStrike();
              }
            });
    VDock.SINGLETON_INSTANCE
        .getBtnTargeting()
        .setCommand(
            new UiCommand() {
              @Override
              public void run() {
                toggleTargeting();
              }
            });
  }