slave-princess-charlotte/data/Plugin/LR.js
2025-10-12 13:17:46 -05:00

103 lines
3.9 KiB
JavaScript

(function() {
ShopLayoutScreen.previousUnit = function() {
var scrollBar = this._unitSelectWindow._scrollbar;
var cursor = scrollBar._commandCursor;
var d = cursor._getIntervalValue(InputType.LEFT);
cursor._changeCursorIndex(d);
this._unitSelectWindow._unitFirst = this._unitSelectWindow._scrollbar.getObject();
this._targetUnit = this._unitSelectWindow.getFirstUnit();
this._buyItemWindow.updateItemArea();
this._buyItemWindow._scrollbar.setIndex(0);
var item = this._buyItemWindow._scrollbar.getObject();
this._itemInfoWindow.setInfoItem(item);
this._resetUnitItemArray();
};
ShopLayoutScreen.nextUnit = function() {
var scrollBar = this._unitSelectWindow._scrollbar;
var cursor = scrollBar._commandCursor;
var d = cursor._getIntervalValue(InputType.RIGHT);
cursor._changeCursorIndex(d);
this._unitSelectWindow._unitFirst = this._unitSelectWindow._scrollbar.getObject();
this._targetUnit = this._unitSelectWindow.getFirstUnit();
this._buyItemWindow.updateItemArea();
this._buyItemWindow._scrollbar.setIndex(0);
var item = this._buyItemWindow._scrollbar.getObject();
this._itemInfoWindow.setInfoItem(item);
this._resetUnitItemArray();
};
var _VerticalDataChanger_checkDataIndex = VerticalDataChanger.checkDataIndex;
VerticalDataChanger.checkDataIndex = function(list, data) {
if (this._disableLR) {
return _VerticalDataChanger_checkDataIndex.call(this, list, data);
}
var index = -1;
if (InputControl.isInputAction(InputType.UP) || MouseControl.isInputAction(MouseType.UPWHEEL) || InputControl.isLeftPadAction()) {
index = this._changePage(list, data, false);
}
else if (InputControl.isInputAction(InputType.DOWN) || MouseControl.isInputAction(MouseType.DOWNWHEEL) || InputControl.isRightPadAction()) {
index = this._changePage(list, data, true);
}
return index;
};
var _StockItemTradeScreen_moveStore = StockItemTradeScreen._moveStore;
StockItemTradeScreen._moveStore = function() {
if (InputControl.isLeftPadAction() || InputControl.isRightPadAction()) {
index = this._dataChanger.checkDataIndex(this._unitList, this._unit);
if (index !== -1) {
this._itemInfoWindow.setInfoItem(null);
this._processMode(StockItemTradeMode.OPERATION);
this._unit = this._unitList.getData(index);
this._unitItemWindow.setUnitItemFormation(this._unit);
this._unitSimpleWindow.setFaceUnitData(this._unit);
this._stockItemWindow.setStockItemFormation2(this._unit);
}
return MoveResult.CONTINUE;
}
return _StockItemTradeScreen_moveStore.call(this);
};
var _StockItemTradeScreen_moveExtract = StockItemTradeScreen._moveExtract;
StockItemTradeScreen._moveExtract = function() {
if (InputControl.isLeftPadAction() || InputControl.isRightPadAction()) {
index = this._dataChanger.checkDataIndex(this._unitList, this._unit);
if (index !== -1) {
this._itemInfoWindow.setInfoItem(null);
this._processMode(StockItemTradeMode.OPERATION);
this._unit = this._unitList.getData(index);
this._unitItemWindow.setUnitItemFormation(this._unit);
this._unitSimpleWindow.setFaceUnitData(this._unit);
this._stockItemWindow.setStockItemFormation2(this._unit);
}
return MoveResult.CONTINUE;
}
return _StockItemTradeScreen_moveExtract.call(this);
};
/*
ItemOperationWindow.getWindowWidth = function() {
return ItemRenderer.getItemWindowWidth2();
};
ItemOperationScrollbar.getObjectWidth = function() {
return Math.floor(ItemRenderer.getItemWidth2() / 3);
};*/
ItemRenderer.getItemWidth = function() {
return 260;
};
ItemRenderer.getItemWindowWidth2 = function() {
return this.getItemWidth2() + (DefineControl.getWindowXPadding() * 2);
};
})();