[UTILITY] Lua 5.1 tools: compiler, decompiler, snippets & extendable lua.dll with SDK

Search This thread

avimak

Senior Member
Nov 23, 2008
488
1
Not working...

in the next files:
Code:
contactpickerallscript.lua
contactpickerscript.lua
peopleallscript.lua
peoplefavoriteglobal.lua
peopleselectcontactscript.lua
I changed the:
Code:
local l_10_1 = string.char(l_10_0 + 65)

to:
Code:
LetterArray = {[0] = "׳�",
[1] = "׳‘",
[2] = "׳’",
[3] = "׳“",
[4] = "׳”",
[5] = "׳•",
[6] = "׳–",
[7] = "׳—",
[8] = "׳˜",
[9] = "׳™",
[10] = "׳›",
[11] = "׳œ",
[12] = "׳ž",
[14] = "ס",
[13] = "׳*",
[15] = "׳¢",
[16] = "׳₪",
[17] = "׳¦",
[18] = "׳§",
[19] = "׳¨",
[20] = "׳©",
[21] = "׳×",
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
  local l_10_1 = LetterArray[l_10_0]
  if l_10_1 == nil then
  l_10_1 = "A"
  end

And it crashed.... not even opened the contacts page.

but after I changed each file with his l_*_*, for example:
for
Code:
local [b]l_16_1[/b] = string.char(l_10_0 + 65)
i changed your code to
Code:
  local [b]l_16_1[/b] = LetterArray[l_10_0]
  if [b]l_16_1[/b] == nil then
  [b]l_16_1[/b] = "A"
  end
It shows me the slider and handle the press/release as always but no effect on the list itself...

maybe I didn't understand your instruction correctly, can you change one of those files in a way you think it should work so i'll understand it better?
:)
 
Last edited:

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
Not working...

in the next files:
Code:
contactpickerallscript.lua
contactpickerscript.lua
peopleallscript.lua
peoplefavoriteglobal.lua
peopleselectcontactscript.lua
I changed the:
Code:
local l_10_1 = string.char(l_10_0 + 65)

to:
Code:
LetterArray = {[0] = "׳�",
[1] = "׳‘",
[2] = "׳’",
[3] = "׳“",
[4] = "׳”",
[5] = "׳•",
[6] = "׳–",
[7] = "׳—",
[8] = "׳˜",
[9] = "׳™",
[10] = "׳›",
[11] = "׳œ",
[12] = "׳ž",
[14] = "ס",
[13] = "׳*",
[15] = "׳¢",
[16] = "׳₪",
[17] = "׳¦",
[18] = "׳§",
[19] = "׳¨",
[20] = "׳©",
[21] = "׳×",
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
  local l_10_1 = LetterArray[l_10_0]
  if l_10_1 == nil then
  l_10_1 = "A"
  end

And it crashed.... not even opened the contacts page.

but after I changed each file with his l_*_*, for example:
for
Code:
local [b]l_16_1[/b] = string.char(l_10_0 + 65)
i changed your code to
Code:
  local [b]l_16_1[/b] = LetterArray[l_10_0]
  if [b]l_16_1[/b] == nil then
  [b]l_16_1[/b] = "A"
  end
It shows me the slider and handle the press/release as always but no effect on the list itself...

maybe I didn't understand your instruction correctly, can you change one of those files in a way you think it should work so i'll understand it better?
:)

No, it simply does not work. I'll look at it someday, but a bit later :)
 

avimak

Senior Member
Nov 23, 2008
488
1
Good news!
I just found out that if i'm changing the right pointer too the English part of the Array is working.

for example:
local l_16_1 = LetterArray[l_16_0]
and in another file:
local l_12_1 = LetterArray[l_12_0]
Etc...

and then, the:
Code:
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
part of my array is working great!
even if i'm deleting the
Code:
  if l_16_1 == nil then
  l_16_1 = "A"
  end
part...

Still, no luck with the Hebrew letters.
 

avimak

Senior Member
Nov 23, 2008
488
1
Try replacing this:
local l_10_2 = ContactObj.ContactList:GetLetterIndex(tostring(l_10_1)) + ContactObj.offset

with this:

local l_10_2 = ContactObj.ContactList:GetLetterIndex(l_10_1) + ContactObj.offset

maybe...

Nope :(

only the
Code:
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
of my Array is working while scrolling...
The Hebrew letters only kick it to the head of the contacts..

any other Idea? maybe I can write it "one by one" and not through array?
thanks for helping man :)
I'm sure it'll be helpful for a lot of users (probably any Unicode user) :)
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
Nope :(

only the
Code:
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
of my Array is working while scrolling...
The Hebrew letters only kick it to the head of the contacts..

any other Idea? maybe I can write it "one by one" and not through array?
thanks for helping man :)
I'm sure it'll be helpful for a lot of users (probably any Unicode user) :)

You might be out of luck, GetLetterIndex is a non-lua function, and if that function can't handle unicode characters then you can't use it to determine the starting position. There might be workarounds (like getting all contacts and seardching through them), but I don't know if this is possible.
 

avimak

Senior Member
Nov 23, 2008
488
1
You might be out of luck, GetLetterIndex is a non-lua function, and if that function can't handle unicode characters then you can't use it to determine the starting position. There might be workarounds (like getting all contacts and seardching through them), but I don't know if this is possible.

I can't believe it's not an Unicode supporter...
What about the Arabic/Russian/German/Chinese devices? they always have solution for them, even for the RandomAccess in the old contacts screen - they had sliders in Russian or Arabic...

What's that second thing you said? I didn't get it...
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
I can't believe it's not an Unicode supporter...
What about the Arabic/Russian/German/Chinese devices? they always have solution for them, even for the RandomAccess in the old contacts screen - they had sliders in Russian or Arabic...

What's that second thing you said? I didn't get it...

As I see the letterpicker part of rhodium2 is not unicode aware...

I meant read all of the contacts one by one (dunno how to do this, but should be possible), and check whether it starts with the character you specified.
 

mun_rus

Senior Member
Oct 26, 2006
738
0
this is an example of russian letter picker

Code:
if string.lower(_application.Store:GetStringValue(Lifetime_Permanent, "Locale")) == "ru-ru" then
   LetterCount = 33
   LetterOffset = 1040
   LetterFontSize = 16
else
   LetterCount = 26
   LetterOffset = 65
   LetterFontSize = 20
end

...
LetterPicker.ItemCreated = function(l_3_0, l_3_1, l_3_2)   l_3_2.Namespace:FindName("Letter").onRelease:connect(l_3_0.HandleMouseReleaseInList, l_3_0)   l_3_2.Namespace:FindName("Letter").onReleaseOutside:connect(l_3_0.HandleMouseReleaseInList, l_3_0)   l_3_2.Namespace:FindName("Letter").onPress:connect(l_3_0.HandleMousePressInList, l_3_0)
l_3_2.Namespace:FindName("Letter").onRollOver:connect(l_3_0.HandleRollOver, l_3_0)
l_3_2.Namespace:FindName("Letter").String = string.char(l_3_1 + LetterOffset)
l_3_2.Namespace:FindName("Letter").FontSize = l_3_0.LetterFontSize
l_3_2.Namespace:FindName("Letter").Size.height = l_3_0.itemhight
l_3_2.Tag = l_3_1
end
....
LetterPicker.HandleRollOver = function(l_5_0, l_5_1)
   l_5_0.ListViewInstance:GetGenerator():SelectObject(l_5_1)
   l_5_0:SetLetter(l_5_1.String)
end


LetterPicker.HandleMousePressInList = function(l_6_0, l_6_1, l_6_2)
   trace("[LetterPicker] : HandleMousePressInList")
   l_6_0.ListViewInstance:GetGenerator():SelectObject(l_6_1)
   l_6_2.value = true
   l_6_0:SetLetter(l_6_1.String)
   l_6_0:ShowCharacterDialog(true)
   l_6_0.ListViewInstance:GetLayout().SelectionNode.Opacity.value = 100
end

LetterPicker.SetLetter = function(l_9_0, l_9_1)
   l_9_0.Letter_Char.String = l_9_1
end

LetterPicker.Reset = function(l_10_0)
   trace("[LetterPicker] : Reset")
   l_10_0.ListViewInstance:GetGenerator().SelectedIndex = 0
end
.....

I got a russian letters line in contacts and changed all offsets to 1040 but it's dont work for me either.
I think we missed smth important but unnoticable for 1st view
 

avimak

Senior Member
Nov 23, 2008
488
1
this is an example of russian letter picker

Code:
if string.lower(_application.Store:GetStringValue(Lifetime_Permanent, "Locale")) == "ru-ru" then
   LetterCount = 33
   LetterOffset = 1040
   LetterFontSize = 16
else
   LetterCount = 26
   LetterOffset = 65
   LetterFontSize = 20
end

...
LetterPicker.ItemCreated = function(l_3_0, l_3_1, l_3_2)   l_3_2.Namespace:FindName("Letter").onRelease:connect(l_3_0.HandleMouseReleaseInList, l_3_0)   l_3_2.Namespace:FindName("Letter").onReleaseOutside:connect(l_3_0.HandleMouseReleaseInList, l_3_0)   l_3_2.Namespace:FindName("Letter").onPress:connect(l_3_0.HandleMousePressInList, l_3_0)
l_3_2.Namespace:FindName("Letter").onRollOver:connect(l_3_0.HandleRollOver, l_3_0)
l_3_2.Namespace:FindName("Letter").String = string.char(l_3_1 + LetterOffset)
l_3_2.Namespace:FindName("Letter").FontSize = l_3_0.LetterFontSize
l_3_2.Namespace:FindName("Letter").Size.height = l_3_0.itemhight
l_3_2.Tag = l_3_1
end
....
LetterPicker.HandleRollOver = function(l_5_0, l_5_1)
   l_5_0.ListViewInstance:GetGenerator():SelectObject(l_5_1)
   l_5_0:SetLetter(l_5_1.String)
end


LetterPicker.HandleMousePressInList = function(l_6_0, l_6_1, l_6_2)
   trace("[LetterPicker] : HandleMousePressInList")
   l_6_0.ListViewInstance:GetGenerator():SelectObject(l_6_1)
   l_6_2.value = true
   l_6_0:SetLetter(l_6_1.String)
   l_6_0:ShowCharacterDialog(true)
   l_6_0.ListViewInstance:GetLayout().SelectionNode.Opacity.value = 100
end

LetterPicker.SetLetter = function(l_9_0, l_9_1)
   l_9_0.Letter_Char.String = l_9_1
end

LetterPicker.Reset = function(l_10_0)
   trace("[LetterPicker] : Reset")
   l_10_0.ListViewInstance:GetGenerator().SelectedIndex = 0
end
.....

I got a russian letters line in contacts and changed all offsets to 1040 but it's dont work for me either.
I think we missed smth important but unnoticable for 1st view

maybe if we had a way to skip the "GetLetterIndex" and create a different way to check the first letters in contacts it would work, as sztupy just wrote to me.
do you have any Idea?
 

avimak

Senior Member
Nov 23, 2008
488
1
something else, mun_rus, did you change this + 65 value in the rest of the files?
I got the control of the slider - just read it above - but it doesn't recognize my Hebrew letter (the unicode part).
 

hallatore

Senior Member
Feb 28, 2007
162
5
Hi, I hope this is the right place to ask. Have't found a good lua thread yet.

Just started playing around with the lua and mode9 files.
Pretty easy syntax, but the data sure is spread across alot of files :rolleyes:

So far i have made this no call history in today tab mod.

I've been wondering about a couple of things.
Q: How can I get the Notifications (call history, appointments) higher up?

Q: where can I edit the 3D clocks size?

Q: Where does the 3D render of the clock come from? (The one that has the animation, can't find it in the source.

I've edited every single setting in home.mode9 and I got the clock to get smaller, but the overlay animated (3D?) clock still has the same size. Is it's size set by the clock's image-files maybe?

I've also played around with the lua that sets most of the stuff in home.mode9. but there are't alot of settings there to change.
 

avimak

Senior Member
Nov 23, 2008
488
1
Hi, I hope this is the right place to ask. Have't found a good lua thread yet.

Just started playing around with the lua and mode9 files.
Pretty easy syntax, but the data sure is spread across alot of files :rolleyes:

So far i have made this no call history in today tab mod.

I've been wondering about a couple of things.
Q: How can I get the Notifications (call history, appointments) higher up?

Q: where can I edit the 3D clocks size?

Q: Where does the 3D render of the clock come from? (The one that has the animation, can't find it in the source.

I've edited every single setting in home.mode9 and I got the clock to get smaller, but the overlay animated (3D?) clock still has the same size. Is it's size set by the clock's image-files maybe?

I've also played around with the lua that sets most of the stuff in home.mode9. but there are't alot of settings there to change.

If you want to play with the clock size, I believe you'll need to play with the PNG files too..
look through "mode9 editor" to find out which ones are the clock image files...

BTW, can you help us with the contact scroll bar? :)
 

hallatore

Senior Member
Feb 28, 2007
162
5
BTW, can you help us with the contact scroll bar? :)

It's still scrolling too far?

I will try, my first day with mode9 and lua stuff today. Need some sleep before school, and then maybe i get some time tomorrow :)


PS: I see there are alot of .lua files that still contain the 480x800 sizes. might affect the child objects?

Examples:
- layoutinfo.lua
- manila.lua
 

hallatore

Senior Member
Feb 28, 2007
162
5
I have no idea how to cook the whole manila, but why not try this.

Use Visual studio to replace "800 and "-800 with "640 and "-640 in all the decompiled lua files?

I just did a quick search and I found 33 entries.
Ofcourse there are alot of entries like 788 etc, those are a bit worse to find.
 

avimak

Senior Member
Nov 23, 2008
488
1
It's still scrolling too far?

I will try, my first day with mode9 and lua stuff today. Need some sleep before school, and then maybe i get some time tomorrow :)


PS: I see there are alot of .lua files that still contain the 480x800 sizes. might affect the child objects?

Examples:
- layoutinfo.lua
- manila.lua

I'm not sure you understood my request :)
Just read from 263 message, the whole conversation between me, sztupy and mun_rus...

thanks ;)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I still haven't been able to figure out where this is actually referring too. I see similar situation in other lua files. But in each case, I've been unable to locate where or what it's actually trying to do. :confused:

    They are dialogs (as their name suggests). They are defined in manila.xml (26948339_manila). They seem to be like some kind of "embedded mode9" files

    Example:
    Code:
    <PageGroup Name="settings">
    (...)
      <PageGroup Name="updatesanddata">
        <Page Order="0" Name="updatesanddata.page" PackageName="HTC" Title="[[IDS_UPDATESANDDATA]]" Default="true" >
          <ComponentReference Name="page"  Mode9Path="HTC\settings.mode9" Component="UpdatesAndDataPageComponent" SmartComponent="true"  />
        </Page>
      </PageGroup>
    (...)
    </PageGroup>