Klicking an a Purebasic Program in KDE
Klicking an a Purebasic Program in KDE
Hy Purebasic Fans,
I want to achieve that when you Klick on my Program File in KDE my game is executed.
I want to achieve that when you Klick on my Program File in KDE my game is executed.
Last edited by Brujah on Fri Aug 12, 2005 12:28 am, edited 1 time in total.
I'm not sure if this would work for you but I use it when I need something out of the environment. Reading 'PWD' gives you the current directory...
BTW: I did not write this code, it is a little to dark for me just yet...
BTW: I did not write this code, it is a little to dark for me just yet...
Code: Select all
Procedure.s GetEnv(Variable$)
Protected *Environ.LONG
!extrn _environ
!mov eax, [_environ]
!mov [esp+4], eax
Variable$ + "="
While *Environ\l <> 0
If CompareMemoryString(@Variable$, *Environ\l, 0, Len(Variable$)) = 0
ProcedureReturn PeekS(*Environ\l + Len(Variable$))
EndIf
*Environ + 4
Wend
ProcedureReturn ""
EndProcedure
MessageRequester("test",GetEnv("PWD"))-Beach
You can also use getenv() from the libc, which is probably a bit cleaner:
Code: Select all
Procedure.s GetEnv(Variable$)
*result = getenv_(Variable$)
If *result
ProcedureReturn PeekS(*result)
Else
ProcedureReturn ""
EndIf
EndProcedurequidquid Latine dictum sit altum videtur
My Lost Labyrinth Spec
Maybe its useful to anyone.
Here comes the spec that I created for my game.
You create the rpm with it using the command "rpmbuild -ba laby2.spec"
I translated it to 3 languages.
Here comes the spec that I created for my game.
You create the rpm with it using the command "rpmbuild -ba laby2.spec"
I translated it to 3 languages.
Code: Select all
%define name laby
%define version 0.9.9
%define release 0
Name: %{name}
Summary: Lost Labyrinth is a so-called "roguelike" roleplaying computer game
Summary(de): Lost Labyrinth ist ein sogenanntes "roguelike"-Computerspiel
Summary(es): Lost Labyrinth es un Juego para computadoras parecido como el viejo "Roque"
Copyright: GPL
Group: Amusements/Games/Other
URL: http://laby.toybox.de/
Version: %{version}
Release: %{release}
Source0: %{name}_%{version}.tar.gz
Packager: Markus <mar_doe@gmx.de>
BuildRoot: /var/tmp/%{name}-%{version}-%{release}
Autoreqprov: On
%description
Lost Labyrinth is a so-called "roguelike" roleplaying computer game. Lost
Labyrinth has the following features:
* relatively short gameplay (about 10-20 minutes)
* very high replayability; nearly everything in the game is randomly generated
* Sketelon; a lot of options during the character generation; each character
type requires another strategy to survive
* Multiplayer games on the same machine (up to 4 players)
* "Zelda"-like graphics, sound and animation; smooth scrolling of game screen
* Open Source (GPL)
%description -l de
Lost Labyrinth ist ein sogenanntes "roguelike"-Computerspiel. Lost Labyrinth
bietet (im Vergleich zu ähnlichen Spielen) folgende Features:
* sehr kurze Spieldauer (ca. 10-20 Minuten)
* sehr hoher "Replayability"-Faktor; das Labyrinth wird komplett
zufallsgeneriert
* enorm große Anzahl an Charakteroptionen bei der Erschaffung; jeder Charakter
benötigt eine andere Spieltaktik
* Spiele mit mehreren Spielern an derselben Maschine (bis zu vier Spieler)
* "Zelda"-ähnliche Grafik, Sound & Animationen; weiches Scrolling
* Open Source (GPL)
%description -l es
Lost Labyrinth es un Juego para computadoras parecido como el viejo "Roque". Lost Labyrinth
in cambia tiene esos nuevos funciones:
* dura muy poco tiempo (normalmente 10-20 Minutos)
* el Labirinto es creado totalmente de casualidad
* muchas opciones para crear su personaje; cada personaje necesita una propia estrategia
* juegos con maximo 4 jugadores en la misma maquina
* Graficas como "zelda", Sonido & Animaciones; suave Scrolling
* Open Source (GPL)
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{name}_%{version}
%build
%install
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p "$RPM_BUILD_ROOT"/usr/games/%{name}
cp -r ./* "$RPM_BUILD_ROOT"/usr/games/%{name}
chmod 755 "$RPM_BUILD_ROOT"/usr/games/%{name}/laby
chmod 777 "$RPM_BUILD_ROOT"/usr/games/%{name}/highscores.dat
cat << EOF > "$RPM_BUILD_ROOT"/usr/games/%{name}/laby
#!/bin/sh
cd %{_libdir}/laby
killall artsd
./purebasic.exe
EOF
cat << EOF > "$RPM_BUILD_ROOT"%/usr/share/applications/laby.desktop
[Desktop Entry]
Encoding=UTF-8
Name=LostLabyrinth
GenericName=LostLabyrinth
GenericName[de]=LostLabyrinth
Comment=Laby Rulez!
Exec=/usr/games/%{name}/laby
Icon=/usr/games/%{name}/laby.xpm
Type=Application
Categories=Application;Game;RolePlaying;
EOF
%post
cat << EOF > ~/Desktop
[Desktop Entry]
Encoding=UTF-8
Name=LostLabyrinth
GenericName=LostLabyrinth
GenericName[de]=LostLabyrinth
Comment=Laby Rulez!
Exec=/usr/games/%{name}/laby
Icon=/usr/games/%{name}/laby.xpm
Type=Application
Categories=Application;Game;RolePlaying;
EOF
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
%files
%defattr(-, root, root)
/usr/games/%{name}/*
%changelog
* Mon Aug 15 2005 drcux <drcux@freenet.de>
First Build

