Ci co tak spamują w Inne Niekolejowe, może tutaj coś pokażecie:
To jest ten fragment w zmieniacz.ms. Widocznie skrypt zmienia Tex1, Tex2, i inne, ale nie zmienia isolated. Hm, ale z drugiej strony... hm.
rollout findObjProp "Zmiana wg Wlasciwosci obiektu (Tex1, Tex2, ExportString, trakcja)"
(
edittext nName "Nazwa: " text:"Rail_screw_used1"
edittext nZmien "Zmien na: " text:"Rail_screw_used1.dds"
radiobuttons rb1 labels:#("cale wyrazy", "tekst(np. .tga, .dds)", "jesli znajdzie tekst to wymieni na calosc(np. Rail na Rail_screw_used1.dds)") default:1
button btn2 "Zmien"
label lb2 "Zmieniono 0 obiektow" align:#left
function ZmienNazweWObjectProp=
(
licznik1 = 0
licznik2 = 0
if(rb1.state == 1) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "ExportString" nZmien.text
licznik1 +=1
)
if (SuperClassOf node == shape) then
(
prop1 = (getUserProp node "Tex1")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Tex1" nZmien.text
licznik1 +=1
)
prop1 = (getUserProp node "Tex2")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Tex2" nZmien.text
licznik1 +=1
)
for nrslupa=1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node (nrslupa as string) nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
if(rb1.state == 3) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "ExportString" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
if (SuperClassOf node == shape) then
(
prop1 = (getUserProp node "Tex1")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "Tex1" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
prop1 = (getUserProp node "Tex2")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "Tex2" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
for nrslupa= 1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node (nrslupa as string) nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
)
if(rb1.state == 2) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "ExportString" (text1 + nZmien.text)
else setUserProp node "ExportString" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
if (SuperClassOf node == shape) then
(
--Tex1
prop1 = (getUserProp node "Tex1")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "Tex1" (text1 + nZmien.text)
else setUserProp node "Tex1" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
--Tex2
prop1 = (getUserProp node "Tex2")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "Tex2" (text1 + nZmien.text)
else setUserProp node "Tex2" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
for nrslupa=1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if ((prop1 as string) != "undefined") then
(
pos1 = undefined
pos1 = FindString prop1 nName.text
if pos1 != undefined then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node (nrslupa as string) (text1 + nZmien.text)
else setUserProp node (nrslupa as string) (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
)
)
)
on btn2 pressed do
(
lb2.text = "Zmieniono 0 obiektow"
ZmienNazweWObjectProp()
)
)
addRollout findObjProp changeProp