Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

A program request

trbbltrbbl Posts: 1Member
Hello,

I'm looking for someone who would create a very simple program (as far as I know. I don't know a thing about coding though) from this code:
[code]<?php

$files = array_merge(glob("MAP-NAME-HERE"));;

// C = unsigned char--- B G R A
$new_top = pack("CCCC", 127, 146, 144, 0); // top
$new_bot = pack("CCCC", 0, 0, 0, 0); // bottom

echo "Found " . count($files) . " file(s) - processing...

";

$i = 1;

foreach($files as $file){
echo $i . ". " . $file . " ... ";
$contents = file_get_contents($file, FILE_BINARY);
// replace that
$mod = substr_replace($contents, $new_top, 4+1+38+1+24, 4);
$mod = substr_replace($mod, $new_bot, 4+1+38+1+24+4, 4);
// overwrite
file_put_contents($file, $mod);
echo " ... OK!
";
$i++;
}

?>[/code]

What does it do? It changes the background color of maps in a game called Soldat, 2D sidescrolling action game. You should try it, honestly.

What I am looking for is some kind of an user interface, a simple one. It should contain at least these thingies:

---------------------------------
Map name: [---]
Top: [RR][GG][BB]
Bottom: [RR][GG][BB]
[Execute]
---------------------------------

If it's somehow possible, I'd love to see an integrated colour picker, too. For both top and bottom colours. Also, it should work in either the directory the program is, or *homedirMaps. Since I have no clue how this all works, it's up to you to decide.

I would be very thankful if someone had the time and motivation to make the program. + I'm sorry if this is not the correct place to post this (which is probably exactly what it is)

Regards,
Mikko
Sign In or Register to comment.