Skip to content

Commit

Permalink
Fixed Copy button
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaredy00 committed Jan 6, 2024
1 parent 6d47322 commit 5bf46fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ https://github.com/Jaredy00/attprefabulator/releases/
<a href="https://github.com/Jaredy00/attprefabulator/releases/"><img src="public/images/prefabulator_controls.png" width="30%" height="30%" alt="Prefab Controls"></a>

### Release Notes
- v1.9.2 - Fixed Copy button to spawn items based on original player it was spawned on

- v1.9.1 - Items spawned on other players in the gift tab are now controllable from the control tab

- v1.9.0 - Fixed Set-Home, Updated Teleport locations, Added Tab for giving players levels and Updated Server settings
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prefabulator",
"version": "1.9.1",
"version": "1.9.2",
"productName": "Prefabulator",
"description": "Add, remove and modify prefabs in A Township Tale",
"main": "electron-start.js",
Expand All @@ -10,7 +10,7 @@
"server": "node index.js",
"dev": "nodemon --ignore data/ --ignore sessions/ --ignore main.js index.js",
"electron": "electron electron-start.js",
"package": "electron-packager . attPrefabulator-1.9.1 --platform=win32 --arch=x64 --overwrite --icon=./attprefabulator.ico --prune=false"
"package": "electron-packager . attPrefabulator-1.9.2 --platform=win32 --arch=x64 --overwrite --icon=./attprefabulator.ico --prune=false"
},
"bin": "index.js",
"pkg": {
Expand Down
6 changes: 5 additions & 1 deletion public/script/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var selectedPlayerName = null;
var selectedConfigForm = null;
var currentPlayersList = null;
var currentLoadedPrefabList = null;
let spawnedItems = {};
var prefabGroups = {};
var nextPrefabGroupId = 1;
var ControlKeyInterval = 100
Expand Down Expand Up @@ -1168,6 +1169,8 @@ $(document).ready(() => {
flash( e.currentTarget, "20, 255, 20")
if ( !!data.data.Result )
{
let itemId = data.data.Result[0].Identifier;
spawnedItems[itemId] = { playerId: player };
selectedPrefabId = data.data.Result[0].Identifier
$("#SelectedPrefabSelect option[value="+ selectedPrefabId +"]").remove()
let pname = selectedPrefabId +" - "+ data.data.Result[0].Name
Expand Down Expand Up @@ -1785,7 +1788,8 @@ $(document).ready(() => {
let optSelected = $("#SelectedPrefabSelect").find("option:selected").val()
if ( optSelected !== 'None' )
{
let player = $("input#PlayerConfigUserId").val()
let selectedItemData = spawnedItems[optSelected];
let player = selectedItemData ? selectedItemData.playerId : $("input#PlayerConfigUserId").val();
console.log( "copy selected prefab: ", optSelected )
wsSendJSON({ 'action': 'clone_prefab', 'player': player, 'hash': optSelected })
spinnerReplace( "CopySelectedPrefab" )
Expand Down

0 comments on commit 5bf46fa

Please sign in to comment.