function ss takes nothing returns nothing
endfunction
Name | Type | is_array | initial_value |
angle | real | No | |
cam | camerasetup | No | |
click_sound | sound | No | |
click_trigger | trigger | No | |
count_check | integer | No | |
current_loc | integer | No | |
effect | effect | No | |
gold_cost | integer | Yes | |
hash | hashtable | No | |
hover_trigger | trigger | No | |
lumber_cost | integer | Yes | |
merc_regions | rect | Yes | |
mercs | unitcode | Yes | |
number | integer | No | |
pay_sound | sound | No | |
QC_code | string | Yes | |
QC_end_command | string | Yes | |
QC_start_command | string | Yes | |
QC_total_commands | integer | No | |
s | string | No |
struct FullscreenQuest
static trackable accept
static trackable reject
static trackable array plus
static trackable array minus
static location array l
static location array display
static location array goldLoc
static location array lumberLoc
static location totalGoldLoc
static location totalLumberLoc
static integer array number
static integer goldCount = 0
static integer lumberCount = 0
static string model = "war3mapImported\\4x4Trackable.mdl"
static texttag array tag
static texttag array goldTag
static texttag array lumberTag
static texttag totalGold
static texttag totalLumber
static integer counter = 0
static integer max = 6
static method Init takes nothing returns nothing
local integer i = 1
//
set totalGoldLoc = GetRectCenter(gg_rct_Gold_Loc)
set totalLumberLoc = GetRectCenter(gg_rct_Lumber_Loc)
//
set l[1] = GetRectCenter(gg_rct_Region_001)
set l[2] = GetRectCenter(gg_rct_Region_000)
//
set l[3] = GetRectCenter(gg_rct_Region_002)
set l[4] = GetRectCenter(gg_rct_Region_003)
set l[5] = GetRectCenter(gg_rct_Region_004)
set l[6] = GetRectCenter(gg_rct_Region_005)
set l[7] = GetRectCenter(gg_rct_Region_006)
set l[8] = GetRectCenter(gg_rct_Region_007)
set l[9] = GetRectCenter(gg_rct_Region_008)
set l[10] = GetRectCenter(gg_rct_Region_009)
set l[11] = GetRectCenter(gg_rct_Region_010)
set l[12] = GetRectCenter(gg_rct_Region_011)
set l[13] = GetRectCenter(gg_rct_Region_012)
set l[14] = GetRectCenter(gg_rct_Region_013)
//
set goldLoc[1] = GetRectCenter(gg_rct_Gold_01)
set goldLoc[2] = GetRectCenter(gg_rct_Gold_02)
set goldLoc[3] = GetRectCenter(gg_rct_Gold_03)
set goldLoc[4] = GetRectCenter(gg_rct_Gold_04)
set goldLoc[5] = GetRectCenter(gg_rct_Gold_05)
set goldLoc[6] = GetRectCenter(gg_rct_Gold_06)
//
set lumberLoc[1] = GetRectCenter(gg_rct_Lumber_01)
set lumberLoc[2] = GetRectCenter(gg_rct_Lumber_02)
set lumberLoc[3] = GetRectCenter(gg_rct_Lumber_03)
set lumberLoc[4] = GetRectCenter(gg_rct_Lumber_04)
set lumberLoc[5] = GetRectCenter(gg_rct_Lumber_05)
set lumberLoc[6] = GetRectCenter(gg_rct_Lumber_06)
//
set display[1] = GetRectCenter(gg_rct_Start_01)
set display[2] = GetRectCenter(gg_rct_Start_02)
set display[3] = GetRectCenter(gg_rct_Start_03)
set display[4] = GetRectCenter(gg_rct_Start_04)
set display[5] = GetRectCenter(gg_rct_Start_05)
set display[6] = GetRectCenter(gg_rct_Start_06)
//
set accept = newTrackable()
set reject = newTrackable()
//
loop
exitwhen i > max
set minus[i] = newTrackable()
set plus[i] = newTrackable()
set number[i] = 0
set tag[i] = CreateTextTagLocBJ(I2S(number[i]), display[i], 0, 12, 255,255,255,255)
set goldTag[i] = CreateTextTagLocBJ(I2S(udg_gold_cost[i]), goldLoc[i], 0, 12, 255,255, 0, 255)
set lumberTag[i] = CreateTextTagLocBJ(I2S(udg_lumber_cost[i]), lumberLoc[i], 0, 12, 0, 255, 0,255)
set i = i + 1
endloop
set totalGold = CreateTextTagLocBJ(I2S(goldCount), totalGoldLoc, 0, 12, 255,255,255,255)
set totalLumber = CreateTextTagLocBJ(I2S(lumberCount), totalLumberLoc, 0, 12, 255,255,255,255)
endmethod
static method newTrackable takes nothing returns trackable
local destructable d
local trackable t
local real x
local real y
set counter = counter + 1
set x = GetLocationX(l[counter])
set y = GetLocationY(l[counter])
set d = CreateDestructableZ( 'OTip', x, y, 0, 0.00, 1, 0 )
set t = CreateTrackable(model, x, y, 270)
call RemoveDestructable(d)
call TriggerRegisterTrackableHitEvent(udg_click_trigger, t)
call TriggerRegisterTrackableTrackEvent(udg_hover_trigger, t)
return t
endmethod
static method onInit takes nothing returns nothing
endmethod
static method create takes nothing returns thistype
local thistype this = thistype.allocate()
return this
endmethod
method Update takes nothing returns nothing
endmethod
endstruct
//TESH.scrollpos=422
//TESH.alwaysfold=0
/*****************************************************************************
*
* String v2.3.0.6
* by Bannar aka Spinnaker
*
* Jass version of string library.
*
******************************************************************************
*
* struct String:
*
* readonly static constant integer npos
* special value, the exact meaning depends on the context
*
*
* String ctors & dctors:
*
* | static method create takes string s returns thistype
* | default ctor
* |
* | method destroy takes nothing returns nothing
* | default dctor
* |
* | static method operator [] takes thistype js returns thistype
* | copy ctor
*
*
* Capacity:
*
* | method empty takes nothing returns boolean
* | checks whether the string is empty
* |
* | method size takes nothing returns integer
* | returns the number of characters
* |
* | static constant method maxSize takes nothing returns integer
* | returns the maximum number of characters
*
*
* Element access:
*
* | method operator [] takes integer pos returns string
* | access specified character
* |
* | method operator []= takes integer pos, string s returns nothing
* | sets specified character
* |
* | method operator front takes nothing returns string
* | accesses the first character
* |
* | method operator back takes nothing returns string
* | accesses the last character
* |
* | method operator str takes nothing returns string
* | returns value of this string
*
*
* Operations:
*
* | method clear takes nothing returns nothing
* | clears the contents
* |
* | method assign takes string str returns thistype
* | replaces this string with a copy of str
* |
* | method assignSubstring takes string str, integer pos, integer count returns thistype
* | replaces this string with substring of str
* |
* | method insert takes integer pos, string str returns thistype
* | inserts str before character pointed by pos
* |
* | method insertSubstring takes integer pos, string str, integer subpos, integer count returns thistype
* | inserts substring of str before character pointed by pos
* |
* | method erase takes integer pos, integer count returns thistype
* | erases count characters starting at pos
* |
* | method pop takes nothing returns thistype
* | removes the last character
* |
* | method shift takes nothing returns thistype
* | removes the first character
* |
* | method append takes string str returns thistype
* | appends str to the end of this string
* |
* | method appendSubstring takes string str, integer pos, integer count returns thistype
* | appends substring of str to the end of this string
* |
* | method compare takes string str returns integer
* | compares value of this string with str
* |
* | method compareSubstrings takes integer pos, integer len, string str, integer subpos, integer sublen returns integer
* | compares substring of this string with substring of str
* |
* | method replace takes integer pos, integer count, string str returns thistype
* | replaces count characters starting at pos with str
* |
* | method replaceSubstrings takes integer pos, integer len, string str, integer subpos, integer sublen returns thistype
* | replaces len characters starting at pos with substring of str
* |
* | method substr takes integer pos, integer count returns string
* | returns substring of count characters starting at pos
* |
* | method resize takes integer count returns nothing
* | changes the number of characters stored
*
*
* Search:
*
* | method find takes string str returns integer
* | searches for the first occurrence of string str
* |
* | method findBuffer takes string str, integer pos, integer count returns integer
* | finds the first substring equal to the first count characters of str starting from pos
* |
* | method rfind takes string str returns integer
* | searches for the last occurrence of string s
* |
* | method rfindBuffer takes string str, integer pos, integer count returns integer
* | finds the last substring equal to the first count characters of str starting from pos
*
*
* Case conversion:
*
* | method capital takes nothing returns string
* | returns the value of string with first character in upper and all subsequent in lower case
* |
* | method upper takes nothing returns string
* | returns the value of this string in upper case
* |
* | method lower takes nothing returns string
* | returns the value of this string in lower case
*
*
*****************************************************************************/
library String
struct String extends array
readonly static constant integer npos = -1
private static integer count = 0
private thistype recycle
private string value
private integer length
static method create takes string s returns thistype
local thistype this = thistype(0).recycle
if this == 0 then
set count = count + 1
set this = count
else
set thistype(0).recycle = this.recycle
endif
set value = s
set length = StringLength(s)
return this
endmethod
method clear takes nothing returns nothing
set value = null
set length = 0
endmethod
method destroy takes nothing returns nothing
call clear()
set this.recycle = thistype(0).recycle
set thistype(0).recycle = this
endmethod
static method operator [] takes thistype js returns thistype
return create(js.value)
endmethod
method empty takes nothing returns boolean
return length == 0
endmethod
method size takes nothing returns integer
return length
endmethod
static constant method maxSize takes nothing returns integer
return 1023
endmethod
// private asserts for String objects
private method assert_pos takes integer pos, string f returns boolean
debug if ( pos < 0 or pos >= length ) then
debug call DisplayTimedTextFromPlayer(GetLocalPlayer(),0,0,60,"String::assert_pos failed at "+f+" for instance "+I2S(this)+". Invalid index at position "+I2S(pos)+".")
debug endif
return ( pos >= 0 and pos < length )
endmethod
private method assert_size takes integer count, string f returns boolean
debug if ( count > maxSize() ) then
debug call DisplayTimedTextFromPlayer(GetLocalPlayer(),0,0,60,"String::assert_size failed at "+f+" for instance "+I2S(this)+". Maximum size reached.")
debug endif
return ( count <= maxSize() )
endmethod
private method assert_range takes integer index, string f returns boolean
debug if ( index < 0 and index > length ) then
debug call DisplayTimedTextFromPlayer(GetLocalPlayer(),0,0,60,"String::assert_range failed at "+f+" for instance "+I2S(this)+". Invalid iterator at position "+I2S(index)+".")
debug endif
return ( index >= 0 and index <= length )
endmethod
private method assert_resize takes integer count, string f returns boolean
return assert_size(length + count, f)
endmethod
method operator [] takes integer pos returns string
debug if not assert_pos(pos, "operator []") then
debug return null
debug endif
return SubString(value, pos, pos+1)
endmethod
method operator []= takes integer pos, string s returns nothing
debug if not assert_pos(pos, "operator []=") then
debug return
debug endif
set value = SubString(value, 0, pos) + SubString(s, 0, 1) + SubString(value, pos+1, length)
endmethod
method operator front takes nothing returns string
return SubString(value, 0, 1)
endmethod
method operator back takes nothing returns string
return SubString(value, length-1, length)
endmethod
method operator str takes nothing returns string
return value
endmethod
method assign takes string str returns thistype
local integer len = StringLength(str)
if ( assert_size(len, "assign") ) then
set value = str
set length = len
endif
return this
endmethod
method assignSubstring takes string str, integer pos, integer count returns thistype
if ( count == npos ) then
set count = StringLength(str)
endif
return assign(SubString(str, pos, pos+count))
endmethod
method insert takes integer pos, string str returns thistype
local integer len
if ( assert_range(pos, "insert") ) then
set len = StringLength(str)
if ( len > 0 and assert_resize(len, "insert") ) then
set value = SubString(value, 0, pos) + str + SubString(value, pos, length)
set length = length + len
endif
endif
return this
endmethod
method insertSubstring takes integer pos, string str, integer subpos, integer count returns thistype
if ( count == npos ) then
set count = StringLength(str)
endif
return insert(pos, SubString(str, subpos, subpos+count))
endmethod
method erase takes integer pos, integer count returns thistype
if assert_pos(pos, "erase") then
if ( count == npos ) or ( pos+count > length ) then
set count = length - pos
endif
if ( count > 0 ) then
set value = SubString(value, 0, pos) + SubString(value, pos+count, length)
set length = length - count
endif
endif
return this
endmethod
method pop takes nothing returns thistype
if ( length > 0 ) then
set value = SubString(value, 0, length-1)
set length = length - 1
endif
return this
endmethod
method shift takes nothing returns thistype
if ( length > 0 ) then
set value = SubString(value, 1, length)
set length = length - 1
endif
return this
endmethod
method append takes string str returns thistype
local integer len = StringLength(str)
if ( len > 0 and assert_resize(len, "append") ) then
set value = value + str
set length = length + len
endif
return this
endmethod
method appendSubstring takes string str, integer pos, integer count returns thistype
if ( count == npos ) then
set count = StringLength(str)
endif
return append(SubString(str, pos, pos+count))
endmethod
method compare takes string str returns integer
if ( value == str ) then
return 0
elseif length > StringLength(str) then
return 1
endif
return -1
endmethod
method compareSubstrings takes integer pos, integer len, string str, integer subpos, integer sublen returns integer
local integer result = -1
local string sub
local string sub2
if ( len == npos ) then
set len = length
endif
if ( sublen == npos ) then
set sublen = StringLength(str)
endif
set sub = SubString(value, pos, pos+len)
set sub2 = SubString(str, subpos, subpos+sublen)
if sub == sub2 then
set result = 0
elseif StringLength(sub) > StringLength(sub2) then
set result = 1
endif
set sub = null
set sub2 = null
return result
endmethod
method replace takes integer pos, integer count, string str returns thistype
local integer len
if ( assert_pos(pos, "replace") ) then
if ( count == npos ) or ( pos+count > length ) then
set count = length - pos
endif
set len = StringLength(str) - count
if ( assert_resize(len, "replace") ) then
set value = SubString(value, 0, pos) + str + SubString(value, pos+count, length)
set length = length + len
endif
endif
return this
endmethod
method replaceSubstrings takes integer pos, integer len, string str, integer subpos, integer sublen returns thistype
if ( sublen == npos ) then
set sublen = StringLength(str)
endif
return replace(pos, len, SubString(str, subpos, subpos+sublen))
endmethod
method substr takes integer pos, integer count returns string
if ( assert_pos(pos, "substr") ) then
if ( count == npos ) then
set count = length
endif
return SubString(value, pos, pos+count)
endif
return null
endmethod
method resize takes integer count returns nothing
if ( count > length ) then
if ( assert_size(count, "resize") ) then
loop
exitwhen length >= count
set value = value + " "
set length = length + 1
endloop
endif
elseif ( count >= 0 and count < length ) then
set value = SubString(value, 0, count)
set length = count
endif
endmethod
method find takes string str, integer pos returns integer
local integer count
if ( assert_pos(pos, "find") ) then
set count = StringLength(str)
if ( count > 0 ) then
loop
exitwhen ( pos+count > length )
if ( SubString(value, pos, pos+count) == str ) then
return pos
endif
set pos = pos+1
endloop
endif
endif
return npos
endmethod
method findBuffer takes string str, integer pos, integer count returns integer
return find(SubString(str, 0, count), pos)
endmethod
method rfind takes string str, integer pos returns integer
local integer count
if ( pos == npos or pos >= length ) then
set pos = length - 1
endif
if ( assert_pos(pos, "rfind") ) then
set count = StringLength(str)
if ( count > 0 ) then
set pos = pos - count + 1
loop
exitwhen ( pos+1 < count )
if ( SubString(value, pos, pos+count) == str ) then
return pos
endif
set pos = pos-1
endloop
endif
endif
return npos
endmethod
method rfindBuffer takes string str, integer pos, integer count returns integer
return rfind(SubString(str, 0, count), pos)
endmethod
method capital takes nothing returns string
return StringCase(SubString(value, 0, 1), true) + SubString(value, 1, length)
endmethod
method upper takes nothing returns string
return StringCase(value, true)
endmethod
method lower takes nothing returns string
return StringCase(value, false)
endmethod
endstruct
endlibrary
library color
function ConvertString takes string text returns string
local String s = String.create(text)
local integer start
local integer end
local integer i = 1
local integer i2 = 1
loop
exitwhen i > udg_QC_total_commands
loop
exitwhen i2 > 5
set start = s.findBuffer(udg_QC_start_command[i], 0, s.size())
if start >= 0 then
call s.erase(start, StringLength(udg_QC_start_command[i]))
call s.insert(start, udg_QC_code[i])
endif
set end = s.findBuffer(udg_QC_end_command[i], 0, s.size())
if end < 0 then
set i2 = 6
endif
if end >= 0 then
call s.erase(end, StringLength(udg_QC_end_command[i]))
call s.insert(end, "|r")
endif
endloop
set i2 = 1
set i = i + 1
endloop
return s.str
endfunction
endlibrary