User Tools

Site Tools


scripting:samples:functionbuilding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:samples:functionbuilding [2020/02/12 16:30] mitscripting:samples:functionbuilding [2023/02/28 07:04] (current) mit
Line 10: Line 10:
  $textX = 200  $textX = 200
  $subtextWidth = 300  $subtextWidth = 300
 +        // Set root path for all the menu images..
 + osdadditem(HTTPSET, "", "http://gameislands.net/gamecontent/zion3/menus/" )
  
  while( $aConstructionList[$index+1] >= 0 )  while( $aConstructionList[$index+1] >= 0 )
Line 22: Line 24:
  $matReqd = sysGetConstructionMaterialsAmount( $buildingType )  $matReqd = sysGetConstructionMaterialsAmount( $buildingType )
  $price = sysGetSecondaryConstructionPrice( $buildingType )  $price = sysGetSecondaryConstructionPrice( $buildingType )
- osdaddat(IMAGE, $imageX, $lineY, 90, 90, "$selectFunc|$buildingType|$price", "$imageName"+ osdadd(IMAGE, $imageX, $lineY, 90, 90, "$selectFunc|$buildingType|$price", "$imageName"
  $textY = $lineY  $textY = $lineY
- osdaddat(BIGTEXT, $textX, $textY, 0, 0, "", "$buildingName" )+ osdadd(BIGTEXT, $textX, $textY, 0, 0, "", "$buildingName" )
  $textY += 20  $textY += 20
  $priceText = sysGetPriceText( $price )  $priceText = sysGetPriceText( $price )
- osdaddat(SMALLTEXT, $textX, $textY, 0, 0, "", "Cost: $priceText ( + town tax )" )+ osdadd(SMALLTEXT, $textX, $textY, 0, 0, "", "Cost: $priceText ( + town tax )" )
  $textY += 15  $textY += 15
- osdaddat(SMALLTEXT, $textX, $textY, 0, 0, "", "Req: $matReqd Wood" )+ osdadd(SMALLTEXT, $textX, $textY, 0, 0, "", "Req: $matReqd Wood" )
  $subtextY = $textY + 20  $subtextY = $textY + 20
- osdaddat(FADEDSMALLTEXT, $textX, $subtextY, $subtextWidth, 0, "", "$desc" )+ osdadd(FADEDSMALLTEXT, $textX, $subtextY, $subtextWidth, 0, "", "$desc" )
  
  $lineY += 100  $lineY += 100
Line 43: Line 45:
 <code> <code>
 $maConstructionListBuildHouses[] =  $maConstructionListBuildHouses[] = 
-{ // Building Name    buildID   Price      builditem  graphic  desc+{ // Building Name       buildID         Price      builditem   graphic  desc
  "Small House",    68, 100,   "Wood", "stdhouse1.jpg", "50 item capacity",  "Small House",    68, 100,   "Wood", "stdhouse1.jpg", "50 item capacity",
  "Medium House",    69, 200,   "Wood", "stdhouse2.jpg", "100 item capacity",  "Medium House",    69, 200,   "Wood", "stdhouse2.jpg", "100 item capacity",
Line 55: Line 57:
  osdcreate(OSDWINDOW,"BuildHousesOSD", "Build Houses"  osdcreate(OSDWINDOW,"BuildHousesOSD", "Build Houses"
  osdadditem(OSDMINHEIGHT, "", "400"  osdadditem(OSDMINHEIGHT, "", "400"
- osdaddat(BIGTEXT, 0, 0, 600, 0, "", "Choose a building to construct:" )+ osdadd(BIGTEXT, 0, 0, 600, 0, "", "Choose a building to construct:" )
  
  ConstructionListOSD( $maConstructionListBuildHouses, "Construct" )  ConstructionListOSD( $maConstructionListBuildHouses, "Construct" )
  
- osdaddat(EXITBUTTON, 200, 360, 200, 30, "", "Cancel"+ osdadd(EXITBUTTON, 200, 360, 200, 30, "", "Cancel"
  osdactivate()   osdactivate() 
 } }
scripting/samples/functionbuilding.1581546617.txt.gz · Last modified: 2020/02/12 16:30 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki